Advertisement
fauzanjeg

Custom Content Attribute

Nov 4th, 2021
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. /* Custom Content Attribute */
  2. function change_content_attr( $attr, $name, $term_id ) {
  3.     /* For Category */
  4.     if ( 'jnews_category_' === $name ) {
  5.         $attr['sort_by'] = 'popular_post';
  6.     }
  7.     return $attr;
  8. }
  9. add_filter( 'jnews_get_content_attr', 'change_content_attr', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement