Bridging TinyMCE js and WordPress PHP?
I have integrated buttons to TinyMCE with WordPress functionality, let me know if this material would add some context with code samples to your use case.
I have integrated buttons to TinyMCE with WordPress functionality, let me know if this material would add some context with code samples to your use case.
I created and managed my own custom meta fields for years and I can tell you it was always a headache. I frequently came up against stumbling blocks like yours and ended up banging my fist against the wall. I’ve also worked on quite a few sites which had been flooded with plugins, sometimes so … Read more
I had the same problem. You likely don’t need this any more, but just in case anyone else has this problem, here it is: The first hint of the issue with Chrome and prettyPhoto is that it occurs only when gallery images have a very large resolution and when thumbnails are being shown. What seems … Read more
Ok, so, for some reason I can’t comprehend, the answer is that the div element containing the tabs should have a class and not an id for jQuery UI to work properly, as such: <div class=”mytabs”> and jQuery(document).ready(function($) { $(“.mytabs”).tabs(); }); Just for the record, the way I enqued the scripts is: add_action( ‘admin_enqueue_scripts’, ‘load_my_admin_js’ … Read more
You can store the data in the user meta as an array of post-id -> comment count at last visit and then simply count the comments since that date, for example function get_user_comment_count_since_last_visit($user_id ,$post_id){ //only do this for logged in users if ($user_id <= 0 ){ return 0; } /** * get last comment count … Read more
You can’t, not the way you are trying. You can’t start meddling in the iframes internals, it has its own DOM etc that needs to be respected etc This question is already veering into offtopicness as it is more of a TinyMCE question than a WordPress question Instead create a tinyMCE plugin, include jQuery in … Read more
In your functions.php: edit: First register the quicktags script under a different name than already registered in wp “quicktags” , see Codex function quicktags_script() { wp_register_script( ‘quicktags-min’, ‘/wp-includes/js/quicktags.min.js?ver=3.5.1’,”,”,true); wp_enqueue_script( ‘quicktags-min’ ); } add_action( ‘wp_enqueue_scripts’, ‘quicktags_script’ ); This will load the script for all the pages on your front-end. To load it only on front-page : … Read more
Use wp_localize_script: wp_enqueue_script(‘YOUR_SCRIPT_HANDLE’); $object = array( ‘zoom’ => get_option(‘map_zoom’), ‘longitude’ => get_option(‘map_longitude’), ‘latitude’ => get_option(‘map_latitude’), ); wp_localize_script(‘YOUR_SCRIPT_HANDLE’, ‘JSObject’, $object); And then use it in your JS file like JSObject.zoom and the like.
The action is plural: wp_print_scripts, however, the action you want to enqueue scripts on is wp_enqueue_scripts.
You’re using an invalid action: add_action(‘wp_enqueue_script’, ‘run_js_script’); The correct action is wp_enqueue_scripts (plural), not wp_enqueue_script (singular). Use this instead: add_action(‘wp_enqueue_scripts’, ‘run_js_script’); Edit Same problem here: add_action(‘wp_register_script’, ‘register_script’); Just hook it into wp_enqueue_scripts for simplicity: add_action(‘wp_enqueue_scripts’, ‘register_script’); Actually, two better options: Put your wp_register_script() call in the same run_js_script callback as your wp_enqueue_script() call. Eliminate wp_register_script() … Read more