Plugin Directory

Changeset 2364311


Ignore:
Timestamp:
08/18/2020 09:14:12 PM (5 years ago)
Author:
arjunthakur
Message:

Fix for gutenberg, now duplicate button visible in editor

Location:
duplicate-wp-page-post/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • duplicate-wp-page-post/trunk/duplicate-wp-page-post.php

    r2351903 r2364311  
    33Plugin Name: Duplicate Page and Post
    44Plugin URI: https://wordpress.org/plugins/duplicate-wp-page-post/
    5 Description: This plugin quickly creates a clone of page or post and supports Gutenberg.
     5Description: Quickly clone a page, post or custom post and supports Gutenberg.
    66Author: Arjun Thakur
    77Author URI: https://profiles.wordpress.org/arjunthakur#content-plugins
    8 Version: 2.6.1
     8Version: 2.6.2
    99License: GPLv2 or later
    1010Text Domain: dpp_wpp_page
     
    2222        register_activation_hook(__FILE__, array(&$this, 'dpp_wpp_page_install'));
    2323        add_action('admin_menu', array(&$this, 'dpp_page_options_page'));
    24         add_filter( 'plugin_action_links', array(&$this, 'dpp_page_plugin_action_links'), 10, 2 );
     24        add_filter( 'plugin_action_links', array(&$this, 'dpp_settings_link'), 10, 2 );
    2525        add_action( 'admin_action_dt_dpp_post_as_draft', array(&$this,'dt_dpp_post_as_draft') );
    2626        add_filter( 'post_row_actions', array(&$this,'dt_dpp_post_link'), 10, 2);
     
    5151    }
    5252   
    53     /* Plugin Action Links(Dashboard) */
    54     public function dpp_page_plugin_action_links($links, $file){
    55         return $links;
    56     }
    5753
    5854    /* Page Title and Dashboard Menu (Setting options) */
     
    9086              $redirectit = !empty($opt['dpp_post_redirect']) ? $opt['dpp_post_redirect'] : 'to_list';
    9187
    92                 //if (! ( isset( $get_copy ) || isset( $post_copy ) || ( isset($request_copy) && 'dt_dpp_post_as_draft' == $request_copy ) ) ) {
    9388                if (!(isset($_GET['post']) || isset($_POST['post']) || (isset($_REQUEST['action']) && 'dt_dpp_post_as_draft' == $_REQUEST['action']))) {
    9489                wp_die('No post!');
    9590                }
    9691                $returnpage = '';
    97    
    98                 /* Get post id */
    99                 //$post_id = (isset($get_copy) ? $get_copy : $post_copy );
    10092
    10193                $post = get_post( $post_id );
     
    161153
    162154    /*Add link to action*/
    163     public function dt_dpp_post_link( $actions, $post ) {
     155    public function dt_dpp_post_link( $actions, $post )
     156    {
    164157      $opt = get_option('dpp_wpp_page_options');
    165158      $link_title = !empty($opt['dpp_post_link_title']) ? $opt['dpp_post_link_title'] : 'Duplicate';   
     
    173166   
    174167    /*Add link to edit Post*/
    175     public function dpp_wpp_page_custom_button(){
     168    public function dpp_wpp_page_custom_button()
     169    {
    176170       $opt = get_option('dpp_wpp_page_options');
    177171       $link_title = !empty($opt['dpp_post_link_title']) ? $opt['dpp_post_link_title'] : 'Duplicate';
     
    203197                var dpp_posttitle = "Duplicate this as <?php echo $post_status; ?>";
    204198                var dpp_duplicatelink = '<div class="link_gutenberg">';
    205                     dpp_duplicatelink += '<a href="admin.php?action=dt_dpp_post_as_draft&amp;post='+dpp_postid'&amp;nonce='+dtnonce+'" title="'+dpp_posttitle+'">Duplicate</a>';
     199                    dpp_duplicatelink += '<a href="admin.php?action=dt_dpp_post_as_draft&amp;post='+dpp_postid+'&amp;nonce='+dtnonce+'" title="'+dpp_posttitle+'">Duplicate</a>';
    206200                    dpp_duplicatelink += '</div>';
    207201                jQuery('.edit-post-post-status').append(dpp_duplicatelink);
     
    215209    /*Click here to clone Admin Bar*/
    216210    public function dpp_wpp_page_admin_bar_link()
    217       {
     211    {
    218212        global $wp_admin_bar;
    219213        global $post;
     
    234228    }
    235229
     230     
    236231    /*WP Url Redirect*/
    237232    static function dp_redirect($url)
     
    239234     echo '<script>window.location.href="'.$url.'"</script>';
    240235    }
    241     }
    242     new dpp_wpp_page;
    243 
     236     
    244237    /*plugin settings page link*/
    245     add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'dpp_settings_link');
    246238    function dpp_settings_link( $links ) {
    247239        $links[] = '<a href="' .
     
    250242        return $links;
    251243    }
     244     
     245    }
     246    new dpp_wpp_page();
    252247
    253248endif;
    254 
    255 
    256249?>
  • duplicate-wp-page-post/trunk/readme.txt

    r2351903 r2364311  
    33Tags: duplicate post, duplicate page, clone page, clone post, duplicate custom posts, clone custom post, wordpress page duplicator, wordpress post duplicator, page duplicate, clone page and post,  wp post clone.
    44Requires at least: 3.5
    5 Tested up to: 5.4.2
     5Tested up to: 5.5
    66Requires PHP: 5.2.4
    7 Stable tag: 2.6.1
    8 Version: 2.6.1
     7Stable tag: 2.6.2
     8Version: 2.6.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.