Cannot read properties of undefined (reading ‘show_ui’) Error on WordPress Post Editor
Cannot read properties of undefined (reading ‘show_ui’) Error on WordPress Post Editor
Cannot read properties of undefined (reading ‘show_ui’) Error on WordPress Post Editor
remove specificly the last tag in all posts
Confirmation message when submitting post for review
This code should be conditional first and then form output since you can’t use wp_redirect after headers are set and you are updating so use update_post_meta instead of add_post_meta. Try: if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty( $_POST[‘action’] ) && $_POST[‘action’] == “edit_post” && isset($_POST[‘pid’])) { $the_post = get_post($_POST[‘pid’]); $the_post = array(); $the_post[‘post_content’] = $_POST[‘description’]; $the_post[‘data’] … Read more
Search for a filter on ‘user_can_richedit’. Remove that code from the theme. This is a perfect illustration for the argument that themes should do as little as possible. 🙂 The code will probably look like this: add_filter( ‘user_can_richedit’, ‘__return_false’ );
I can’t find the proper hook, but there is alternative solution: to add style=”float:right” to all images in content, which have class=”alignright”: add_filter(‘the_content’, ‘my_add_image_float_right’); function my_add_image_float_right($content) { $pattern = ‘@(<img.+)(alignright)(.*)(/>)@Ui’; $replacement=”$1$2$3 style=”float:right” />”; $content = preg_replace($pattern, $replacement, $content); return $content; }
Add the Javascript code below to your submit button. This should remove the event that provides the warning. Please note that this code is untested. window.onbeforeunload = null; This should disable the property however as stated above this code is untested. Cheers, Joe
Here is one idea: You could try to fire the change event of the #location-address (for example) input text field when the page has loaded: function custom_jquery() { echo “<script>jQuery(document).ready(function(){ jQuery(‘#location-address’).on( ‘change’, function( event ) { console.log(‘debug: on change fired!’); }); jQuery(‘#location-address’).change(); });</script>”; } add_action( ‘admin_head-post.php’, ‘custom_jquery’ ); if your editing page is post.php. You … Read more
You can try the edit_form_after_title action: add_action( ‘edit_form_after_title’, function(){ echo ‘<hr/><div>My custom HTML</div><hr/>’; }); to add your custom HTML after the permalink: It will inject the HTML between div#titlediv and div#postdivrich: <div id=”post-body-content”> <div id=”titlediv”>…<!– /titlediv –> <hr><div>My custom HTML</div><hr> <div id=”postdivrich” class=”postarea edit-form-section”>…</div> … </div> Tip: when you have question like this, best thing … Read more
I am not aware of clean native solution, however there have been at least one plugin in the past Save Editor Scroll Position (note – very outdated) trying to address this and might serve like prior art. There is also open trac ticket #18943 Scroll back to previous editor position after post save/update, however without … Read more