• Resolved nilukulu

    (@nilukulu)


    Hello,

    I am using this plugin and it works fine in the posts section.

    However, I have my own plugin where I am using the default wordpress editor. The wp-editor works fine in my plugin however it does not show the insert pages button in it.

    I am using this code to render the default TinyMCE in my plugin –

    <?php
    $settings_a = array(
    ‘textarea_rows’ =>8,
    ‘editor_class’ => ‘form-control-solid’,
    ‘textarea_rows’=>15,
    );
    $editor_id = ‘new_post_content’;
    wp_editor( ”, $editor_id,$settings_a );

    Please advise how can i show the insert pages button in my wp-editor.

Viewing 10 replies - 16 through 25 (of 25 total)
  • Plugin Author Paul Ryan

    (@figureone)

    Aloha, version 3.6.0 is out, please test and let us know what you see.

    Thread Starter nilukulu

    (@nilukulu)

    Hey Paul,

    Hope yoy are having a great weekend!
    Thanks for the update!

    I updated to version 3.6.0 and I am facing the same issue unfortunately ??

    On the page load event on the wp_editor page, I get this error –
    Uncaught TypeError: this._addClass is not a function

    And if I click on any button in the TinyMCE plugin, including the Insert pages button, I get this error –

    Uncaught TypeError: t.quirks is undefined

    If i disable the Insert Pages plugin, everything works fine on that page.

    Let me know if you need more details from my side.

    Thread Starter nilukulu

    (@nilukulu)

    Actually the issue comes when this code is added in functions.php –

    if ( class_exists( 'InsertPagesPlugin' ) ) {
    	require_once ABSPATH . 'wp-admin/includes/template.php';
    	require_once ABSPATH . 'wp-admin/includes/theme.php';
    	add_filter( 'wp_head', array( InsertPagesPlugin::get_instance(), 'insert_pages_admin_init' ) );
    	add_filter( 'print_footer_scripts', array( InsertPagesPlugin::get_instance(), 'insert_pages_add_quicktags' ) );
    }

    in the themes functions.php.

    If this code is removed, the error goes but the Insert Pages button also disappears from my plugin’s TinyMCE.

    If I add only this –

    if ( class_exists( 'InsertPagesPlugin' ) ) {
    	add_filter( 'wp_head', array( InsertPagesPlugin::get_instance(), 'insert_pages_admin_init' ) );
    	add_filter( 'print_footer_scripts', array( InsertPagesPlugin::get_instance(), 'insert_pages_add_quicktags' ) );
    }

    Still the issue persists.

    • This reply was modified 3 years, 7 months ago by nilukulu.
    Plugin Author Paul Ryan

    (@figureone)

    Version 3.6.0 removes the need to require template.php and theme.php from wp-admin/includes/, so your last code sample looks right. What is the behavior or error messages when you use just that?

    In our testing, that worked fine: when you put the wp_editor() call anywhere in archive.php in the twentyseventeen theme (so it shows up on any archive page).

    Can you describe the specific frontend context where your plugin is trying to render an editor? Maybe it’s different enough from our testing and that is where the problem is.

    Thread Starter nilukulu

    (@nilukulu)

    Hi,

    The code is being used in a view file named new-listing.php and wp editor is called on line 95.

    CODE –
    https://www.codepile.net/pile/eYoP3KJ0

    I am using essentials wordpress theme from theme forest and fitness trainer plugin from codecanyon.

    If you want, I can share the theme and plugin files with you. They are licensed but I don’t think it would be an issue if you using only for testing. If its only for testing, you can even find a nulled version of the same plugin on the internet.

    Let me know if you need any more details.

    Thanks

    Thread Starter nilukulu

    (@nilukulu)

    Let me know if i should share my plugin and theme with you.

    Thanks,
    Nilesh Kulkarni

    Plugin Author Paul Ryan

    (@figureone)

    That would be fine, you can share it with me via direct message on the WordPress Slack workspace:

    Slack

    I might have some time next week to troubleshoot it!

    Plugin Author Paul Ryan

    (@figureone)

    We tested with the provided code and the Insert Page button and dialog for the TinyMCE editor work fine. Perhaps you have other code somewhere causing the conflict?

    Thread Starter nilukulu

    (@nilukulu)

    Hi Paul,

    Thanks for all the efforts! There was a conflict with a plugin!
    I managed to get rid of that plugin and now its working fine!

    Thanks once again!

    Plugin Author Paul Ryan

    (@figureone)

    Great! Thanks for following up.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Insert Page not visibile in plugins’ is closed to new replies.