Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

Commit a9478ec

Browse files
committed
Use dependency for jquery
Instead of enqueueing jquery directly, just add it as a dependency.
1 parent 17ee130 commit a9478ec

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

wp-rest-api-plugin-jquery-example.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,10 @@ public function attach_menu() {
7777
* Outputs the scripts and html for our page.
7878
*/
7979
public function output_page() {
80-
wp_enqueue_script( 'jquery' );
81-
8280
wp_enqueue_script(
8381
'rest-api-plugin-jquery-example-js',
8482
plugins_url( 'assets/js/rest-example-jquery.js', __FILE__ ),
85-
array(),
83+
array( 'jquery' ),
8684
REST_API_Plugin_JQuery_Example::VERSION,
8785
true
8886
);

0 commit comments

Comments
 (0)