Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Fad Bad

    (@fadbad13)

    in file “duplicate-post-admin.php” find the below function
    add this line to the function duplicate_post_make_duplicate_link_row($actions, $post)

    if( !in_array(get_current_screen()->post_type, array('post', 'page')) ) return $actions;
    this will show the actions links on pages and posts only, you still have to deactivate “Edit Screen” option in plugin settings

    The new function must read

    function duplicate_post_make_duplicate_link_row($actions, $post) {
    	if(  !in_array(get_current_screen()->post_type, array('post', 'page')) ) return $actions;
    
    	if (duplicate_post_is_current_user_allowed_to_copy()) {
    		$actions['clone'] = '<a href="'.duplicate_post_get_clone_post_link( $post->ID , 'display', false).'" title="'
    		. esc_attr(__("Clone this item", DUPLICATE_POST_I18N_DOMAIN))
    		. '">' .  __('Clone', DUPLICATE_POST_I18N_DOMAIN) . '</a>';
    		$actions['edit_as_new_draft'] = '<a href="'. duplicate_post_get_clone_post_link( $post->ID ) .'" title="'
    		. esc_attr(__('Copy to a new draft', DUPLICATE_POST_I18N_DOMAIN))
    		. '">' .  __('New Draft', DUPLICATE_POST_I18N_DOMAIN) . '</a>';
    	}
    	return $actions;
    }

    Change the following code in rich-text-tags.php

    // Enable shortcodes in category, taxonomy, tag descriptions
    	if(function_exists('term_description')) {
    		add_filter('term_description', 'do_shortcode');
    	} else {
    		add_filter('category_description', 'do_shortcode');
    	}

    TO

    // Enable shortcodes in category, taxonomy, tag descriptions
    	if(function_exists('term_description') AND !is_admin()) {
    		add_filter('term_description', 'do_shortcode');
    	} else {
    		add_filter('category_description', 'do_shortcode');
    	}

    This will stop rendering shortcodes in admin and fix your issue

Viewing 2 replies - 1 through 2 (of 2 total)