Questions tagged [wp-dependencies]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
31 views

Where to put my global functions?

I currently have a global function in my functions.php file ein_error_log($message) { //push out $message to file... } But I want to start using it in my MU-Plugin directory and it doesn't ...
0
votes
0answers
35 views

Enqueue registered dependencies only when necessary

I'm developing plugin where I want to load my dependency JS libraries only when the setting is enabled. The most correct way is to register all the scripts and styles I have and then enqueue my main ...
1
vote
1answer
28 views

How to provide a plugin which requires CMB2 (plugin dependencies)?

Every serious plugin developer probably has to deal with this problem: WordPress is not supporting composer or any dependency management by default. I have written a great plugin which I would like to ...
0
votes
0answers
21 views

Set a parent script presence status true so that child scripts load in wordpress

I didn't know how to write a good title for my problem. I'm trying to integrate some scripts in js file and dequeue them to decrease browser requests. So let's say we have some child scripts which ...
1
vote
2answers
185 views

Loading jQuery in the footer after removing jQuery migrate?

I am removing jQuery migrate in WordPress in this way: add_filter( 'wp_default_scripts', 'remove_jquery_migrate' ); function remove_jquery_migrate( &$scripts ){ if(!is_admin()){ $...
1
vote
1answer
539 views

Conditionally dequeue dependency of scripts

Please note that, I'm not telling about conditionally enqueue/dequeue scripts, I'm referring to conditionally dequeue certain dependencies from an existing enqueued scripts in front end. And please ...
0
votes
2answers
182 views

wp_enqueue_script silently fails [closed]

I created a plugin which uses bootstrap datetimepicker. So i load corresponding js setting dependancies like this: wp_enqueue_script('medapp-datetimepicker-js', $medapp_boot_timepicker_js, array( ...
0
votes
2answers
124 views

PHP includes with AJAX actions

I have the following code in my main plugin file <?php include plugin_dir_path( __FILE__) . 'options.php'; include plugin_dir_path( __FILE__ ) . 'config.php'; include plugin_dir_path( __FILE__ ) . ...
1
vote
2answers
72 views

Can´t access child theme´s scripts dependencies found in parent

I´ve been struggling with this for nearly a month now and still couldn´t find anything at all on how to do this! Not here, not in Quora, not through many different advanced Google search queries... ...
3
votes
2answers
469 views

Identifying the priority of style.css so I can make a small CSS file load last

I have a small bit of hourly-changing css and I want to keep it in a second file (apart from style.css) and load it after my theme's style.css file. I believe I can make it load before style.css by ...
0
votes
2answers
1k views

Flexslider won't work with WordPress' jQuery | Dependencies

When I try to use the Flexslider with 'built-in' jquery, the Flexslider won't work. When I use my own myjquery file, It works as if nothing ever. Do I always have to use my own jquery file even ...
0
votes
0answers
25 views

How to check for dependencies for a specific page and enqueue them

I am creating a one page site where the content of the sections (separate pages) above and under the actual page section are lazy loaded via AJAX. Say in one of the pages a shortcode for a gallery ...
2
votes
0answers
119 views

Wordpress with Composer and different plugins for dev/live.

I'm using a Bedrock-like setup where I handle Wordpress core & plugins with Composer. I have my usual plugins in my composer.json within the "require" block, and some dev related plugins in "...
3
votes
3answers
5k views

Check for dependent plugin and if false dont activate plugin

I am creating a plugin for WordPress and this plugin depends on another plugin with a specific version. If I enable my plugin without dependent plugin there are fatal error. Is there a way to check ...
5
votes
0answers
319 views

RequireJS in custom theme. Working Example

I try to add to my custom wordpress Theme requirejs because I do not want to use wp_enqueue over and over to inject used plugins and on the other side I do not want to mess the DOM from the beginning. ...
8
votes
1answer
2k views

Concatenate and minify dependencies for enqueued JavaScript files

I'm loading a JavaScript file using wp_enqueue_script into my theme. However, along with it, I'm loading several jQuery files as well, as dependencies for the enqueued script (which has already been ...
0
votes
1answer
546 views

How to enqueue default scripts with dependency?

I'm developing a plugin and for that I need jQuery and jQuery datepicker. I's taught that WordPress already enqueued some scripts, and I found 'jquery' and 'jquery-ui-datepicker' there. Where the ...
0
votes
0answers
89 views

Proper Failure of Plugin Activation

I am currently developing a plugin, which depends on another plugin (json-api). I use the following code to check for the presence during startup and in the constructor, in case the json-api plugin is ...
1
vote
2answers
67 views

JavaScript added as link/stylesheet

I am just trying to create a plugin that will add some JS to the header and custom CSs. I have this below but it adds the css wrong and shows as JS. This is first plugin i have attempted. <?php /**...
1
vote
1answer
582 views

How to get list of Scripts in Order of Dependencies

I was writing plugin for combining JS and CSS as three plugins I tried has not worked for me. Dependency problem is where I stopped. It look tough. Then I thought Wordpress can itself help. How to ...
4
votes
1answer
434 views

How to modify/extend/override a core method?

This is my first post. In advance, thank you for welcoming me... Context When you enqueue style, you can output your css link into conditional comments. global $wp_styles; wp_enqueue_style("...
6
votes
2answers
1k views

Add a script as a dependency to a registered script

wp_register_script() (see codex) allows you to specify dependencies: scripts that must be loaded before the one being registered is loaded (if it is loaded). But suppose the script is a third-party ...
11
votes
1answer
3k views

Is there any sort of theme dependency management?

I'm developing a Wordpress theme with a few other individuals and am running into a problem where I add a plugin and then I have tell the other developers about the plugin I installed and the settings ...
31
votes
2answers
5k views

Should 3rd Parties Use $wp_scripts/$wp_styles->add_data?

Within the WP_Dependencies class exists a method named add_data. This function adds data to scripts/styles that have been enqueued during the WordPress load. A commonly cited use for this function is ...