Skip to content

Instantly share code, notes, and snippets.

WP_Query Object
(
[query_vars] => Array
(
[page] =>
[pagename] => blog
[error] =>
[m] => 0
[p] => 0
[post_parent] =>
<?php
/**
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
*/
$args = array(
//////Author Parameters - Show posts associated with certain author.
'author' => 1,2,3, //(int) - use author id [use minus (-) to exclude authors by ID ex. 'author' => -1,-2,-3,]
'author_name' => 'abcde', //(string) - use 'user_nicename' (NOT name)
Mika Epstein
25:16
https://youtu.be/3jUA-z53gvA?t=1517
Should be required.
function filter_media_comment_status( $open, $post_id ) {
$post = get_post( $post_id );
if( $post->post_type == 'attachment' ) {
return false;
}
return $open;
}
add_filter( 'comments_open', 'filter_media_comment_status', 10 , 2 );