Plugin Directory

Changeset 2645794


Ignore:
Timestamp:
12/17/2021 12:41:56 PM (4 years ago)
Author:
mndpsingh287
Message:

v.4.4.7

Location:
duplicate-page/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • duplicate-page/trunk/duplicatepage.php

    r2641201 r2645794  
    55Description: Duplicate Posts, Pages and Custom Posts using single click.
    66Author: mndpsingh287
    7 Version: 4.4.6
     7Version: 4.4.7
    88Author URI: https://profiles.wordpress.org/mndpsingh287/
    99License: GPLv2
     
    1414}
    1515if (!defined('DUPLICATE_PAGE_PLUGIN_VERSION')) {
    16     define('DUPLICATE_PAGE_PLUGIN_VERSION', '4.4.6');
     16    define('DUPLICATE_PAGE_PLUGIN_VERSION', '4.4.7');
    1717}
    1818if (!class_exists('duplicate_page')):
     
    119119           $current_user_id = get_current_user_id();
    120120           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')){
    122122              $this->duplicate_edit_post($post_id);
    123123            }
    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 ){
    125128              $this->duplicate_edit_post($post_id);
    126129            }
     130         
    127131            else {
    128132                wp_die(__('Unauthorized Access.','duplicate-page'));
    129133   
    130134              }
    131           }
     135          }
     136         
    132137          else {
    133138            wp_die(__('Security check issue, Please try again.','duplicate-page'));
     
    139144         * Duplicate edit post
    140145         */
    141         public function duplicate_edit_post($post_id){
     146        public function duplicate_edit_post($post_id,$post_status_update=''){
    142147            global $wpdb;
    143148            $opt = get_option('duplicate_page_options');
    144149            $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                }
    146155            $redirectit = !empty($opt['duplicate_post_redirect']) ? esc_attr($opt['duplicate_post_redirect']) : 'to_list';
    147156            if (!(isset($_GET['post']) || isset($_POST['post']) || (isset($_REQUEST['action']) && 'dt_duplicate_post_as_draft' == sanitize_text_field($_REQUEST['action'])))) {
     
    323332         Load Help Desk
    324333        */
    325         public function load_help_desk()
    326         {
     334        public function load_help_desk() {
    327335            $mkcontent = '';
    328336            $mkcontent .= '<div class="dpmrs" style="display:none;">';
     
    340348         Close Help
    341349        */
    342         public function mk_dp_close_dp_help()
    343         {
     350        public function mk_dp_close_dp_help() {
    344351            $nonce = sanitize_text_field($_REQUEST['nonce']);
    345352            if (wp_verify_nonce($nonce, 'nc_help_desk')) {
  • duplicate-page/trunk/readme.txt

    r2641201 r2645794  
    44Requires at least: 3.4
    55Tested up to: 5.8.2
    6 Stable tag: 4.4.6
     6Stable tag: 4.4.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5858== Changelog ==
    5959
     60= 4.4.7(16th Dec, 2021)
     61
     62* Added editor role check
     63
    6064= 4.4.6(7th Dec, 2021)
    6165
Note: See TracChangeset for help on using the changeset viewer.