Tag Info

Hot answers tagged

4

You can filter the TinyMCE body classes to add or change as needed. It's a string that's pre-populated with some things like post type, so the easiest thing to do is append your additional classes (with a preceding space). <?php function wpse_128380_tinymce_body_class( $mce ) { // you could do things here to detect whatever you need // and use ...


4

Add Dashicon All buttons inside the TinyMCE have a class, also your custom button. Include (use wp_enqueue_style() a stylesheet with styling with Dashicons, like the follow example. .myicon:before { content: '\2605'; display: inline-block; -webkit-font-smoothing: antialiased; font: normal 16px/1 'dashicons'; vertical-align: top; } On ...


4

Try this: replace 'theme_advanced_disable' => 'fullscreen' with 'toolbar1'=> 'bold,italic,underline,bullist,numlist,link,unlink,forecolor,undo,redo' Also, remove 'teeny' => true,


3

To style the icons using the Dashicons CSS files that are already loaded in the WP dashboard requires adding some extra CSS. In the latest beta of Wordpress (3.9), TinyMCE 4.0 is used so I'm not sure this will work on earlier versions (however a modified version may suit, adjusting for the different classes outputted by previous TinyMCE buttons). In WP 3.9 ...


3

The main problem are the missing scripts. The scripts enqueued in _WP_Editors::enqueue_scripts() are never printed. The same is true for _WP_Editors::editor_js(). So you have to do that in your AJAX callback handler. I have written a demo plugin and put it on GitHub: T5 AJAX Editor. There is one class named Ajax_Editor. Its method render() prints the ...


2

I had the exact same problem and found the solution to this. The problem is that the anchor plugin for TinyMCE is not being included as part of the default Wordpress install. So while Wordpress says to include: $buttons[] = 'anchor'; …that's not going to work because the TinyMCE plugin for anchors isn't there. If you go to TinyMCE's website, you can ...


2

I would use the phrase Nested Shortcodes to describe it. You can find many questions using that phrase here on WPSE. The Codex also uses it, for example here: http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes Since the shortcodes in your example are related to the layout, we could perhaps call it: Nested Layout Shortcodes to be ...


2

If you just want to get rid of the \ characters in the string that's returned, you can use PHP's stripslashes(): $content = stripslashes( $content ); I'd recommend doing this on output rather than on input; WordPress adds the slashes as it sanitizes your data on insert, per update_option()'s Codex page, The $option (option name) value is escaped with ...


1

$settings = array( 'tinymce' => array( 'width' => 200 ) ); Gives you a tinymce that's 200px wide. Found it here: http://www.tinymce.com/wiki.php/Configuration When I tried it the background color of my tinymce changed. So maybe you have to tweak that.


1

Well... WordPress uses the wpeditimage tinymce plugin to perform the tasks for the "Add Media" editor button. When you click the pencil icon to edit the image... the wpeditimage plugin will read the image code, and determine if there is a value of _blank for the target attribute. If the value is _blank; the plugin will check the box when the modal window ...


1

Try echo html_entity_decode($ccontent) .


1

If you are using WordPress 4.0+ you can do this using the wp_editor_settings and the global $pagenow to determine if you are on the comments page. add_filter( 'wp_editor_settings', 'remove_editor_quicktags', 10, 2 ); function remove_editor_quicktags( $settings, $id ){ global $pagenow; if ( $id == 'content' && $pagenow === 'comment.php' ){ ...


1

This ended up working for me, uses the tinyMCE init filter to remove the 'statusbar' entirely. /** Edit TinyMCE **/ function myformatTinyMCE($in) { $in['statusbar'] = false; return $in; } add_filter('tiny_mce_before_init', 'myformatTinyMCE' ); Even with CSS, I couldn't find a way to definitely remove the path but keep the status bar - here's the ...


1

That's the code I added to my javascript, right before the form is submitted. // Find and loop through all TinyMCE editors. jQuery('#the-form').find( '.wp-editor-area' ).each(function() { var id = jQuery( this ).attr( 'id' ), sel = '#wp-' + id + '-wrap', container = jQuery( sel ), editor = tinyMCE.get( id ); // If the editor ...


1

you can solve this problem by enqueue the following script with the dependency of jQuery jQuery(document).ready(function(){ tinyMCEPreInit.dragDropUpload = false; }); To add the dependency you can refer this link I have tested this solution and it has worked for me. I hope it will work for you too.


1

As mentioned in the comments, this is a lack of wp_autop() and other formatting functions that get applied to the the_content filter. The editor does not save <p> tags at all, but later on line-breaks are converted into paragraphs via wp_autop(). For meta content, I like to recreate the default filters. I do this because some plugins add things via ...


1

This should do the trick: remove_filter('the_content', 'wpautop'); remove_filter('the_content', 'wptexturize');


1

I'm not good with English, but the answer is that the editor class calls the scripts needed in the admin footer (wp-includes/class-wp-editor.php line 160) : add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js'), 50 ); add_action( 'admin_footer', array( __CLASS__, 'enqueue_scripts'), 1 ); So when you call the wp_editor function in your ...


1

Your jQuery code is using the $ symbol without accounting for noConflict mode. More information: http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers


1

Maybe you should just add a custom field to accept the url itself, in stead of the wp_editor textarea; then append the video embed after you work with the input. Let me know if you need any help setting that up. OR: You could add a separete textarea to accept just comma separated or line-break separated urls (Because you stated below that you might need ...



Only top voted, non community-wiki answers of a minimum length are eligible