Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow duplication on all post statuses #2780

Merged
merged 3 commits into from
Feb 26, 2024
Merged

Conversation

mikeyarce
Copy link
Member

@mikeyarce mikeyarce commented Feb 24, 2024

Fixes #2470

Changes Proposed in this Pull Request

  • Adds a filter job_manager_allowed_post_status_duplicate_jobs that will allow people to filter which post status will be allowed to duplicate jobs in the Job Dashboard
  • Default is to allow just ‘publish’ status, which won’t change any behaviours.

Testing Instructions

  • Apply this PR
  • Add a filter like this to your site:
add_filter( 'job_manager_allowed_post_status_duplicate_jobs', function( $post_status ) {
    $post_status[] = 'preview';
    return $post_status;
});
  • Make sure you have a "draft" job in your job dashboard
  • Ensure that you can now duplicate it!

Release Notes

  • New filter, job_manager_allowed_post_status_duplicate_jobs will let you set specific post statuses that will have the duplicate optionin the Job Dashboard.

Plugin build for 82286de
📦 Download plugin zip
▶️ Open in playground

Default to just ‘publish’ status which won’t change any behaviours.
@mikeyarce mikeyarce requested a review from a team February 24, 2024 21:55
Copy link
Contributor

@yscik yscik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'm wondering if we need the filter at all. 'Duplicate' seems useful regardless of job status, copying old jobs or a draft one etc. Should we just always show the action?
Actions will be in a dropdown with the dashboard updates in feature/stats, so we have the space:
image

@mikeyarce
Copy link
Member Author

@yscik I was leaning that way originally, so now that you say that I think we should do it for all post statuses. Done in 82286de

@mikeyarce mikeyarce merged commit 64412ae into trunk Feb 26, 2024
10 checks passed
@mikeyarce mikeyarce deleted the add/duplicate-job-filter branch February 26, 2024 19:03
@yscik yscik added this to the 2.2.3 milestone Feb 27, 2024
@yscik yscik changed the title Add filter to allow duplication on more post statuses Allow duplication on all post statuses Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate a Job - Additional Status Options
2 participants