Custom Post Type Permalinks icon
Content & Editing

Custom Post Type Permalinks hooks reference

  • By Toro_Unit (Hiroshi Urabe)
  • v3.5.6
  • Updated

Custom Post Type Permalinks 3.5.6 has 8 actions and 16 filters, read directly from its source code on Nov 17, 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.

functions.phpyour child theme
// Run your own code when Custom Post Type Permalinks fires an action
add_action( 'CPTP_init', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value Custom Post Type Permalinks is about to use
add_filter( 'CPTP_is_rewrite_supported', function( $support, $post_type ) {
	// Change $support here.
	return $support;
}, 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

  • CPTP/Util.php line 71
    /**
     * Filters support CPTP for custom post type.
     */
    apply_filters( 'CPTP_is_rewrite_supported', $support, $post_type );
  • CPTP/Util.php line 60
    /**
     * Filters support CPTP for custom post type.
     */
    apply_filters( "CPTP_is_rewrite_supported_by_{$post_type}", $support );
  • CPTP/Module/Permalink.php line 164
    /**
     * Filters the category for a post of a custom post type.
     */
    apply_filters( 'cptp_post_link_category', $category_object, $categories, $post );
  • CPTP/Module/Permalink.php line 258
    /**
     * Filters the term for a post of a custom post type.
     */
    apply_filters( 'cptp_post_link_term', $term_obj, $terms, $taxonomy, $post );
  • CPTP/Util.php line 197
    apply_filters( "CPTP_{$post_type->name}_structure", $structure );
  • CPTP/Util.php line 198
    apply_filters( "cptp_{$post_type->name}_structure", $structure );
  • CPTP/Util.php line 268
    apply_filters( 'CPTP_date_front', $front, $post_type, $structure );
  • CPTP/Util.php line 269
    apply_filters( 'cptp_date_front', $front, $post_type, $structure );
  • CPTP_init

    action
    CPTP.php line 94
    do_action( 'CPTP_init' );
  • cptp_init

    action
    CPTP.php line 95
    do_action( 'cptp_init' );
  • CPTP/Util.php line 72
    apply_filters( 'cptp_is_rewrite_supported', $support, $post_type );
  • CPTP/Util.php line 61
    apply_filters( "cptp_is_rewrite_supported_by_{$post_type}", $support );
  • CPTP.php line 51
    do_action( 'CPTP_load_modules', $this );
  • CPTP.php line 52
    do_action( 'cptp_load_modules', $this );
  • CPTP/Module/Permalink.php line 23
    apply_filters( 'cptp_post_type_link_priority', 0 );
  • CPTP/Module/Rewrite.php line 121
    do_action( "CPTP_registered_{$post_type}_rules", $args, $slug );
  • CPTP/Module/Rewrite.php line 258
    do_action( "CPTP_registered_{$taxonomy}_rules", $object_type, $args, $taxonomy_slug );
  • CPTP.php line 65
    do_action( 'CPTP_registered_modules', $this );
  • CPTP.php line 66
    do_action( 'cptp_registered_modules', $this );
  • CPTP.php line 78
    apply_filters( "CPTP_set_{$name}_module", $module );
  • CPTP.php line 79
    apply_filters( "cptp_set_{$name}_module", $module );
  • CPTP/Module/Permalink.php line 153
    apply_filters( 'post_link_category', $category_object, $categories, $post );

Generated from Custom Post Type Permalinks's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: