Title: Small request
Last modified: August 31, 2016

---

# Small request

 *  Resolved [Tiduspt](https://wordpress.org/support/users/tiduspt/)
 * (@tiduspt)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/small-request-1/)
 * Hi there,
 * I’ve been using your plugin for a few weeks now and I am very satisfied with 
   it.
 * Is it possible in a future release to pass your post_statuses variable through
   a filter? This way developers like me could remove unwanted statuses programmatically.
 * Thanks in advance an congratulations for the good work.
 * Best regards.
 * [https://wordpress.org/plugins/multisite-post-duplicator/](https://wordpress.org/plugins/multisite-post-duplicator/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [MagicStick](https://wordpress.org/support/users/magicstick/)
 * (@magicstick)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/small-request-1/#post-7014597)
 * Ah! Nice one. I’ll do that in a future release. But will also add an option to‘
   inherit source post status’ on the settings page too. Thanks for the good idea.
 *  Plugin Author [MagicStick](https://wordpress.org/support/users/magicstick/)
 * (@magicstick)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/small-request-1/#post-7014710)
 * Hi Tiduspt. I was actually having a poke about my code tonight and released I
   already did a filter you can use for this. It actually holds a lot of information
   for you to do pretty much anything with.
 * Tag: **“mpd_setup_destination_data”**
    $arg1 : Is an array which holds the main
   information for the destination post:
 * > [‘post_title’]
   >  [‘post_status’] [‘post_type’] [‘post_author’] [‘post_content’][‘
   > post_excerpt’] [‘post_content_filtered’]
 * $arg2: The is the original data which is passed into the core function for from
   the source post for duplication:
 * > ‘source_id’
   >  ‘destination_id’ ‘post_type’ ‘post_author’ ‘prefix’ ‘requested_post_status’
 * **Usage Example:**
 *     ```
       add_filter('mpd_setup_destination_data', 'my_hooked_in_function', 10, 2);
   
       function my_hooked_in_function($arg1, $arg2){
   
       	$current_status = get_post_status( $arg2['source_id'] );
       	$arg1['post_status'] = $current_status;
   
       	return $arg1;
   
        }
       ```
   
 * See inc/core.php, function ‘mpd_duplicate_over_multisite’ for all the detail.
 *  Thread Starter [Tiduspt](https://wordpress.org/support/users/tiduspt/)
 * (@tiduspt)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/small-request-1/#post-7014756)
 * That unfortunately wont do what I need, that will filter the data after input.
   I need to filter data when displaying available status to users.
 * So instead of having as possible duplicated post status:
 * – Draft
    – Pending – Private – Public
 * I want to have as only options:
 * – Draft
    – Pending
 * I need something like this on /inc/postform_ui.php
 *     ```
       function mpd_publish_top_right(){
   
           $post_statuses  = get_post_statuses();
           $sites          = mpd_wp_get_sites()
   
           $post_statuses = apply_filters( 'mpd_filter_display_poststatuses', $post_statuses );
   
           ?>
       ```
   
 * Please let me know the slug you will use for your filter so that I can implement
   it right away while having no problems when updating.
 * Thanks!
 *  Plugin Author [MagicStick](https://wordpress.org/support/users/magicstick/)
 * (@magicstick)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/small-request-1/#post-7014757)
 * Sounds perfectly reasonable to me. I’ll get that added and push a wee update 
   out asap.
 *  Plugin Author [MagicStick](https://wordpress.org/support/users/magicstick/)
 * (@magicstick)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/small-request-1/#post-7014800)
 * Hi Tiduspt. I’ve just pushed out an update v0.7.4 just for you! :-). I now run
   all get_post_status() functions through the filter ‘mpd_available_post_statuses’.
   This will give you the access/control you need. Please note that this filter 
   isn’t specific to the post/page metabox as I felt it appropriate to offer the
   filter wherever other users may require too; so you might want to wrap your hook
   in some current_screen logic to control where you want the filter to run.
 * Like so:
 *     ```
       add_filter( 'mpd_available_post_statuses', 'filter_the_statuses');
   
       function filter_the_statuses($available_statuses){
   
          $currentScreen = get_current_screen();
   
          if($currentScreen->post_type === 'page'){
   
               unset($available_statuses['publish']);
   
          }
   
         return $available_statuses;
   
       }
       ```
   
 *  Thread Starter [Tiduspt](https://wordpress.org/support/users/tiduspt/)
 * (@tiduspt)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/small-request-1/#post-7014826)
 * Thank you so much for such a good support!
 * It suits me perfectly!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Small request’ is closed to new replies.

 * ![](https://ps.w.org/multisite-post-duplicator/assets/icon-128x128.png?rev=1562920)
 * [Multisite Post Duplicator](https://wordpress.org/plugins/multisite-post-duplicator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/multisite-post-duplicator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/multisite-post-duplicator/)
 * [Active Topics](https://wordpress.org/support/plugin/multisite-post-duplicator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multisite-post-duplicator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multisite-post-duplicator/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Tiduspt](https://wordpress.org/support/users/tiduspt/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/small-request-1/#post-7014826)
 * Status: resolved