Post ID Optimizer 1.0.1 has 35 actions and 48 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Post ID Optimizer fires an action
add_action( 'delete_post', function( $postid ) {
// Your code runs here.
}, 10, 1 );
// Change a value Post ID Optimizer is about to use
add_filter( 'get_pages', function( $pages, $r ) {
// Change $pages here.
return $pages;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * This filter is documented in wp-includes/post.php */ apply_filters( 'get_pages', $pages, $r ); -
/** * Fires immediately before a post is deleted from the database. */ do_action( 'delete_post', $postid ); -
/** * Fires immediately after a post is deleted from the database. */ do_action( 'deleted_post', $postid ); -
/** * Fires once an existing post has been updated. */ do_action( 'edit_post', $post_ID, $post ); -
/** * Fires once an existing post has been updated. */ do_action( "edit_post_{$post->post_type}", $post_ID, $post ); -
/** * Fires once a post has been saved. */ do_action( 'save_post', $post_ID, $post, $update ); -
/** * Fires once a post has been saved. */ do_action( "save_post_{$post->post_type}", $post_ID, $post, $update ); -
/** * This filter is documented in wp-includes/post.php */ apply_filters( 'wp_count_posts', $counts, $type, $perm ); -
/** * Fires once a post has been saved. */ do_action( 'wp_insert_post', $post_ID, $post, $update ); -
/** * Filters the relative path to an uploaded file. */ apply_filters( '_wp_relative_upload_path', $new_path, $path ); -
/** * Filters the value of a specific post field to edit. */ apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id ); -
/** * Filters the value of a specific field before saving. */ apply_filters( "{$field_no_prefix}_save_pre", $value ); -
/** * Filters the value of a specific post field before saving. */ apply_filters( "{$field}_pre", $value ); -
/** * Fires when a post is transitioned from one status to another. */ do_action( "{$new_status}_{$post->post_type}", $post->ID, $post ); -
/** * Fires when a post is transitioned from one status to another. */ do_action( "{$old_status}_to_{$new_status}", $post ); -
/** * Fires once an attachment has been added. */ do_action( 'add_attachment', $post_ID ); -
/** * Filters the new ping URL to add for the given post. */ apply_filters( 'add_ping', $new ); -
/** * Fires after a post is deleted, at the conclusion of wp_delete_post(). */ do_action( 'after_delete_post', $postid ); -
/** * Fires once an existing attachment has been updated. */ do_action( 'attachment_updated', $post_ID, $post_after, $post_before ); -
/** * Fires before a post is deleted, at the start of wp_delete_post(). */ do_action( 'before_delete_post', $postid ); -
/** * Fires after the given attachment's cache is cleaned. */ do_action( 'clean_attachment_cache', $id ); -
/** * Fires immediately after the given page's cache is cleaned. */ do_action( 'clean_page_cache', $post->ID ); -
/** * Fires immediately after the given post's cache is cleaned. */ do_action( 'clean_post_cache', $post->ID, $post ); -
/** * Fires before an attachment is deleted, at the start of * wp_delete_attachment(). */ do_action( 'delete_attachment', $post_id ); -
/** * Filters the value of a specific post field to edit. */ apply_filters( "edit_{$field}", $value, $post_id ); -
/** * Fires once an existing attachment has been updated. */ do_action( 'edit_attachment', $post_ID ); -
/** * Filters the attached file based on the given ID. */ apply_filters( 'get_attached_file', $file, $attachment_id ); -
/** * Filters the list of enclosures already enclosed for the given post. */ apply_filters( 'get_enclosed', $pung, $post_id ); -
/** * Filters the date the last post was published. */ apply_filters( 'get_lastpostdate', _get_last_post_time( $timezone, 'date', $post_type ), $timezone ); -
/** * Filters the date the last post was modified. */ apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone ); -
/** * Filters the URI for a page. */ apply_filters( 'get_page_uri', $uri, $page ); -
/** * Filters the post status. */ apply_filters( 'get_post_status', $post->post_status, $post ); -
/** * Filters the list of already-pinged URLs for the given post. */ apply_filters( 'get_pung', $pung ); -
/** * Filters the list of URLs yet to ping for the given post. */ apply_filters( 'get_to_ping', $to_ping ); -
/** * Filters the icon directory path. */ apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); -
/** * Filters the icon directory URI. */ apply_filters( 'icon_dir_uri', includes_url( 'images/media' ) ); -
/** * Filters the list of icon directory URIs. */ apply_filters( 'icon_dirs', array( $icon_dir => $icon_dir_uri ) ); -
/** * Filters the default list of post mime types. */ apply_filters( 'post_mime_types', $post_mime_types ); -
/** * Fires once a post has been added to the sticky list. */ do_action( 'post_stuck', $post_id ); -
/** * Filters the labels of a specific post type. */ apply_filters( "post_type_labels_{$post_type}", $labels ); -
/** * Fires once a post has been removed from the sticky list. */ do_action( 'post_unstuck', $post_id ); -
/** * Fires once an existing post has been updated. */ do_action( 'post_updated', $post_ID, $post_after, $post_before ); -
/** * Filters the value of a specific post field before saving. */ apply_filters( "pre_{$field}", $value ); -
/** * Filters whether a post deletion should take place. */ apply_filters( 'pre_delete_post', null, $post, $force_delete ); -
/** * Pre-filter the return value of get_lastpostmodified() before the query is * run. */ apply_filters( 'pre_get_lastpostmodified', false, $timezone, $post_type ); -
/** * Fires immediately before an existing post is updated in the database. */ do_action( 'pre_post_update', $post_ID, $data ); -
/** * Filters whether a post trashing should take place. */ apply_filters( 'pre_trash_post', null, $post ); -
/** * Filters whether a post untrashing should take place. */ apply_filters( 'pre_untrash_post', null, $post ); -
/** * Filters the post slug before it is generated to be unique. */ apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_ID, $post_status, $post_type, $post_parent ); -
/** * Fires when a post's status is transitioned from private to published. */ do_action( 'private_to_published', $post->ID ); -
/** * Filters the capability to read private posts for a custom post type when * generating SQL for getting posts by author. */ apply_filters( 'pub_priv_sql_capability', '' ); -
/** * Fires after a post type is registered. */ do_action( 'registered_post_type', $post_type, $post_type_object ); -
/** * Fires when a post is transitioned from one status to another. */ do_action( 'transition_post_status', $new_status, $old_status, $post ); -
/** * Fires before comments are sent to the trash. */ do_action( 'trash_post_comments', $post_id ); -
/** * Fires after a post is sent to the trash. */ do_action( 'trashed_post', $post_id ); -
/** * Fires after comments are sent to the trash. */ do_action( 'trashed_post_comments', $post_id, $statuses ); -
/** * Fires after a post type was unregistered. */ do_action( 'unregistered_post_type', $post_type ); -
/** * Fires before a post is restored from the trash. */ do_action( 'untrash_post', $post_id ); -
/** * Fires before comments are restored for a post from the trash. */ do_action( 'untrash_post_comments', $post_id ); -
/** * Fires after a post is restored from the trash. */ do_action( 'untrashed_post', $post_id ); -
/** * Fires after comments are restored for a post from the trash. */ do_action( 'untrashed_post_comments', $post_id ); -
/** * Filters the path to the attached file to update. */ apply_filters( 'update_attached_file', $file, $attachment_id ); -
/** * Modify returned attachment counts by mime type. */ apply_filters( 'wp_count_attachments', (object) $counts, $mime_type ); -
/** * Filters the attachment caption. */ apply_filters( 'wp_get_attachment_caption', $caption, $post->ID ); -
/** * Filters the attachment meta data. */ apply_filters( 'wp_get_attachment_metadata', $data, $post->ID ); -
/** * Filters the attachment thumbnail file path. */ apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID ); -
/** * Filters the attachment thumbnail URL. */ apply_filters( 'wp_get_attachment_thumb_url', $url, $post->ID ); -
/** * Filters the attachment URL. */ apply_filters( 'wp_get_attachment_url', $url, $post->ID ); -
/** * Filters attachment post data before it is updated in or added to the * database. */ apply_filters( 'wp_insert_attachment_data', $data, $postarr ); -
/** * Filters slashed post data just before it is inserted into the database. */ apply_filters( 'wp_insert_post_data', $data, $postarr ); -
/** * Filters whether the post should be considered "empty". */ apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ); -
/** * Filters the post parent -- used to check for and prevent hierarchy loops. */ apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, $new_postarr, $postarr ); -
/** * Filters the mime type icon. */ apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id ); -
/** * Fires before a post is sent to the trash. */ do_action( 'wp_trash_post', $post_id ); -
/** * Filters the unique post slug. */ apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ); -
wp_unique_post_slug_is_bad_attachment_slug
filter Used by 45 plugins → Copy link Customise this hook/** * Filters whether the post slug would make a bad attachment slug. */ apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ); -
/** * Filters whether the post slug would be bad as a flat slug. */ apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type ); -
wp_unique_post_slug_is_bad_hierarchical_slug
filter Used by 6 plugins → Copy link Customise this hook/** * Filters whether the post slug would make a bad hierarchical post slug. */ apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ); -
/** * Filters the updated attachment meta data. */ apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ); -
/** * Fires when _publish_post_hook() is called during an XML-RPC request. */ do_action( 'xmlrpc_publish_post', $post_id ); -
apply_filters( "edit_post_{$field}", $value, $post_id ); -
apply_filters( "post_{$field}", $value, $post_id, $context ); -
apply_filters( "pre_post_{$field}", $value );
Generated from Post ID Optimizer's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: