Make WordPress Core

Opened 7 years ago

Last modified 6 years ago

#16159 closed enhancement

Default widgets "args" filters — at Initial Version

Reported by: ramiy Owned by:
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.0.4
Component: Widgets Keywords: has-patch commit
Focuses: Cc:


Not all WordPress default widgets has arguments filter. For example, recentet-posts and recentet-comments has no arguments filte.

Current arg Filters:

  • Pages widget - wp_list_pages( apply_filters( 'widget_pages_args', array(...) );
  • Links widget - wp_list_bookmarks( apply_filters( 'widget_links_args', array(...) );
  • Archives widget - wp_get_archives( apply_filters( 'widget_archives_args', array(...) );
  • Tag Cloud widget - wp_tag_cloud( apply_filters( 'widget_tag_cloud_args', array(...) );

New arg Filters:

  • Rrecentet Post widdet - new WP_Query( apply_filters( 'widget_posts_args', array(...) );
  • Recentet Comments widdet - get_comments( apply_filters( 'widget_comments_args', array(...) );

This way i can add new arg to recentet-posts widget and recentet-comments widget using simple filters (i dont like installing plugins, i prefer filters).

Change History (1)

7 years ago

Note: See TracTickets for help on using tickets.