How do I access the contents of WordPress Classic editor in admin area with JavaScript?

To get the editor content as a string in the classic editor use this: content = tinymce.activeEditor.getContent(); Taken from https://stackoverflow.com/a/5843951/57482 Note that you should use the APIs provided rather than directly modifying the DOM if you want to modify the content. If you don’t, you won’t update plugins local states in javascript causing problems. Modifying … Read more

How do I cycle a JS function in WordPress? [closed]

Rather than trying to include jquery with your javascript, you should use wordpress to define jQuery as a dependency to your custom script. function custom_js_script_enqueue(){ wp_enqueue_script( ‘mycustomjs’, CHILD_THEME_URI . ‘/assets/js/my-custom-js.js’, array(‘jquery’), ‘1.0.0’ ); } add_action(‘wp_enqueue_scripts’, ‘custom_js_script_enqueue’); you can read about all of the libraries available in wordpress here. Your script should not include the jquery … Read more

notify users when changed database

I don’t want Ajax request to be sent every 2 seconds. Is there a way to send me a notification only if the database changes in a certain meta? You can’t watch the database for changes like this. The most you could do is add filters on post meta changes on the PHP side to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)