#25: the_modified_date

The the_modified_date filter allows you to modify the modified date output when used for a post inside the Loop.

It is evaluated in the the_modified_date() template tag in the wp-includes/general-template.php file. Template tags must be used inside the Loop.

the_modified_date accepts 4 arguments:

  1. string $the_modified_date The date the post was modified
  2. string $d The date format, if empty it defaults to the value of date_format option
  3. string $before What to output before the date
  4. string $after What to output after the date

Example:

The following wraps the modified date in emphasis tags on output.

View the code example on Gist.

#19: delete_{$meta_type}_metadata

The delete_{$meta_type}_metadata dynamic filter effectively allows you to prevent certain meta data from being deleted. The dynamic $meta_type variable accepts ‘user’, ‘comment’, or ‘post’.

It is evaluated in delete_metadata() in the wp-includes/meta.php file.

delete_{$meta_type}_metadata accepts 5 arguments:

  1. bool null If anything other than null is returned, delete_metadata() will short-circuit and return the boolean equivalent of that value. Default return for delete_metadata() is true on successful delete, false on failure
  2. int $object_id The user, comment or post object id
  3. string $meta_key The meta key to delete
  4. string $meta_value The meta value to delete
  5. bool $delete_all Whether to ignore $object_id further down in delete_metadata(). Default is false

Example:

Let’s say you want to keep non-admin users from deleting featured images once they’re set (for some reason). The following uses the dynamic delete_post_metadata hook accomplish this.

View the code example on Gist.

#17: paginate_links

The paginate_links filter allows you to modify the current pagination link. Since no context is passed to the filter, it will need to be handled in your callback unless the intent is to globally affect pagination links.

It is evaluated in paginate_links() in the wp-includes/general-template.php file.

paginate_links accepts a single argument in the form a string containing the paginated link.

Example:

There is no example for this filter yet. Submit one.

One idea might to pass a custom query var for certain contexts.