mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 10:09:47 +01:00
07a35d5d41
The HTML Processor maintains a stack of open elements, where every element, every `#text` node, every HTML comment, and other node is pushed and popped while traversing the document. The "depth" of each of these nodes represents how deep that stack is where the node appears. Unfortunately this information isn't exposed to calling code, which has led different projects to attempt to calculate this value externally. This isn't always trivial, but the HTML Processor could make it so by exposing the internal knowledge in a new method. In this patch the `get_current_depth()` method returns just that. Since the processor always exists within a context, the depth includes nesting from the always-present html element and also the body, since currently the HTML Processor only supports parsing in the IN BODY context. This means that the depth reported for the `DIV` in `<div>` is 3, not 1, because its breadcrumbs path is `HTML > BODY > DIV`. Developed in https://github.com/WordPress/wordpress-develop/pull/6589 Discussed in https://core.trac.wordpress.org/ticket/61255 Fixes #61255. Props dmsnell, jonsurrell. Built from https://develop.svn.wordpress.org/trunk@58191 git-svn-id: http://core.svn.wordpress.org/trunk@57654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
48 lines
941 B
PHP
48 lines
941 B
PHP
<?php
|
|
/**
|
|
* WordPress Version
|
|
*
|
|
* Contains version information for the current WordPress release.
|
|
*
|
|
* @package WordPress
|
|
* @since 1.2.0
|
|
*/
|
|
|
|
/**
|
|
* The WordPress version string.
|
|
*
|
|
* Holds the current version number for WordPress core. Used to bust caches
|
|
* and to enable development mode for scripts when running from the /src directory.
|
|
*
|
|
* @global string $wp_version
|
|
*/
|
|
$wp_version = '6.6-alpha-58191';
|
|
|
|
/**
|
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
|
*
|
|
* @global int $wp_db_version
|
|
*/
|
|
$wp_db_version = 57155;
|
|
|
|
/**
|
|
* Holds the TinyMCE version.
|
|
*
|
|
* @global string $tinymce_version
|
|
*/
|
|
$tinymce_version = '49110-20201110';
|
|
|
|
/**
|
|
* Holds the required PHP version.
|
|
*
|
|
* @global string $required_php_version
|
|
*/
|
|
$required_php_version = '7.2.24';
|
|
|
|
/**
|
|
* Holds the required MySQL version.
|
|
*
|
|
* @global string $required_mysql_version
|
|
*/
|
|
$required_mysql_version = '5.5.5';
|