PMC Plugins
Pmc Not for Publication

Not for Publication

This extends the pmc-not-for-publication plugin functionality for Gutenberg. That plugin handles the registration of the post type and taxonomies, but the class and script in this plugin extends support for the block editor.

Only available on the pmc-nfp post types.

Behavior

  • The pmc-nfp post type only supports saving as a draft.
  • The "Copy to Post" button is only usable if the user can publish posts.
  • Once a post is copied, that post is saved to the post type as a draft.
  • The pmc-nfp post can then be moved to trash or kept, but can not longer be copied.
  • On copy the pmc-nfp post has a new post meta value pmc_nfp_post_copy which is the post id of the new post.
  • All post meta saved to the pmc-nfp post type, available to REST, will be transfered on save.

Available Filters

editor.NotForPublicationButton.allowedPostType

Usage

wp.hooks.addFilter(
    'editor.NotForPublicationButton.allowedPostType',
    'pmc/custom-allowed-post-type',
    'page'
);