Created
February 4, 2024 00:51
-
-
Save campusboy87/26dbd72ee19f9f6a89bb94174efd1aa9 to your computer and use it in GitHub Desktop.
Removing the drop-down filter of the Rank Math SEO plugin in the table of posts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'restrict_manage_posts', function () { | |
global $wp_filter; | |
$action = 'restrict_manage_posts'; | |
$priority = 11; | |
$method = 'add_seo_filters'; | |
if ( empty( $wp_filter[ $action ]->callbacks[ $priority ] ) ) { | |
return; | |
} | |
foreach ( $wp_filter[ $action ]->callbacks[ $priority ] as $name => $callback ) { | |
if ( str_ends_with( $name, $method ) ) { | |
unset ( $wp_filter[ $action ]->callbacks[ $priority ][ $name ] ); | |
break; | |
} | |
} | |
}, 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment