I would like to use ENTER button to insert line break, not SHIFT + ENTER by default. I added this code into function.php. It works but the problem is the text-align buttons are not working. When I click on any text align button, nothing happens. The text align buttons in Both Wordpress editor and TinyMCE Advance plugin editor are not working. But when I remove the code, it comes back normal. How can I solve this issue? /* Filter Tiny …
My goal is to get wp_editor working in a simple widget which the admin can use to add text content on an admin options page. Here we go in wp-admin/widgets.php everything looks sooo good right. When we try to save... Oh no..... Buttons are gone and the Visual tab no longer works When I look at the HTML it appears as though after updating TinyMCE just decides it doesn't need to load any buttons... Any ideas? Edit: here's the source …
I have created a front-end editor using wp_editor that functions as it should. Upon testing I have noticed that it is stripping out any shortcodes that have been inserted in the content. I have looked into this issue and found that it's the 'ob_' (output buffering) that is removing them. If I remove this output buffering then the shortcodes display fine, but it breaks the functionality I have created for the editor. How would I keep the code I am …
I have the old problem that the WordPress editor overwrites my HTML code. For example, the editor inserts <p> and <br> tags where you don't have them set. The second problem is the editor doesn't show the real source code. If I write some code in the editor, and update, and look afterwards at the source code in the front-end (e.g. with Firefox), it shows there are tags which I can't see in the back-end editor. To suppress the problem, …
I want to use the new inline editing from tinymce with the wp_editor function in wordpress. Here is some info on how to set up tinymce inline editing http://www.tinymce.com/tryit/inline.php The code I am using to call wp_editor is as follows: $editor_settings = array('dfw' => true,'quicktags' => false); wp_editor( $postcontent, 'postcontent', $editor_settings ); And in functions.php I have the following to enable inline editing: function mce_inline( $init ) { $init['inline'] = true; return $init; } add_filter('tiny_mce_before_init', 'mce_inline'); The problem here is …
I want to add the wp_editor content using jquery. I have hidden the wp_editor that needs to be displayed in the thickbox on one of the button click <div class="hidden-editor-container" style = "display: none;"> <?php wp_editor($page_content , 'hidePageContent'); ?> </div> How can I show this editor content into a wordpress thickbox? For example in below div(show-editor-container) <div class="show-editor-container"> <?php wp_editor('' , 'editPageContent'); ?> </div> I tried adding the below code in my js file but with no result: var page_content …
I'm trying to insert a wp_editor() into a page on the front-end with AJAX. The code I have right now inserts the wp_editor elements and the needed JavaScript and CSS files, but none of the settings I used initially in wp_editor() are used when creating this TinyMCE element. How do I pass the $settings set in PHP into the dynamically created TinyMCE instance? I found an old question that seems to answer my question, but I don't understand how it …
By default, when you insert an image into a post, it has some image alignment options (see below). In my theme I want every image to be full width. Of course, it's easy for me to change the front-end display of the images. But--in terms of usability--I don't want to cause the user to think that they are able to change the alignment. Is it possible to disable those alignment options?
I am using js code to add and remove form elements and to initialize the wp_editor on the dynamically added textareas with js. The wp editor is initializing correctly when I am only adding elements with the "add" button. However, when I click "remove", the last wp editor does not fully initialize (top toolbar is missing). I recorded a short video of the problem: WP Editor Not initializing Correctly. Here is the code I am using to add and remove …
This is a really weird issue. I am trying to store data from a form in a plugin settings page and allow users to add html code with wp_editor. The users can dynamically add as many fields as they want to the form (and wp_editor fields, respectively). The problem is that when the user tries to add the media on a particular wp_editor, the media is added on the next wp_editor field instead. For example, if you have 2 wp_editor …
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?
I don't know why when I'm using "Enter", that add &nbsp; in Pages/Posts Editor. That doesn't matter, but on my website, when I look the code &nbsp; makes this code : <p> � </p> and � appears on my website... How can I change that to simple code : <p> </p>
I add my custom fields in genearal settings page. One of them using Wordpress Editor - there i insert my HTML content. I creeated it using simple snippet: add_action( 'admin_init', 'register_settings_wpse_57647' ); function register_settings_wpse_57647() { register_setting( 'general', 'opisproduktyseop', 'esc_html' ); add_settings_section( 'site-guide', 'Publishing Guidelines', '__return_false', 'general' ); add_settings_field( 'opisproduktyseop', 'Enter custom message', 'print_text_editor_wpse_57647', 'general', 'site-guide' ); } function print_text_editor_wpse_57647() { $the_guides = html_entity_decode( get_option( 'opisproduktyseop' ) ); echo wp_editor( $the_guides, 'sitepublishingguidelines', array( 'textarea_name' => 'opisproduktyseop' ) ); } The problem …
After the update of WordPress 4.9.6, I got a very strange issue that I am not able to write anything in WordPress editor in visual mode. When I'm trying to switch from text to visual I am getting this span code instead of text. <span style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" data-mce-type="bookmark" class="mce_SELRES_start"></span> Can anyone help me out with this issue? I am not able to write anything.
I am working with a heavily customized install of WP. I've set up a specific post type, taxonomy, and roles that gets to use just that post type. Ideally, I'd like to restrict members of that role using that post type to only create one post. This seems like it might be more trouble than it's worth. So barring that, I'd like to display only the oldest of their posts in an archive view. I've got the following, which creates …
A few weeks ago I started building a website using the free edition of wordpress because it alowed me to have the site hosting, the domain, and the editor all for free. However later on as my site got a little bigger the wordpress editor/windows app/android app started being extremley laggy to the point where editing was impossible. I have tried for over a week to find an alternative wordpress editor but everything that google gives me requires a plugin …
I run a function to rename draggable/sortable items in a list, and I'd like it if the items could have a wysiwyg editor in them. I saw that some new javascript functions were introduced with 4.8, so I tried them out. Unfortunately, I can't seem to get them to work properly with dynamic elements. Here's the function that runs in the footer: // Check order of sortable items var checkOrder = (function checkOrder() { jQuery('.sortable-container').each(function() { jQuery(this).find('.sortable-item').each(function(i) { jQuery(this).find('label').each(function() { …
In 4.9.3 after saving the following in text editor <hr></hr> the content in XML file under test is as expected: <hr></hr> In 5.3.1 after saving the following in text editor <hr></hr> the content in XML file under test is not as expected: <hr> </hr> (notice the empty space added) While <hr></hr> is an incorrect use of the HTML tag, I still would like to understand why the empty space is being added.
I can't work out how to load self-hosted custom fonts for preview in the font_formats and 'style_formats` dropdown in TinyMCE (Classic Editor). TinyMCE documentation shows this example for loading a Google Fonts stylesheet (https://www.tiny.cloud/blog/tinymce-custom-font-family/): tinymce.init({ /* ... */ content_style: "@import url('https://fonts.googleapis.com/css2?family=Oswald&display=swap'); body { font-family: Oswald; }", }); …but when I try to apply this method to load @font-face instead, the dropdown previews still use fallback fonts. I can tell that TinyMCE is at least loading them somewhere, because if I …