debdstripe
Forum Replies Created
-
Forum: Plugins
In reply to: [Post Duplicator] WP Customer Area – Task Lists & InvoicesJust a note, if you want tasks duplicated in order, a couple of updates to the function:
function my_post_duplicator_created( $original_id, $duplicate_id ) { if( get_post_type($original_id) != 'cuar_tasklist' || get_post_type($duplicate_id) != 'cuar_tasklist' ) return; // Get & loop through the original tasks $tasks = get_posts(array( 'post_type' => 'cuar_task', 'post_parent' => $original_id, 'numberposts' => -1, //add all posts 'orderby' => 'menu_order' //add orderby )); if( is_array($tasks) && count($tasks) > 0 ) { foreach( $tasks as $i=>$task ) { // Duplicate the task $duplicate_task_id = mtphr_duplicate_post( $task->ID ); // Update the post parent of the task wp_update_post( array( 'ID' => $duplicate_task_id, 'post_parent' => $duplicate_id ) ); } } } add_action( 'mtphr_post_duplicator_created', 'my_post_duplicator_created', 10, 2 );
- This reply was modified 7 years, 9 months ago by debdstripe.
Forum: Plugins
In reply to: [Post Duplicator] WP Customer Area – Task Lists & InvoicesFor anyone out there reading this thread… I added his function above: “my_post_duplicator_created” to functions.php and Task Lists are duplicating properly now.
Forum: Plugins
In reply to: [Post Duplicator] WP Customer Area – Task Lists & InvoicesHello! I updated to 2.20 and WP Customer Area 7.1.5.
Task Lists are duplicating better, but the tasks are not copying to the duplicated Task List still. You mentioned something that needed to be edited in WP Customer Area… @vprat emailed me and said that you two talked and that you were to be the only person on this to maintain compatibility and/or that you may release a WPCA add-on.
Just curious what I need to do to get the tasks within a task list to duplicate. Should I add your my_post_duplicator_created function to my functions.php for now?
Thanks much!
- This reply was modified 7 years, 9 months ago by debdstripe.
- This reply was modified 7 years, 9 months ago by debdstripe.
Forum: Plugins
In reply to: [Post Duplicator] WP Customer Area – Task Lists & InvoicesThis is great, thank you so much. As I understand it, WP Customer Area will need to be edited for your fixes to work, correct? Also, when do you expect to release 2.20? Just want to make sure I check for the update on the correct day. Thanks again!!
Forum: Plugins
In reply to: [Post Duplicator] WP Customer Area – Task Lists & InvoicesJust checking in on this. @metaphorcreations, did you get the files you needed from @vprat?
Forum: Plugins
In reply to: [Post Duplicator] WP Customer Area – Task Lists & InvoicesThanks @vprat! @metaphorcreations, let me know if you found his email address. Thanks again!
Forum: Plugins
In reply to: [Post Duplicator] WP Customer Area – Task Lists & InvoicesThanks for getting back to me, I really appreciate your help on this. I just sent an email to @vprat as well, hopefully we can reach him.