0

I read this article: Use Wordpress Text Editor in non-wp page and found out no solution. Currently i want to embedded a wp text editor to a php page. I tried tinymce but the text editor does not look like the wp text editor (totally different especially missing text and visual tab). Is there anyway to use exactly wp text editor in php page?

my code:

<?php
    $parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
    require_once( $parse_uri[0] . 'wp-load.php' );
    $my_text_setting = array("media_buttons"=>false, "textarea_rows"=>get_option('default_post_edit_rows', 5));
    wp_editor("","my_text_editor",$my_text_setting);

?>
  • 1
    Can you post your code. It's hard to help without more information. – TheDeadMedic Sep 22 '15 at 9:19
  • I added the code. – Lee Sep 22 '15 at 9:57
1

The wordpress editor is designed to work in wordpress enviroment and there is not much point in trying to somehow make it work "outside" of wordpress. You might hack it but any wordpress upgrade might break it.

You need to use your php in the wordpress context by making a page template for your theme out of the your php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.