#7: post_comments_feed_link

The post_comments_feed_link filter allows you to modify the comments feed URL for the current page or post. Since nothing but the URL is provided to the filter, any conditional work will have to be done by you, such as by accessing the $post global.

It is evaluated in get_post_comments_feed_link() in wp-includes/link-template.php.

Example:

Let’s say you (for some reason) will be serving secure content on your comments feed. The following changes the scheme — such as going from http to https — of the post comments feed url.

View the code example on Gist.

#6: wp_terms_checklist_args

The wp_terms_checklist_args filter allows you to modify the arguments array in wp_terms_checklist, which is located in wp-admin/includes/template.php. wp_terms_checklist is the taxonomy-independent version of wp_category_checklist and only works with hierarchical taxonomies.

It accepts two arguments:

  1. array $args The arguments array (see wp_terms_checklist for the defaults
  2. int $post_id The post id

Example:

Let’s say you have a hierarchical taxonomy called ‘Media Categories’ — with a slug of media_cats — that you’re using with media attachments. And let’s say you don’t want the selected categories to float to the top of the box (the default behavior).

View the code example on Gist.

#5: post_row_actions

The post_row_actions filter allows you to modify the row action links in the non-hierarchical post types list table. The default row actions are ‘Edit’, ‘Quick Edit’, ‘Trash’, and ‘Preview’, available when you hover over a post row in the posts list table.

It is evaluated in the single_row() method of WP_Posts_List_Table in wp-admin/includes/class-wp-posts-list-table.php.

post_row_actions only applies to list table views of non-hierarchical post types. Its sister filter, page_row_actions applies to hierarchical post types, like pages.

The filter takes two arguments:

  1. array $actions The array of row actions, the key corresponding to the span class attribute of the element
  2. object $post The post object

Example:

It seems to be more common for plugins or themes to modify post_row_actions to add additional links, so what if we remove one instead? Let’s say you wanted to remove access to the use of Quick Edit if the post type is ‘post’.