Duplicate Page and Post - Version 2.9.1

Version Description

Download this release

Release Info

Developer arjunthakur
Plugin Icon 128x128 Duplicate Page and Post
Version 2.9.1
Comparing to
See all releases

Code changes from version 2.9 to 2.9.1

duplicate-wp-page-post-setting.php CHANGED
@@ -6,7 +6,8 @@
6
  <?php
7
  $dpp_options = array();
8
  $opt = get_option( 'dpp_wpp_page_options' );
9
- $instruct = isset( $_GET['instruct'] ) ? $_GET['instruct'] : '';
 
10
  if ( isset( $_POST['submit_dpp_wpp_page'] ) && wp_verify_nonce( $_POST['dpp_nonce_field'], 'dpp_page_action' ) ):
11
  _e( "<strong>changes saving..</strong>", 'duplicate-wp-page-post' );
12
  $dpp_nosave = array( 'submit_dpp_wpp_page' );
6
  <?php
7
  $dpp_options = array();
8
  $opt = get_option( 'dpp_wpp_page_options' );
9
+ $getinstruct = sanitize_text_field($_GET['instruct']);
10
+ $instruct = isset( $getinstruct ) ? $getinstruct : '';
11
  if ( isset( $_POST['submit_dpp_wpp_page'] ) && wp_verify_nonce( $_POST['dpp_nonce_field'], 'dpp_page_action' ) ):
12
  _e( "<strong>changes saving..</strong>", 'duplicate-wp-page-post' );
13
  $dpp_nosave = array( 'submit_dpp_wpp_page' );
duplicate-wp-page-post.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wordpress.org/plugins/duplicate-wp-page-post/
5
  Description: Quickly clone a page, post or custom post and supports Gutenberg.
6
  Author: Arjun Thakur
7
  Author URI: https://profiles.wordpress.org/arjunthakur#content-plugins
8
- Version: 2.9
9
  License: GPLv2 or later
10
  Text Domain: dpp_wpp_page
11
  */
@@ -72,7 +72,8 @@ if ( ! class_exists( 'dcc_dpp_wpp_page' ) ):
72
  /*Important function*/
73
  public function dt_dpp_post_as_draft() {
74
  $nonce = sanitize_text_field( $_REQUEST['nonce'] );
75
- $post_id = ( isset( $_GET['post'] ) ? intval( $_GET['post'] ) : intval( $_POST['post'] ) );
 
76
 
77
 
78
  if ( wp_verify_nonce( $nonce, 'dt-duplicate-page-' . $post_id ) && current_user_can( 'edit_posts' ) ) {
@@ -81,7 +82,7 @@ if ( ! class_exists( 'dcc_dpp_wpp_page' ) ):
81
  /*sanitize_GET POST REQUEST*/
82
  //$post_copy = sanitize_text_field( $_POST["post"] );
83
  //$get_copy = sanitize_text_field( $_GET['post'] );
84
- //$request_copy = sanitize_text_field( $_REQUEST['action'] );
85
 
86
  $opt = get_option( 'dpp_wpp_page_options' );
87
  $suffix = ! empty( $opt['dpp_post_suffix'] ) ? ' -- ' . esc_attr( $opt['dpp_post_suffix'] ) : '';
@@ -89,7 +90,7 @@ if ( ! class_exists( 'dcc_dpp_wpp_page' ) ):
89
  $post_status = ! empty( $opt['dpp_post_status'] ) ? esc_attr( $opt['dpp_post_status'] ) : 'draft';
90
  $redirectit = ! empty( $opt['dpp_post_redirect'] ) ? esc_attr( $opt['dpp_post_redirect'] ) : 'to_list';
91
 
92
- if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'dt_dpp_post_as_draft' == $_REQUEST['action'] ) ) ) {
93
  wp_die( 'No post!' );
94
  }
95
  $returnpage = '';
5
  Description: Quickly clone a page, post or custom post and supports Gutenberg.
6
  Author: Arjun Thakur
7
  Author URI: https://profiles.wordpress.org/arjunthakur#content-plugins
8
+ Version: 2.9.1
9
  License: GPLv2 or later
10
  Text Domain: dpp_wpp_page
11
  */
72
  /*Important function*/
73
  public function dt_dpp_post_as_draft() {
74
  $nonce = sanitize_text_field( $_REQUEST['nonce'] );
75
+ $getpost = sanitize_text_field( $_GET['post'] );
76
+ $post_id = ( isset( $getpost ) ? intval( $getpost ) : intval( $getpost ) );
77
 
78
 
79
  if ( wp_verify_nonce( $nonce, 'dt-duplicate-page-' . $post_id ) && current_user_can( 'edit_posts' ) ) {
82
  /*sanitize_GET POST REQUEST*/
83
  //$post_copy = sanitize_text_field( $_POST["post"] );
84
  //$get_copy = sanitize_text_field( $_GET['post'] );
85
+ $request_copy = sanitize_text_field( $_REQUEST['action'] );
86
 
87
  $opt = get_option( 'dpp_wpp_page_options' );
88
  $suffix = ! empty( $opt['dpp_post_suffix'] ) ? ' -- ' . esc_attr( $opt['dpp_post_suffix'] ) : '';
90
  $post_status = ! empty( $opt['dpp_post_status'] ) ? esc_attr( $opt['dpp_post_status'] ) : 'draft';
91
  $redirectit = ! empty( $opt['dpp_post_redirect'] ) ? esc_attr( $opt['dpp_post_redirect'] ) : 'to_list';
92
 
93
+ if ( ! ( isset( $getpost ) || isset( $getpost ) || ( isset( $request_copy ) && 'dt_dpp_post_as_draft' == $request_copy ) ) ) {
94
  wp_die( 'No post!' );
95
  }
96
  $returnpage = '';
readme.txt CHANGED
@@ -4,8 +4,8 @@ Tags: duplicate post, duplicate page, clone page, clone post, duplicate custom p
4
  Requires at least: 3.5
5
  Tested up to: 6.0.2
6
  Requires PHP: 5.2.4
7
- Stable tag: 2.9
8
- Version: 2.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
4
  Requires at least: 3.5
5
  Tested up to: 6.0.2
6
  Requires PHP: 5.2.4
7
+ Stable tag: 2.9.1
8
+ Version: 2.9.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11