WP_Query order custom post type with certain meta key value by post modified date

There is an ORDER BY clause in that query that should not have been generated by those arguments. Plus, it doesn’t look like a WordPress query– note the capitalization. WordPress tends to use all uppercase for SQL functions and operators. I suspect that there is a filter on posts_orderby or posts_clauses that is altering that … Read more

Enable comments for post when comments meta box removed

Filter the ‘comments_open’ check. It happens inside of the function with the same name, and that function is called in a theme usually like this: comments_open() and comment_form( array ( ‘comment_notes_after’ => ” ) ); This is how the filter works: add_filter( ‘comments_open’, ‘wpse_98775_comment_check’, 10, 2 ); function wpse_98775_comment_check( $open, $post_id ) { if ( … Read more