Forked from campusboy87/rank_math_seo_dropdown_filter_removal_posts_table.php
          
        
    
          Created
          April 22, 2024 17:48 
        
      - 
      
- 
        Save artikus11/e61e861fdcabdfab85535dfc7fb7c69b 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