Tag Info

Hot answers tagged

5

Make sure you've registered the stylesheet for the editor: add_editor_style( 'http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' ); This should be in your functions.php https://codex.wordpress.org/Editor_Style


3

As you noted, setting quicktags to false removes the "visual" and "text" tabs. So, to leave the tabs you need to set quicktags to true and remove the buttons: $settings = array( 'quicktags' => array( 'buttons' => ',' ) ); wp_editor($input, 'editor_name', $settings); To have this in all quicktags ...


2

If you wait for the SetupEditor event then you can access the editors: add_action( 'admin_print_footer_scripts', function () { ?> <script type="text/javascript"> jQuery(function ($) { if (typeof tinymce !== 'undefined') { tinymce.on('SetupEditor', function (editor) { if (editor.id === 'contentLeft') { ...


2

You can adjust the attachment query in the media library popup, through the ajax_query_attachments_args filter. Here are two PHP 5.4+ examples: Example #1: Show only attachments that where uploaded during the last 24 hours: /** * Media Library popup * - Only display attachments uploaded during the last 24 hours: */ add_filter( ...


2

I was able to resolve both defaulting to the Visual editor and hiding the tabs with the following code. Dumped the following in plugin file: add_filter( 'wp_default_editor', array($this, 'default_editor') ); Hide the tabs with this javascript: $('.wp-editor-tabs').remove(); Or hide it with CSS: .wp-editor-tabs{display:none;}


2

If you use Text editor, instead of Visual editor, you will add exactly the html code you wanted to add there. It has nothing to do with the PHP code you mentioned, just html from visual editor is transformed in the way you get it later (< and > and so on).


2

Yes as per @Nibbr Web Development, TinyMCE editor IDs cannot have brackets. Which is the html field ID, so what we will do is create a different but similiar name for the ID attribute and still use our desired name in for the text area field name, like so. $content = $options['textareafield']; // editor_id cannot have brackets and must be lowercase ...


1

The solution was to use the fullpage plugin. See: http://www.tinymce.com/wiki.php/Plugin3x:fullpage


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

The Problem This turned out to be a common case of needing to use stripslashes();. How did I figure this out? I logged into phpMyAdmin, navigated to the options table, found my option name, and edited it. Here's what I discovered... s:11:"description";s:90:"<span style=\"text-decoration: underline;\">This is supposed to be underlined ...


1

Add the filter "ajax_query_attachments_args" in this way and URLs variables are sent to the class WP_Query the default is to send array(7) { ["orderby"]=> string(4) "date" ["order"]=> string(4) "DESC" ["posts_per_page"]=> string(2) "40" ["paged"]=> string(1) "1" ["post_type"]=> string(10) ...


1

I'm not a very good coder, I've only asked questions on here, but because no one was able to answer your question, I suppose I'll give it a shot. If I remember correctly, this should remove the toolbars on the tinyMCE: function my_format_TinyMCE( $in ) { $in['toolbar1'] = ''; $in['toolbar2'] = ''; $in['toolbar'] = false; return $in; } ...


1

The code below will work, read inline comments. Paste it into your theme functions.php or plugin. The only problem with this is the it will only work when the template is selected and the post is saved/updated and the editor is blank. <?php function wpse_177576_update_editor_content( $post_id ) { if ( wp_is_post_revision( $post_id ) ) ...


1

You can check this out - wpgallery plugin, this is how they do it for the [gallery] shortcode, basically parsing the shortcodes on the client-side, and replacing them back and forth as you click "Visual" or "Text". Unless you are building a plugin, I would advise you to refrain from using shortcodes - use plain HTML, you'll have an easier time working with ...



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