AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
823 stars 168 forks source link

Disable ACF Scripts/Styles for non-targeted post types. #831

Open JerresonJ opened 1 year ago

JerresonJ commented 1 year ago

We have ACF Pro installed and have field groups that are applied to specific pages. These pages are default wordpress pages not custom types. However, we are finding that ACF is loading all scripts/styles in custom post types that aren't targeted by any field groups.

What we have happening is we have some custom post types with their own custom meta boxes and we are using jquery ui sortable to allow drag/drop within these meta boxes but ACF Styles/Scripts are loading in on the custom post types and breaking our drag/drop functionality.

How can we block ACF from enqueueing any scripts/styles to a post type it doesn't target with any field groups?

JerresonJ commented 1 year ago

Just a side note we resolved this a different way but would still be nice to know how to stop ACF from loading scripts/styles unless actually needed on the post_type