rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -112,7 +112,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
$img_style = '';
$img_class = ' dashicons-before';
if ( false !== strpos( $class, 'wp-menu-separator' ) ) {
if ( str_contains( $class, 'wp-menu-separator' ) ) {
$is_separator = true;
}
@@ -127,12 +127,12 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
if ( 'none' === $item[6] || 'div' === $item[6] ) {
$img = '<br />';
} elseif ( 0 === strpos( $item[6], 'data:image/svg+xml;base64,' ) ) {
} elseif ( str_starts_with( $item[6], 'data:image/svg+xml;base64,' ) ) {
$img = '<br />';
// The value is base64-encoded data, so esc_attr() is used here instead of esc_url().
$img_style = ' style="background-image:url(\'' . esc_attr( $item[6] ) . '\')"';
$img_class = ' svg';
} elseif ( 0 === strpos( $item[6], 'dashicons-' ) ) {
} elseif ( str_starts_with( $item[6], 'dashicons-' ) ) {
$img = '<br />';
$img_class = ' dashicons-before ' . sanitize_html_class( $item[6] );
}
@@ -226,8 +226,10 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
$class[] = 'current';
$aria_attributes .= ' aria-current="page"';
}
// If plugin_page is set the parent must either match the current page or not physically exist.
// This allows plugin pages with the same hook to exist under different parents.
/*
* If plugin_page is set the parent must either match the current page or not physically exist.
* This allows plugin pages with the same hook to exist under different parents.
*/
} elseif (
( ! isset( $plugin_page ) && $self === $sub_item[2] )
|| ( isset( $plugin_page ) && $plugin_page === $sub_item[2]