WP Editor strips input placeholder attribute

The list of allowed elements and attributes is stored in the global variable $allowedposttags which is set in wp-includes/kses.php. To override it create a simple mu plugin with the following content: <?php # -*- coding: utf-8 -*- /** * Plugin Name: Enable placeholder attribute for input elements in post tags. * Version: 2012.07.18 */ add_action( … Read more

Tiny MCE not adding p tag when saving theme option

If you want the contents of an option, variables, or anything for that matter to be treated like post content you’ll need to call the post content filters. <?php echo apply_filters( ‘the_content’, $your_var ); ?> Your data is then treated in the same way as post content is, inline with the code sample you’ve posted, … Read more

Add a wp editor to custom plugin and save data

Solved it! Hope somebody else can use it or it answers their problem. If there is a better way please share and tell why. $editor_id = ‘custom_editor_box’; $uploaded_csv = get_post_meta( $post->ID, ‘custom_editor_box’, true); wp_editor( $uploaded_csv, $editor_id ); To save the data: function save_wp_editor_fields(){ global $post; update_post_meta($post->ID, ‘custom_editor_box’, $_POST[‘custom_editor_box’]); } add_action( ‘save_post’, ‘save_wp_editor_fields’ ); And that’s … Read more

Shortcode attribute escaping

I suggest using keywords for them. so you would do something like [shortcode attr=”single_quote double_quote”]test[/shortcode]. Then, while parsing the shortcode you can change them back.

strip only specific tags (like ), but keep other tags (like )

You’d better never disable those actions (what you say). Instead, insert add_filter(‘the_content’, ‘MyFilter’, 88 ); and create such function: function MyFilter($content){ $tags = array( ‘p’, ‘span’); /////////////////////////////////////////////////// ///////// HERE INSERT ANY OF BELOW CODE ////////// /////////////////////////////////////////////////// return $content; } ======== METHOD 1 ========= $content= preg_replace( ‘#<(‘ . implode( ‘|’, $tags) . ‘)(.*|)?>#si’, ”, $content); $content= … Read more

add_editor_style is not loading in frontend. Any solution?

Here is my solution: add_filter(‘the_editor_content’, “firmasite_tinymce_style”); function firmasite_tinymce_style($content) { add_editor_style(‘assets/css/custom.css’); // This is for front-end tinymce customization if ( ! is_admin() ) { global $editor_styles; $editor_styles = (array) $editor_styles; $stylesheet = (array) $stylesheet; $stylesheet[] = ‘assets/css/custom.css’; $editor_styles = array_merge( $editor_styles, $stylesheet ); } return $content; } Live Example: http://unsalkorkmaz.com/firmasite-social-buddypress-bbpress-theme-based-on-bootstrap/ Check comments wp_editor.. its loading bootstrap.css … Read more

How to add editor-style.css styling to wp_editor on front end for comments

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 posters code would look like: add_filter( ‘comment_form_defaults’, ‘custom_comment_form_defaults’ ); function custom_comment_form_defaults( $args ) { if … Read more

Why Can’t wp_editor Be Used in a Custom Widget?

Short answer: Because there is a hidden widget where the TinyMCE appears first. Long answer (sorry, a very long answer): Go to the Codex and copy the example widget Foo_Widget to make sure we are talking about the same code. Now open your IDE (not an editor) and write a short testing widget as plugin. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)