Wysiwyg editor not working on 4.2.2

I've recently upgraded a site for the Add Media button wasn't working. Now, having upgraded to 4.2.2 the Add Media works, but the Wysiwyg editor isn't showing. The only console messages I'm receiving are: Uncaught ReferenceError: edButtons is not defined (anonymous function) @ post-new.php:131 The new post screen appears with the Text tab selected, instead of Visual, and when I try to select the Visual tab I get: Uncaught TypeError: Cannot read property 'canvas' of undefined a.closeAllTags @ quicktags.min.js?ver=4.2.2:1 window.switchEditors.go …
Category: Web

Uncaught TypeError: switchEditors.switchto is not a function

I have the following line of code: switchEditors.switchto(ctmce[0]); which gives this error: Uncaught TypeError: switchEditors.switchto is not a function Searching around I found out that, due to changes to the core in WordPress 4.3, switchEditors.switchto() is not available/usable now. Do you know how can I fix it? You can see the complete code here.
Category: Web

What's the best way to trim content from WYSIWYG editor?

I have done an excessive amount of googling and haven't found exactly what I need yet. The client uses the editor (WYSIWYG) to create posts. She adds photos, links to external photos, videos, embeds external videos, and all other formatting. But she does not use the tag nor the excerpt field. When I use wp_trim_words() I get mixed results. Posts with local videos leak markup onto the page A couple posts are only images so there isn't any content at …
Category: Web

How to apply padding to TinyMCE editor?

I am using the following in functions.php... function wpdocs_theme_add_editor_styles() { add_editor_style( array( 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css', 'assets/css/editor.css' ) ); } add_action( 'admin_init', 'wpdocs_theme_add_editor_styles' ); ... to apply the Bootstrap CSS to my WordPress post editor. Bootstrap comes in nicely. But this now results in the removal of any padding from the post editor. File editor.css contains padding: 40px !important; in turn applied to a range of CSS classes... the padding is not getting applied... .mce-panel, .mce-edit-area, .mce-container, .mce-panel, .mce-stack-layout-item, .wp-editor-container .wp-editor-area, .wp-editor-container, .wp-editor-area …
Category: Web

How to dynamically generate wordpress editor on frontend?

I want to initialize the wordpress editor dynamically on frontend. I have tried to include the following scripts: wp_enqueue_script('editor'); wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); Then to init the editor like this: tinymce.init({ mode : 'specific_textareas', editor_selector :'tinymce' }); But it does not work. Any ideas?
Category: Web

How to Add WYSIWYG Editor (tinyMCE) to plugin options page compatible with Wordpress 3.0 and up?

I'm trying to add tinyMCE instead of textarea for one of my options in my plugin with no luck so far. I tried this : http://www.dbuggr.com/smallwei/add-wysiwyg-editor-tinymce-wordpress-plugin/ and this: http://blog.imwd8solutions.com/wordpress/wordpress-plugin-development-add-editor-to-plugin-admin-page/ There seems to be some problem with styles as styles for tabs (HTML style/Visual style) dont work. Anybody knows about implementation that works 100% with WP 3.0 and up ?
Category: Web

Remove_filter ('the_content', 'wpautop') is not working

I've tried disabling WP's auto-paragraph thingy using remove_filter ('the_content', 'wpautop'); but I am still getting my stuff wrapped in automatic <p> tags... What am I doing wrong? Its at the bottom of a functions file. Its not in functions.php, but in a file that functions.php includes (and putting it in functions.php doesn't change the behaviour at all). Update: var_dump( $wp_filter['the_content'] ); outputs NULL. How can I test why this filter isn't being run?
Category: Web

Stop Wordpress Wrapping Images In A "P" Tag

I have searched high and low for a simple solution to this, but to no avail. Wordpress keeps on wrapping my images in p tags and because of the eccentric nature of the layout for a site I am working on, this is highly annoying. I have created a jQuery solution to unwrap images, but it isn't that great. It lags because of other stuff loading on the page and so the changes are slow to be made. Is there …
Category: Web

How do you add custom color swatches to all WYSIWYG editors?

I would like to be able add the same custom colours to the swatches at bottom of colour picker panels that appear in the WYSIWYG editors across the site, to make it easier for clients to keep consistent in their styling. The swatches I refer to are the bottom row in the screenshot. I would like to do this without installing a plug-in, ideally.
Category: Web

Cite-Tag for blockquotes

I want to have a cite underneath my blockquote, that has a certain style. "Blockquotes are an essential part of a fancy website." – Cite The markup should look like this: <blockquote><p>Blockquotes are an essential part of a fancy website."</p> <cite>Cite</cite></blockquote> But the WYSIWYG-Editor does not offer me the possibility to define a cite for the blockquote. And I can't force my users to write the HTML by hand. Is there a way to make the WYSIWYG-Editor generate the required …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.