File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed
Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -166,8 +166,8 @@ public function __construct() {
166166 *
167167 * @since 4.4.0
168168 *
169- * @return WP_Error|null|true WP_Error indicates unsuccessful login , null indicates successful
170- * or no authentication provided .
169+ * @return WP_Error|null|true WP_Error if authentication error occurred , null if authentication
170+ * method wasn't used, true if authentication succeeded .
171171 */
172172 public function check_authentication () {
173173 /**
@@ -191,7 +191,7 @@ public function check_authentication() {
191191 *
192192 * @since 4.4.0
193193 *
194- * @param WP_Error|null|true $errors WP_Error if authentication error, null if authentication
194+ * @param WP_Error|null|true $errors WP_Error if authentication error occurred , null if authentication
195195 * method wasn't used, true if authentication succeeded.
196196 */
197197 return apply_filters ( 'rest_authentication_errors ' , null );
Original file line number Diff line number Diff line change @@ -3442,12 +3442,9 @@ function wp_enqueue_command_palette_assets() {
34423442 }
34433443
34443444 // Remove all HTML tags and their contents.
3445- $ processor = new WP_HTML_Tag_Processor ( $ menu_item [0 ] );
3446- $ menu_label = '' ;
3447- while ( $ processor ->next_token () ) {
3448- if ( '#text ' === $ processor ->get_token_name () ) {
3449- $ menu_label .= $ processor ->get_modifiable_text ();
3450- }
3445+ $ menu_label = $ menu_item [0 ];
3446+ while ( preg_match ( '/<[^>]*>/ ' , $ menu_label ) ) {
3447+ $ menu_label = preg_replace ( '/<[^>]*>.*?<\/[^>]*>|<[^>]*\/>|<[^>]*>/s ' , '' , $ menu_label );
34513448 }
34523449 $ menu_label = trim ( $ menu_label );
34533450 $ menu_url = '' ;
@@ -3474,12 +3471,9 @@ function wp_enqueue_command_palette_assets() {
34743471 }
34753472
34763473 // Remove all HTML tags and their contents.
3477- $ processor = new WP_HTML_Tag_Processor ( $ submenu_item [0 ] );
3478- $ submenu_label = '' ;
3479- while ( $ processor ->next_token () ) {
3480- if ( '#text ' === $ processor ->get_token_name () ) {
3481- $ submenu_label .= $ processor ->get_modifiable_text ();
3482- }
3474+ $ submenu_label = $ submenu_item [0 ];
3475+ while ( preg_match ( '/<[^>]*>/ ' , $ submenu_label ) ) {
3476+ $ submenu_label = preg_replace ( '/<[^>]*>.*?<\/[^>]*>|<[^>]*\/>|<[^>]*>/s ' , '' , $ submenu_label );
34833477 }
34843478 $ submenu_label = trim ( $ submenu_label );
34853479 $ submenu_url = '' ;
You can’t perform that action at this time.
0 commit comments