芝麻web文件管理V1.00
编辑当前文件:/home/soundframestudio/www/wp-content/plugins/duplicate-post/common-functions.php
should_links_be_displayed( $post ) ) { return ''; } if ( $draft ) { return $link_builder->build_new_draft_link( $post, $context ); } else { return $link_builder->build_clone_link( $post, $context ); } } /** * Displays duplicate post link for post. * * @param string|null $link Optional. Anchor text. * @param string $before Optional. Display before edit link. * @param string $after Optional. Display after edit link. * @param int $id Optional. Post ID. */ function duplicate_post_clone_post_link( $link = null, $before = '', $after = '', $id = 0 ) { $post = get_post( $id ); if ( ! $post ) { return; } $url = duplicate_post_get_clone_post_link( $post->ID ); if ( ! $url ) { return; } if ( $link === null ) { $link = __( 'Copy to a new draft', 'duplicate-post' ); } $link = '
' . esc_html( $link ) . '
'; /** * Filter on the clone link HTML. * * @param string $link The full HTML tag of the link. * @param int $ID The ID of the post. * * @return string */ echo $before . apply_filters( 'duplicate_post_clone_post_link', $link, $post->ID ) . $after; // phpcs:ignore WordPress.Security.EscapeOutput } /** * Gets the original post. * * @param int|null $post Optional. Post ID or Post object. * @param string $output Optional, default is Object. Either OBJECT, ARRAY_A, or ARRAY_N. * @return mixed Post data. */ function duplicate_post_get_original( $post = null, $output = OBJECT ) { return Utils::get_original( $post, $output ); }