#12: protected_title_format

The protected_title_format filter allows you to modify the text that gets prepended to a post title if it is password protected. The default is ‘Protected: [Post Title]’.

It is evaluated in get_the_title() in the wp-includes/post-template.php file.

Example:

Let’s say you’re using password-protected content in the context of it being “members-only” — that is, only members have the password(s). The following example would change the prepended text from ‘Protected: [Post Title]’ to ‘Members Only: [Post Title]’.

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’.