AdvancedCustomFields / AdvancedCustomFields/acf

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

Open
#831 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with ACF Pro field groups targeting default pages, separate custom post types with their own meta boxes, and jQuery UI sortable behavior. Start by tracing when ACF enqueues scripts and styles for each post type; done means non-targeted post types no longer receive those assets and sortable functionality remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
jquery, php
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.