AdvancedCustomFields / AdvancedCustomFields/acf

Ability to adjust remove_wp_meta_box per post type

Open
#836 0 comments 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

By default, ACF hides the custom posts metabox. You can reenable it like so:

add_filter( 'acf/settings/remove_wp_meta_box', '__return_false' );

However, this turns it on or off for all post and all post types. If you attempt to enable it for a specific post type:

add_action( 'wp', function() {
	if ( 'sample-cpt' === get_post_type() ) {
		// Show custom fields boxes, even when ACF is installed
		add_filter( 'acf/settings/remove_wp_meta_box', '__return_false' );
	}
});

This will fail as the wp hook happens after ACF has already initialized.

It would be helpful if you allowed the custom posts metabox to be enabled/disable at a later point in the action-firing sequence.

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

Start by tracing the acf/settings/remove_wp_meta_box filter through ACF initialization and the WordPress wp hook described in the issue. Determine where the setting is evaluated and how post types are available at that point. Done means the custom posts metabox can be enabled or disabled per post type after the relevant action sequence, without changing behavior for other post types.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.