1. Home
  2. Developer’s guide
  3. Functions & Template tags
  4. duplicate_post_clone_post_link

duplicate_post_clone_post_link

Description

Displays a link to clone the current post, if a user is logged in and allowed to copy the post. Can be used within The Loop or outside of it. If outside the loop, you’ll need to pass the post ID.

It is modeled after edit_post_link().

Usage

<?php duplicate_post_clone_post_link( $link, $before, $after, $id ); ?>

Parameters

  • $link
    • (string) (optional) The link text.
      • Default: __('Clone','duplicate-post')
  • $before
    • (string) (optional) Text to put before the link text.
      • Default: None
  • $after
    • (string) (optional) Text to put after the link text.
      • Default: None
  • $id
    • (integer) (optional) Post ID.
      • Default: Current post ID