Advertisement
arie_cristianD

filltering_args_module_query

Aug 24th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. /* Homepage Feature Article filter - uses JNews module shortcode - Hero 13, Style 4 */
  2. add_filter(
  3.     'jnews_default_query_args',
  4.     function ( $args, $attr ) {
  5.  
  6.         if ( isset( $attr['featurearticle'] ) && 'yes' === $attr['featurearticle'] ) {
  7.             $homepage_feature_article_link = get_field( 'homepage_feature_article_link', 'admin_options' );
  8.             $args['p']                     = $homepage_feature_article_link;
  9.             $args['post_type']             = 'post';
  10.             $args['post_status']           = 'publish';
  11.         }
  12.         return $args;
  13.     },
  14.     10,
  15.     2
  16. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement