function wvpd_clone_post_link($link = null, $before = '', $after = '', $id = 0) { if (!($post = get_post($id))) { return; } if (!($url = wvpd_get_clone_post_link($post->ID))) { return; } if (null === $link) { $link = __('Copy to a new draft', 'wvpd'); } $post_type_obj = get_post_type_object($newposttype); $link = '<a class="post-clone-link" href="' . $url . '" title="' . esc_attr(__("Copy to a new draft", 'wvpd')) . '">' . $link . '</a>'; echo $before . apply_filters('wvpd_clone_post_link', $link, $post->ID) . $after; }
function wvpd_add_wvpd_button() { if (isset($_GET['post']) && wvpd_is_current_user_allowed_to_copy()) { ?> <div id="duplicate-action"> <?php if (get_option('wvpd_copy2others') == 1) { $label = __('Copy to listed post types', 'wvpd'); } else { $label = __('Copy to current post types', 'wvpd'); } ?> <a class="submitduplicate duplication" href="<?php echo wvpd_get_clone_post_link($_GET['post'], 'display', false); ?> "> <?php echo $label; ?> </a> </div> <?php } }