add_filter not working
-
Added the below apply_filters in a file in my theme
$videos_query = apply_filter('mars_main_widget_args',$videos_query,$this->id); $wp_query = new WP_Query( $videos_query );In the themes function file i have
if( !function_exists( 'mars_widget_post_ids' ) ){ /** * @param array $query * @param string $widget_id */ function mars_widget_post_ids( $query, $widget_id ) { if( $widget_id == 'mars-mainvideo-widgets-5' ){ $query['post__in'] = array( 1,4,5,6 ); } return $query; } add_filter( 'mars_main_widget_args' , 'mars_widget_post_ids',100,2); }The filter is not being applied any mistake
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘add_filter not working’ is closed to new replies.