RequireJS in custom theme. Working Example
RequireJS in custom theme. Working Example
RequireJS in custom theme. Working Example
I don’t know where your iframe is getting it’s color information from, but you probably need to write the selected color from the color picker to that field. This is an example including throttle. update_color is a function that deals with the new color. You can put there some code that puts the picked color … Read more
Take a look at this http://sltaylor.co.uk/blog/hijacking-the-wordpress-media-library-overlay/
I would do this by hooking into the save_post action, not by javascript. The main idea is to check if both values are there (Your Radiobutton is selected AND the post_thumbnail is present), and set the post to draft if they are not, as well as displaying an Information if the user does not fulfill … Read more
I found it, WordPress made changes and you can now add buttons through a simple API if( !function_exists(‘_add_my_quicktags’) ){ function _add_my_quicktags() { ?> <script type=”text/javascript”> /* Add custom Quicktag buttons to the editor WordPress ver. 3.3 and above only * * Params for this are: * string id Required. Button HTML ID * string display … Read more
You can’t. While manipulation of JS and HTML is possible, it is not adviceable as a long term strategy unless it was explicitly document as “the right way” in the codex, code comment, or some other core document. In addition to the theoretical objection, right now it is hard or almost impossible to override specific … Read more
The following works for me for product archive pages (these include both the main shop page as well as archive pages for product categories, for example). It will show the current cart contents in a thickbox. I chose to show this for this example just because that’s the data that one gets back through Ajax … Read more
You can target a specific page using is_page() when you are enqueueing your JS file. function my_scripts_method() { if( is_page(‘your page title’) ){ wp_enqueue_script( ‘your-js-script’ ); } } add_action( ‘wp_enqueue_scripts’, ‘my_scripts_method’ ); This way, you will conditionally enqueue your JS to that page only.
First of all this is what I use and for me and it works. I’m not saying that my code is 100% correct but Pingdom as well GTmetrix show a positive effect and WP is satisfied also, so it can’t be that wrong as I do. The versions showing (?ver=x.x.x) can be debet when those … Read more
//ajax call var data = { action: ‘folder_contents’, path: datafolder }; var ajaxurl = baseurl + ”; //WHAT IS THIS?!?! jQuery.post(ajaxurl, data, function(response) { alert(‘Got this from the server: ‘ + response); console.log(response); }); And your PHP in functions.php //Called by Ajax from App – list the contents of the folder so they can be … Read more