• Resolved Nikoya

    (@nicolas-andre)


    Hello,

    This plugin is very helpful.

    You choose to add the popin only in ‘post.php’, ‘page.php’, ‘page-new.php’ and ‘post-new.php’.

    Why not enable the pop everywhere tinymce is enabled ?

    In this way your plugin will work on our custom admin page too.
    (like admin.php or settings.php too if needed)

    I propose to edit post-widget.php:
    Comment your last line and just add 1 line.

    // Only add content block popup action on page and post edit
    /*
     if( !defined( 'CUSTOM_POST_WIDGET_CURRENT_PAGE' ) )
    	define( 'CUSTOM_POST_WIDGET_CURRENT_PAGE', basename( $_SERVER['PHP_SELF'] ) );
    if( in_array( CUSTOM_POST_WIDGET_CURRENT_PAGE, array( 'post.php', 'page.php', 'page-new.php', 'post-new.php' ) ) ) {
    	add_action( 'admin_footer', 'add_content_block_popup' );
    }
    */
    
    add_filter('mce_external_plugins', 'add_content_block_popup');

    That seems to work. (all page with tinymce have your plugin working on it too)

    Thank you to share your work.

    https://www.ads-software.com/plugins/custom-post-widget/

Viewing 2 replies - 16 through 17 (of 17 total)
Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Enable "Custom Post Widget" buttons eachtime tiny mce is used’ is closed to new replies.