New answers tagged wp-editor
1
The editor is hard-coded into the form. It isn't inserted by add_meta_box.
There is a hook called edit_form_after_title which you should be able to use though.
Proof of concept:
// use the action to create a place for your meta box
function add_before_editor($post) {
global $post;
do_meta_boxes('post', 'pre_editor', $post);
}
...
1
You can download a copy of PHP Markdown and use it to parse the textarea contents before you save it:
if ( ! class_exists( 'Markdown' ) ) {
require_once( plugin_dir_path(__FILE__) . '/markdown.php' );
}
$textarea_contents = Markdown::defaultTransform( $textarea_contents );
1
Actually you can include the editor-style.css (or any other stylesheet), just pass a "content_css" value to tinymce that points to a css file:
wp_editor(
$content,
'editablecontent',
array(
'tinymce' => array(
'content_css' => get_stylesheet_directory_uri() . '/editor-styles.css'
)
);
So the original ...
0
Per the jQuery noConflict Wrappers section of the wp_enqueue_script() Codex page, the $ variable is not available in WordPress. You can replace $ with jQuery in your jQuery code, or do something like this:
jQuery(document).ready(function($) {
// your code here
.
.
.
});
1
This is was I use to convert textarea with wp_editor()
wp_editor($value, "editor-name", array(
'tinymce' => array(
'theme_advanced_buttons1' => 'bold,italic,underline',
'theme_advanced_buttons2' => '',
'theme_advanced_buttons3' => ''
)
));
0
[...] The user will click a button to get the editor div to show up. [...]
[...] the post_id argument for the iframe has a valid [...]
[...] needing access to the admin-ajax.php script [...]
You show the editor in a iframe or a thickbox? Or a thickbox which uses an iframe? All this can be a problem. Use a hidden div and make it visible when the user ...
0
It doesn't look like you're calling add_action() correctly. It should be more like:
add_action( 'edit_page_form', 'wpse96952_editor' );
function wpse96952_editor() {
wp_editor(
"Sample",
'mycontent',
array( 'textarea_name' => 'mycontent' )
);
}
(content changed to mycontent after I read @vancoder's comment)
Top 50 recent answers are included