Edit File by line
/home/barbar84/www/wp-conte.../plugins/duplicat...
File: duplicate-post.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Plugin Name: Yoast Duplicate Post
[2] Fix | Delete
* Plugin URI: https://yoast.com/wordpress/plugins/duplicate-post/
[3] Fix | Delete
* Description: The go-to tool for cloning post and pages, including easy Rewrite & Republish feature.
[4] Fix | Delete
* Version: 4.0.2
[5] Fix | Delete
* Author: Enrico Battocchi & Team Yoast
[6] Fix | Delete
* Author URI: https://yoast.com
[7] Fix | Delete
* Text Domain: duplicate-post
[8] Fix | Delete
*
[9] Fix | Delete
* @package Duplicate Post
[10] Fix | Delete
* @since 0.1
[11] Fix | Delete
*
[12] Fix | Delete
* Copyright 2020 Yoast BV (email : info@yoast.com)
[13] Fix | Delete
*
[14] Fix | Delete
* This program is free software; you can redistribute it and/or modify
[15] Fix | Delete
* it under the terms of the GNU General Public License as published by
[16] Fix | Delete
* the Free Software Foundation; either version 2 of the License, or
[17] Fix | Delete
* (at your option) any later version.
[18] Fix | Delete
*
[19] Fix | Delete
* This program is distributed in the hope that it will be useful,
[20] Fix | Delete
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[21] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[22] Fix | Delete
* GNU General Public License for more details.
[23] Fix | Delete
*
[24] Fix | Delete
* You should have received a copy of the GNU General Public License
[25] Fix | Delete
* along with this program; if not, write to the Free Software
[26] Fix | Delete
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
[27] Fix | Delete
*/
[28] Fix | Delete
[29] Fix | Delete
use Yoast\WP\Duplicate_Post\Duplicate_Post;
[30] Fix | Delete
[31] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[32] Fix | Delete
exit();
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
if ( ! defined( 'DUPLICATE_POST_FILE' ) ) {
[36] Fix | Delete
define( 'DUPLICATE_POST_FILE', __FILE__ );
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
if ( ! defined( 'DUPLICATE_POST_PATH' ) ) {
[40] Fix | Delete
define( 'DUPLICATE_POST_PATH', plugin_dir_path( __FILE__ ) );
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
define( 'DUPLICATE_POST_CURRENT_VERSION', '4.0.2' );
[44] Fix | Delete
[45] Fix | Delete
$duplicate_post_autoload_file = __DIR__ . '/vendor/autoload.php';
[46] Fix | Delete
[47] Fix | Delete
if ( is_readable( $duplicate_post_autoload_file ) ) {
[48] Fix | Delete
require $duplicate_post_autoload_file;
[49] Fix | Delete
[50] Fix | Delete
// Initialize the main autoloaded class.
[51] Fix | Delete
add_action( 'plugins_loaded', '__duplicate_post_main' );
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
/**
[55] Fix | Delete
* Loads the Duplicate Post main class.
[56] Fix | Delete
*
[57] Fix | Delete
* @phpcs:disable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore,WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- Function name change would be BC-break.
[58] Fix | Delete
*/
[59] Fix | Delete
function __duplicate_post_main() {
[60] Fix | Delete
new Duplicate_Post();
[61] Fix | Delete
}
[62] Fix | Delete
// phpcs:enable
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Initialises the internationalisation domain.
[66] Fix | Delete
*/
[67] Fix | Delete
function duplicate_post_load_plugin_textdomain() {
[68] Fix | Delete
load_plugin_textdomain( 'duplicate-post', false, basename( dirname( __FILE__ ) ) . '/languages/' );
[69] Fix | Delete
}
[70] Fix | Delete
add_action( 'plugins_loaded', 'duplicate_post_load_plugin_textdomain' );
[71] Fix | Delete
[72] Fix | Delete
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'duplicate_post_plugin_actions', 10 );
[73] Fix | Delete
[74] Fix | Delete
/**
[75] Fix | Delete
* Adds 'Settings' link to plugin entry in the Plugins list.
[76] Fix | Delete
*
[77] Fix | Delete
* @ignore
[78] Fix | Delete
* @see 'plugin_action_links_$plugin_file'
[79] Fix | Delete
*
[80] Fix | Delete
* @param array $actions An array of plugin action links.
[81] Fix | Delete
* @return array
[82] Fix | Delete
*/
[83] Fix | Delete
function duplicate_post_plugin_actions( $actions ) {
[84] Fix | Delete
$settings_action = array(
[85] Fix | Delete
'settings' => sprintf(
[86] Fix | Delete
'<a href="%1$s" %2$s>%3$s</a>',
[87] Fix | Delete
menu_page_url( 'duplicatepost', false ),
[88] Fix | Delete
'aria-label="' . __( 'Settings for Duplicate Post', 'duplicate-post' ) . '"',
[89] Fix | Delete
esc_html__( 'Settings', 'default' )
[90] Fix | Delete
),
[91] Fix | Delete
);
[92] Fix | Delete
[93] Fix | Delete
$actions = $settings_action + $actions;
[94] Fix | Delete
return $actions;
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
require_once dirname( __FILE__ ) . '/duplicate-post-common.php';
[98] Fix | Delete
[99] Fix | Delete
if ( is_admin() ) {
[100] Fix | Delete
include_once dirname( __FILE__ ) . '/duplicate-post-admin.php';
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function