AdvancedCustomFields / AdvancedCustomFields/acf

Feature Request: Field Group Container missing on ACF term pages

Open
#466 6 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

@elliotcondon

I have a little feature request. On post edit pages, ACF wrap metaboxes with a container which includes the field group key as "id"-selector.

But if we have a field group on term pages, there is no selector we can use for our field groups.

I want to add modifications here, depending on the theme settings and therefore I need a field group selector for each field group on a term page.

I have found the correct file at:

https://github.com/AdvancedCustomFields/acf/blob/master/includes/forms/form-taxonomy.php

And all what we need to solve this is a very little modification in this ACF core file:

Changing ...

foreach( $field_groups as $field_group ) {

	// title
	if( $field_group['style'] == 'default' ) {
		echo '<h2>' . $field_group['title'] . '</h2>';
	}

	// fields
	echo '<table class="form-table">';
		$fields = acf_get_fields( $field_group );
		acf_render_fields( $fields, $post_id, 'tr', 'field' );
	echo '</table>';

}

... to ...

foreach( $field_groups as $field_group ) {

	// group container
	echo '<div id="acf-'. $field_group['key'] .'">';

		// title
		if( $field_group['style'] == 'default' ) {
			echo '<h2>' . $field_group['title'] . '</h2>';
		}

		// fields
		echo '<table class="form-table">';
			$fields = acf_get_fields( $field_group );
			acf_render_fields( $fields, $post_id, 'tr', 'field' );
		echo '</table>';

	echo '</div>';

}

... would solve this :-)

Would this modification be possible in the ACF core, please? :-)

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

The target is includes/forms/form-taxonomy.php, where the taxonomy field groups are rendered. Read the field-group loop and compare the term-page markup with the existing post edit rendering. Done means each term-page field group has its own field-group selector without changing the rendered fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.