Wrong usage of “admin_body_class” filter.
-
Hi Guys,
You have the wrong usage of
admin_body_class
filter, and you broke all plugin, which tries to use this filter to add some CSS class to the body tag.This file:
wp-content/wp-content/plugins/wp-seopress/seopress.php
have add_filter definition:
227 add_filter( 'admin_body_class', 'seopress_admin_body_class' ); 228 function seopress_admin_body_class( $classes ) { 229 if ((isset($_GET['page']) && ($_GET['page'] == 'seopress-option')) [...] 239 || (isset($_GET['page']) && ($_GET['page'] == 'seopress-license'))) { 240 $classes .= " seopress-styles "; 241 return $classes; 242 } 243 }
And the issue is:
add_filter function must have at least one param and MUST return this param. In this situation, the current admin body class become null.
Please move line 241 outisde the ‘}’:
239 || (isset($_GET[‘page’]) && ($_GET[‘page’] == ‘seopress-license’))) {
240 $classes .= ” seopress-styles “;
241 }
242 return $classes;
243 }Thank you in advance!
Marcin
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Wrong usage of “admin_body_class” filter.’ is closed to new replies.