I am having an issue where if using Quick Edit on my custom post type to change taxonomy selections, the grey spinning wheel appears when I click update and the whole process hangs.
If I edit an individual post and make changes there, everything is fine and I am able to save changes.
I did migrate from Custom Post Type plugin – but I wondered is there any setting that I am missing to be able to edit taxonomy terms in “quick edit”? Or, is it just not something I can do?
Thank you!
With ACF I’ve created a custom post type that has a custom taxonomy field (also created with ACF). In the custom post type I’m also using Gutenberg editor.
I’ve added the taxonomy field manually with a field group, but found that it is also present in the sidebar. I wanted to hide/remove the taxonomy from the sidebar, but I was not able to do it, even if I selected “No Meta Box” option at the “Visibility” tab of the custom field.
After hours and hours of struggling to find out what I did wrong, I found many Gutenberg-ACF-MetaBox related issues on different blogs, forums and GitHub, and these metabox hiding” of issues seems to be present for years.
However, I also found a GitHub comment from 2019 which – for me at least – actually provided a clean looking fix for this issue.
Here is the comment:
github . com /WordPress/gutenberg/issues/13816#issuecomment-470137667
And here is the code:
add_filter( 'rest_prepare_taxonomy', function( $response, $taxonomy, $request ) {
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
// Context is edit in the editor
if( $context === 'edit' && $taxonomy->meta_box_cb === false ){
$data_response = $response->get_data();
$data_response['visibility']['show_ui'] = false;
$response->set_data( $data_response );
}
return $response;
}, 10, 3 );
This code checks the taxonomies “meta_box_cb” property and allows modification of the taxonomy data right before it is returned from the rest API. And if the “meta_box_cb” is false, it sets “show_ui” of the metabox to false, so it will not show up in the sidebar.
This actually makes the “No Meta Box” option working with Gutenberg!
Is there any reason why this fix has not been implemented for four years?
Are you planning to implement it in the near future?
If not, at least it would be very important to add a note about this issue next to the “No Meta Box” option to save many hours of unnecessary debugging for the users.
Waiting for an official statement about this.
Best regards,
Zs
Hi, I created a new custom post type for cars in wordpress.
Now I plan to create a page for the list of brands using taxonomy or meta data, but I want to see the available series of this brand after the user enters the BMW page, and after entering the page of each series , view different generations of cars.
How can I connect 3 separate fields?
So that in the admin panel, something is the same as the system that exists in selecting the province and city in online stores. After selecting the province, a list of cities under that province will be displayed in the side form.
Is this possible in ACF?
example: https://www.car.info/en-se/brands
I wanted to do something like this in Taxonomy:
https://imgur.com/NIUHfos
I couldn’t find this option within Taxonomy > Advanced Settings. I can only see this in Post Types.
Hi:
I create “productos” CPT using ACF and a custom taxonomy “categoria-producto” asociated to “productos” CPT
I would like the item URL was:
mipage.com/tienda/%categoria-producto%/sample-product
As Woocommerce product (mipage.com/tienda/product-category/sample-product/)
How can i do that??
Thxs
Regards
I’d like to keep my custom taxonomy called “Branches” out of the URL, so I’d need to “hide” the slug somehow.
Current: site.com/branch/hotels/cpt
What I want is this:
site.com/hotels/cpt
I can’t figure out how to make that work, do any of you fine people know?
Thanks in advance!
I created:
I added:
Now I would like to show the featured images of the taxonomy terms I selected for a particular course. Tried the code below, but this code shows the featured images of all taxonomy terms, not only the ones I selected for the particular course.
function custom_accreditation_logo () {
ob_start();
$terms = get_terms( array( 'taxonomy' => 'accreditations', 'hide_empty' => false ) );
foreach ( $terms as $term ) {
$image = get_field('featured_image', 'accreditations_' . $term->term_id );
echo '<img src="' . $image['url'] . '" alt="' . $image['alt'] .'">';
}
$content = ob_get_clean(); // store buffered output content.
return $content;
}
add_shortcode( 'accreditatie_logos', 'custom_accreditation_logo' );
Does anyone know how to only show the featured images of the selected taxonomy terms (not the unselected ones)?
I created a repeater field (accreditations) containing a taxonomy subfield (organization) and text subfield (points). So for each row I can select one taxonomy term and put the associated points in the text subfield.
Now I would like to display the organizations (taxonomy terms) and points (text inputs) in a table. Tried the code below, which shows the points, but does not show the organizations (term names).
function custom_accreditations () {
ob_start();
if(have_rows('accreditations')):
echo '<div><figure class="wp-block-table"><table class="accreditaties"><tbody><tr><td><strong>Organization</strong></td><td><strong>Punten</strong></td></tr>';
while (have_rows('accreditations')) : the_row();
$term = get_sub_field('organization');
$points = get_sub_field('points');
if( $term ):
$organization = $term->name;
echo '<tr><td>'.$organization.'</td><td>'.$punten.'</td></tr>';
endif;
endwhile;
echo '</tbody></table></figure></div>';
endif;
$content = ob_get_clean(); // store buffered output content.
return $content;
}
add_shortcode( 'accreditatiepunten', 'custom_accreditations' );
What am I doing wrong? Anyone know how to display the taxonomy term names correctly?
Hi,
I have posts, with ACF relationship that let select a custom taxonomy ‘thematique’
I have custom posts ‘dossier’ with custom taxonomy ‘thematique’
I wish in an Elementor custom query to display
All custom post linked to current taxonomy + post that have this taxonomy as relationship
Actuaylly I have this, but I don’t know how to implement my needs
function get_posts_dossier_articles( $query ) {
$taxonomy_slug = get_query_var('taxonomy');
$query->set( 'post_type', [ 'post', 'dossier' ] );
}
add_action( 'elementor/query/dossiers_articles', 'get_posts_dossier_articles' );
thanks in advance for your precious help or suggests !
Hi there.
I have set up a relationship between the post type opportunity (as in job opportunity) and linked organisation – the organisation that is offering the opportunity.
There is a custom taxonomy for the Organisation called Accreditation which shows the various 3rd party accreditation that organisation has.
My question is
a) how can I show the name of the related organisation’s accreditations on the opportunity post
b) show the ACF custom fields for logo and url that I have attached to the accreditation terms.
Currently I am showing the custom field for organisation location on the opportunity template using the following query, which I hope to expand to include the accreditation category and its associated custom fields.
$linked_organisation = get_field('linked_organisation');
if ($linked_organisation):
foreach( $linked_organisation as $l) :
$organisation_location = get_field('organisation_town', $l->ID);
endforeach;
endif;
Thanks in advance,
Mat
I’ve been looking into ACF’s Post Types and Taxonomies and comparing all their available options with code that I’ve writing so far, in order to see if the options cover everything and they almost do.
I’ve noticed one omission in the Advanced Configuration of Taxonomies. Although Post Types have the following: General, Labels, Visibility, URLs, Permissions, REST API
Taxonomies are missing Permissions which would be the equivalent of passing an array of capabilities to the register_taxonomy() function. For example:
'capabilities' => [
'manage_terms' => 'manage_my_cpt_mytax',
'edit_terms' => 'edit_my_cpt_mytax',
'delete_terms' => 'delete_my_cpt_mytax',
'assign_terms' => 'assign_my_cpt_mytax',
]
Any plans to add it?
Hello,
i have a cpt and a form connected to that.
In that form i have a taxonomy field named product_category
I would have a post object field that loads the posts of selected product category.
How can achieve that?
Is there a filter that can help me?
Thank you.
I’ve noticed acf adds an empty key/value pair on groups as the first record.
As an example, here’s my group of groups for cities and regions of a particular country. The JSON is at the bottom.
This dump: var_dump(get_field( 'category_info', $custom_fields_selector )['featured_items']['cities']);
(which should have a 5 records)
Will return this:
array (size=6)
'' => null // Where does this come from?
'object_1' =>
array (size=4)
'select_object_type' => string 'category' (length=8)
'taxonomy' => int 112
'article' => boolean false
'article_anchor' => string '' (length=0)
'object_2' =>
array (size=4)
'select_object_type' => string 'category' (length=8)
'taxonomy' => int 92
'article' => boolean false
'article_anchor' => string '' (length=0)
'object_3' =>
array (size=4)
'select_object_type' => string 'category' (length=8)
'taxonomy' => int 43
'article' => boolean false
'article_anchor' => string '' (length=0)
'object_4' =>
array (size=4)
'select_object_type' => string 'post' (length=4)
'taxonomy' => boolean false
'article' => int 8491
'article_anchor' => string 'Costa Blanca' (length=12)
'object_5' =>
array (size=4)
'select_object_type' => string 'post' (length=4)
'taxonomy' => boolean false
'article' => int 6975
'article_anchor' => string 'Navarra' (length=7)
I have tried re-saving the category page, change values and creating new groups. All of which result in the same behaviour.
When I had this last week I thought it was because I named some fields as single digits (get_field( 'category_info', $custom_fields_selector )['featured_items']['cities']['1']['url']
for example), but after starting a new WP installation and database, the issue persists.
JSON:
{
"key": "field_6457b347dec09",
"label": "Uitgelichte regio's en steden",
"name": "featured_items",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b3ccdec0b",
"label": "Uitgelichte regio's",
"name": "regions",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_645d1d36b4c65",
"label": "Regio 1",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b437dec0c",
"label": "Regio 1",
"name": "object_1",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b453dec0d",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b4aadec0e",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b528dec0f",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b562dec10",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
},
{
"key": "field_645d1d49b4c66",
"label": "Regio 2",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b59cdec11",
"label": "Regio 2",
"name": "object_2",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b59cdec15",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b59cdec16",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b59cdec17",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b59cdec18",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
},
{
"key": "field_645d1d4ab4c67",
"label": "Regio 3",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b59ddec19",
"label": "Regio 3",
"name": "object_3",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b59ddec1d",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b59ddec1e",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b59ddec1f",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b59ddec20",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
},
{
"key": "field_645d1d4bb4c68",
"label": "Regio 4",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b5a0dec21",
"label": "Regio 4",
"name": "object_4",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b5a0dec25",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b5a0dec26",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b5a0dec27",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b5a0dec28",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
},
{
"key": "field_645d1d4cb4c69",
"label": "Regio 5",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b5a1dec29",
"label": "Regio 5",
"name": "object_5",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b5a1dec2d",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b5a1dec2e",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b5a1dec2f",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b5a1dec30",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
}
]
},
{
"key": "field_6457b5c1dec31",
"label": "Uitgelichte steden",
"name": "cities",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_645d1d97c410f",
"label": "Stad 1",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b5c1dec41",
"label": "Stad 1",
"name": "object_1",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b5c1dec42",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b5c1dec43",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b5c1dec44",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b5c2dec45",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
},
{
"key": "field_645d2e7dc4110",
"label": "Stad 2",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b5c2dec46",
"label": "Stad 2",
"name": "object_2",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b5c2dec47",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b5c2dec48",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b5c2dec49",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b5c2dec4a",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
},
{
"key": "field_645d2e7fc4111",
"label": "Stad 3",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b5c2dec4b",
"label": "Stad 3",
"name": "object_3",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b5c2dec4c",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b5c2dec4d",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b5c2dec4e",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b5c2dec4f",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
},
{
"key": "field_645d2e81c4112",
"label": "Stad 4",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b5c2dec50",
"label": "Stad 4",
"name": "object_4",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b5c2dec51",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b5c2dec52",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b5c2dec53",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b5c2dec54",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
},
{
"key": "field_645d2e82c4113",
"label": "Stad 5",
"name": "",
"aria-label": "",
"type": "tab",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"placement": "top",
"endpoint": 0
},
{
"key": "field_6457b5c2dec55",
"label": "Stad 5",
"name": "object_5",
"aria-label": "",
"type": "group",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"layout": "block",
"sub_fields": [
{
"key": "field_6457b5c2dec56",
"label": "Categorie of artikel",
"name": "select_object_type",
"aria-label": "",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"category": "Categoriepagina",
"post": "Artikel"
},
"default_value": false,
"return_format": "value",
"multiple": 0,
"allow_null": 1,
"ui": 0,
"ajax": 0,
"placeholder": ""
},
{
"key": "field_6457b5c2dec57",
"label": "Categorie",
"name": "taxonomy",
"aria-label": "",
"type": "taxonomy",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"taxonomy": "category",
"add_term": 0,
"save_terms": 0,
"load_terms": 0,
"return_format": "id",
"field_type": "select",
"allow_null": 1,
"multiple": 0
},
{
"key": "field_6457b5c2dec58",
"label": "Artikel",
"name": "article",
"aria-label": "",
"type": "post_object",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"post_type": [
"post"
],
"post_status": [
"publish"
],
"taxonomy": "",
"return_format": "id",
"multiple": 0,
"allow_null": 1,
"ui": 1
},
{
"key": "field_6457b5c2dec59",
"label": "Naam",
"name": "article_anchor",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
}
]
}
]
}
]
}
Dear ACF team,
I noticed that I have the option to select a horizontal layout for Checkbox fields, which is great. However what I found a little confusing is that the checkbox appearance option for the Taxonomy field does not have this option.
It’d be great to see the vertical vs horizontal option to all checkbox/radio type inputs.
Thanks so much,
Noëlle
Hi there,
Fantastic that ACF has added custom post type/taxnomy support, it’s really great so far. I have one question though. I have added some taxonomy columns to the admin, however I noticed they’re not sortable like the default Title column is. Am I missing a setting (I did not see this mentioned in the docs)? Or is this something that’s still in the works?
Many thanks,
Noëlle
I am not sure if this is a bug or wrong understanding of how fields should work.
In my case, I want to provide a way to include articles (post_type=’post’) and case studies (custom post_type=’case_study’) to specific pages of the website. So we can output these posts as “Related Items” at the bottom of the page.
I covered the field setup and all the logic by using “Post Object” field that should support 2 post_types = post & case_study.
The field appears in the wp editor but it suggests only articles of “post” type. “case_study” options are not there.
I tried to replace the “post” type with another custom post type and everything works properly. However when I bring “post” type back to the settings, it doesn’t work.
The issue is related to “Post Object” and “Relationship” fields. They simply don’t show posts of “case_study” when “post” is mentioned.
Here is how the field looks like:
`
array(
‘key’ => ‘field_646a1e151cb01’,
‘label’ => ‘case_studiess’,
‘name’ => ‘case_studiess’,
‘aria-label’ => ”,
‘type’ => ‘post_object’,
‘instructions’ => ”,
‘required’ => 0,
‘conditional_logic’ => 0,
‘wrapper’ => array(
‘width’ => ”,
‘class’ => ”,
‘id’ => ”,
),
‘post_type’ => array(
0 => ‘post’, // The problematic part is here. If I replace “post” with any other custom post type, everything works properly.
1 => ‘case_study’,
),
‘post_status’ => ”,
‘taxonomy’ => ”,
‘return_format’ => ‘id’,
‘multiple’ => 1,
‘translations’ => ‘copy_once’,
‘allow_null’ => 0,
‘ui’ => 1,
),
`
Any ideas what’s going wrong here?
Hello, I am using a taxonomy field in the front end (form) to give the user the possibility of a multiple selection.
The taxonomy is hierarchical and has a maximum of 1 child.
My question is – is it possible to allow the user to select only child elements – so no (parent 0) elements ?
And furthermore – is it possible to limit the possibility of multiple selection – e.g. to allow the user only 3 selections ?
Thanks for your help!
Please add a min/max Rule for Taxonomy Fields (select…) – so the Visitor eg. can select only between this two values. In Case the Taxonomy is a Post Tag with “create new” possibility, I want prevent the User create to much Tags. Best Thanks
I love the new Post Types function of ACF, i could stop use other plugins for it.
But the Taxonomies feature is little limited – even if you select e.g. Category taxonomy for a custom post type and you can then set this taxonomy for a post type, it does not mean the post does appear on the category page, unless you update wp_query, like this
add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if( is_category() ) {
$post_type = get_query_var('post_type');
if($post_type)
$post_type = $post_type;
else
$post_type = array('nav_menu_item', 'post', 'movies'); // don't forget nav_menu_item to allow menus to work!
$query->set('post_type',$post_type);
return $query;
}
}
It would be great if users could just allow it in the ACF Post Type admin
ACF provides an example that retrieves custom fields from a taxonomy and then displays it on an archive page such as category.php.
https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/#example
This approach doesn’t work for a single post. Does anyone have any advice on how to retrieve custom fields from a taxonomy and then display it on a single post?
I have a custom post type for cast and crew for a community theater site.
I have a select field with multiple choices based on roles (actor, dancer, director, etc.) – multiple roles are possible for each person.
I also need to be able to list all actors, dancers, etc. Normally I would use a taxonomy for this, but how can I have the select field assign this person to the matching taxonomy? Is this even possible at all in ACF?
I have 3 custom Post types, Organization, Role, Person.
I have 2 relationships set up
Organisation can have many roles.
People can have many roles.
Is there a way of adding people to an organization based on the relationship to a role?
Is it possible to allow guests (logged-out users) to create their own term in custom taxonomy when using the acf_form() which basically creates a new custom post?
The + icon is only visible to logged in users so far.
Hi there,
I want to ditch the Toolset plugin which I only use for CPT & Taxonomy registration. I’d like to migrate all my CPTs and Taxonomies to the new ACF Posts and Taxonomies.
Has anyone done this before? If so what are the steps I need to take?
Many thanks!
Hello.
I’m using ACF Pro to register my CPTs and taxonomy and I’m looking for a way to keep my CPT slug as part of a taxonomy URL. Example:
CPT: Articles
Taxonomy: Categories
CPT Archive URL: mydomain.com/articles
Current taxonomy URL: mydomain.com/categories
The URL that I’d like: mydomain.com/articles/categories
Any suggestions would be appreciated.
Thanks,
Kristin.