• Hi,

    I’ve added a button to tinyMCE which loads a php file into the iframe.
    Actually it’s a shortcode manager and I need to use some wordpress functionality such as translation functions or getting categories list or …

    To do this, I need to include wp-load.php and every thing works great with it. But I read on the forums that including wp-load.php is not a good practice at all!

    So what’s the best solution for my problem? Is there any way to load tinyMCE plugin without loading it within iframe or is there any other way to use wordpress functions in a file which is loaded into iframes or popups?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t know much about TinyMCE, but anything done in an iframe could be done directly on a page. For example, the wp_editor() function builds containers for the tabs, buttons, content and the rest is handled with javascript, no iframes involved.

    Either way, it does not help you access WP functions without wp-load.php being included or required somewhere. You could use AJAX or load your page as a template to avoid including wp-load.php, but it’s being included somewhere none the less, just not by you.

    AFAIK, the main issue with including wp-load.php is it’s difficult reliably know where it is located on any random installation. If this is for your own site and not for distribution, I personally would go ahead and leave things as they are, but do use something like require_once() to ensure it is not reloaded unnecessarily.

    Thread Starter ImanGM

    (@credo61)

    I’ve used admin-ajax.php to load my content into tinyMCE plugin iframe without including wp-load.php.

    thanks

    Hey credo61,
    I’ve been working on something too similar but for me popup just won’t work unless I load wp-load.php. Could you help me with what workaround did you get for this problem?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add a tinyMCE plugin WordPress functionality’ is closed to new replies.