Wordpress 4.2.1 pre_get_comments this doesn't work after update -
i have code working time but, after updating wordpress 4.2.1, doesn't work.
// return missing replies in comment table add_action( 'pre_get_comments', array( $this, 'return_missing_list' ) ); public function return_missing_list( $comments = array() ) { // bail on not admin if ( ! is_admin() ) return; // run on comments table $current_screen = get_current_screen(); if( 'edit-comments' !== $current_screen->base ) return; // check query param if ( ! isset( $_get['missing_reply'] ) ) return; // run action show missing $comments->query_vars['meta_key'] = '_cnrt_missing'; $comments->query_vars['meta_value'] = '1'; $comments->query_vars['date_query'] = array( 'after' => '10 months ago' ); // because @ point, meta query has been parsed, // need re-parse incorporate our changes $comments->meta_query->parse_query_vars( $comments->query_vars ); } // end missing_reply_list
Comments
Post a Comment