Tag Info

Hot answers tagged

3

it seems the latter only accepts x-www-form-urlencoded That's not completely true. WordPress admin-ajax.php takes the action from $_REQUEST['action'] and $_REQUEST is equal to: array_merge($_POST, $_GET); But what many people don't realize is that $_GET in PHP is not the data was sent to page using HTTP GET method, in fact, you can use whatever ...


2

IMHO, I still think that loading scripts and styles directly in the header is bad practice as it is always a problem removing them and loading them coditionally. The best way to work around this is to create a [child theme] and then copy header.php to your child theme. Wordpress will load your child theme's header instead of the parent theme's header. You ...


2

After struggling around for days through the poorly documented media modal source code and using code from the gist (thanks, Fabien), I came up with a solution: JS: wp.media.controller.Custom = wp.media.controller.State.extend({ initialize: function(){ this.props = new Backbone.Model({ custom_data: '' }); this.props.on( ...


1

Your code is wrong. You are confusing wp_enqeue_script function and wp_enqueue_scripts action. It should be: function theme_script(){ wp_deregister_script( 'jquery' ); wp_register_script('jquery',get_template_directory_uri().'/sliderengine/jquery.js'); wp_enqueue_script('jquery'); ...


1

Here's a working example: add_action( 'wp_enqueue_scripts', 'menu_scripts' ); function menu_scripts() { wp_enqueue_script( 'responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'custom-script', get_stylesheet_directory_uri() . '/js/custom_script.js', array( 'jquery' ...



Only top voted, non community-wiki answers of a minimum length are eligible