Changeset 2645794
- Timestamp:
- 12/17/2021 12:41:56 PM (4 years ago)
- Location:
- duplicate-page/trunk
- Files:
-
- 2 edited
-
duplicatepage.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
duplicate-page/trunk/duplicatepage.php
r2641201 r2645794 5 5 Description: Duplicate Posts, Pages and Custom Posts using single click. 6 6 Author: mndpsingh287 7 Version: 4.4. 67 Version: 4.4.7 8 8 Author URI: https://profiles.wordpress.org/mndpsingh287/ 9 9 License: GPLv2 … … 14 14 } 15 15 if (!defined('DUPLICATE_PAGE_PLUGIN_VERSION')) { 16 define('DUPLICATE_PAGE_PLUGIN_VERSION', '4.4. 6');16 define('DUPLICATE_PAGE_PLUGIN_VERSION', '4.4.7'); 17 17 } 18 18 if (!class_exists('duplicate_page')): … … 119 119 $current_user_id = get_current_user_id(); 120 120 if(wp_verify_nonce( $nonce, 'dt-duplicate-page-'.$post_id)) { 121 if (current_user_can('manage_options') ){121 if (current_user_can('manage_options') || current_user_can('edit_others_posts')){ 122 122 $this->duplicate_edit_post($post_id); 123 123 } 124 elseif (current_user_can('edit_posts') && $current_user_id == $post->post_author ){ 124 else if (current_user_can('contributor') && $current_user_id == $post->post_author){ 125 $this->duplicate_edit_post($post_id, 'pending'); 126 } 127 else if (current_user_can('edit_posts') && $current_user_id == $post->post_author ){ 125 128 $this->duplicate_edit_post($post_id); 126 129 } 130 127 131 else { 128 132 wp_die(__('Unauthorized Access.','duplicate-page')); 129 133 130 134 } 131 } 135 } 136 132 137 else { 133 138 wp_die(__('Security check issue, Please try again.','duplicate-page')); … … 139 144 * Duplicate edit post 140 145 */ 141 public function duplicate_edit_post($post_id ){146 public function duplicate_edit_post($post_id,$post_status_update=''){ 142 147 global $wpdb; 143 148 $opt = get_option('duplicate_page_options'); 144 149 $suffix = isset($opt['duplicate_post_suffix']) && !empty($opt['duplicate_post_suffix']) ? ' -- '.esc_attr($opt['duplicate_post_suffix']) : ''; 145 $post_status = !empty($opt['duplicate_post_status']) ? esc_attr($opt['duplicate_post_status']) : 'draft'; 150 if($post_status_update == ''){ 151 $post_status = !empty($opt['duplicate_post_status']) ? esc_attr($opt['duplicate_post_status']) : 'draft'; 152 }else{ 153 $post_status = $post_status_update; 154 } 146 155 $redirectit = !empty($opt['duplicate_post_redirect']) ? esc_attr($opt['duplicate_post_redirect']) : 'to_list'; 147 156 if (!(isset($_GET['post']) || isset($_POST['post']) || (isset($_REQUEST['action']) && 'dt_duplicate_post_as_draft' == sanitize_text_field($_REQUEST['action'])))) { … … 323 332 Load Help Desk 324 333 */ 325 public function load_help_desk() 326 { 334 public function load_help_desk() { 327 335 $mkcontent = ''; 328 336 $mkcontent .= '<div class="dpmrs" style="display:none;">'; … … 340 348 Close Help 341 349 */ 342 public function mk_dp_close_dp_help() 343 { 350 public function mk_dp_close_dp_help() { 344 351 $nonce = sanitize_text_field($_REQUEST['nonce']); 345 352 if (wp_verify_nonce($nonce, 'nc_help_desk')) { -
duplicate-page/trunk/readme.txt
r2641201 r2645794 4 4 Requires at least: 3.4 5 5 Tested up to: 5.8.2 6 Stable tag: 4.4. 66 Stable tag: 4.4.7 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 58 58 == Changelog == 59 59 60 = 4.4.7(16th Dec, 2021) 61 62 * Added editor role check 63 60 64 = 4.4.6(7th Dec, 2021) 61 65
Note: See TracChangeset
for help on using the changeset viewer.