Last active
          May 5, 2023 16:44 
        
      - 
      
- 
        Save lilumi/5c7abac47614c4853b735e88a8fc0f7b to your computer and use it in GitHub Desktop. 
    Remove counting author posts on users.php
  
        
  
    
      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 | |
| function interceptQuery( $query ) { | |
| if ( $GLOBALS['pagenow'] === 'users.php' && strpos( $query, 'SELECT post_author, COUNT(*) FROM' ) === 0 ) { | |
| echo '<h3>count_many_users_posts disabled for performance reasons</h3>'; | |
| return false; | |
| } | |
| return $query; | |
| } | |
| add_filter( 'query', 'interceptQuery' ); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment