apply_filters ( 'jetpack_copy_post_post_types', array Post, WP_Post $post )

Fires when determining if the "Copy" row action should be made available.<p>Allows overriding supported post types.</p>

Source file: modules/copy-post.php

View in GitHub

Parameters

Post

(array) Post types supported by default.

$post

(WP_Post) Post object of current post in listing.


Changelog

Since: Jetpack 7.0.0


Notes

You can add support for the Copy Post feature to your own Custom Post Type like so:

function jetpackcom_add_myposttype_support_copy_post( $post_types ) {
    $post_types[] = 'myposttype';
    return $post_types;
}
add_filter( 'jetpack_copy_post_post_types', 'jetpackcom_add_myposttype_support_copy_post' );

Have a note to contribute?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Comments

  1. Henry says:

    Hello, can I pass an array of post types?

    • Jeremy Herve says:

      Instead of passing an array of post types, you would want to add each element of your array (i.e. each new post type slug) to the existing array that’s exposed by the filter. I hope this clarifies things a bit.