Yoast / Yoast/duplicate-post

Filter for default post types enabled?

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
53
Forks
38
Avg merge
4d 8h
Merged PRs (30d)
1

Description

Hello,

First off, thank you for this very straightforward plugin.

I have a Multisite installation with plenty of sites and I'm looking for a way to add some custom post types to the list of enabled post types for all of my current and future sites.

Would you be interested to add a filter that allows other developers to add custom post types to the list of default post types enabled for duplication?

The point would be for developers to be able to do something like that:

function my_duplicate_post_default_post_types_enabled($post_types) {
	return array_merge($post_types, array('mycpt1', 'mycpt2', 'mycpt3'));
}
add_filter('duplicate_post_default_post_types_enabled', 'my_duplicate_post_default_post_types_enabled');

I will submit a pull request shortly to show what I mean.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate where the plugin defines the default post types enabled for duplication and inspect any existing filter registration. Confirm how post types are handled across WordPress multisite sites, then verify that the proposed filter can add custom types for current and future sites without changing existing defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, content
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.