Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notice dismiss JS dependency error #2557

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/admin/class-wp-job-manager-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function admin_enqueue_scripts() {
);
}

WP_Job_manager::register_script( 'job_manager_notice_dismiss', 'js/admin/wpjm-notice-dismiss.js', [], true );
WP_Job_manager::register_script( 'job_manager_notice_dismiss', 'js/admin/wpjm-notice-dismiss.js', null, true );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WP_Job_manager::register_script helper will load the dependencies from [name].assets.php generated the webpack script only if this argument is null. Supplying an empty array will instead override that dependency list.

wp_enqueue_script( 'job_manager_notice_dismiss' );

WP_Job_Manager::register_style( 'job_manager_admin_menu_css', 'css/menu.css', [] );
Expand Down
Loading