Closed florent-cdl closed 1 year ago
I'm not sure what would be causing this but I add fields to the category taxonomy on nearly every site I have and it works as intended with code very similar to yours.
<?php
namespace App\Fields;
use Log1x\AcfComposer\Field;
use StoutLogic\AcfBuilder\FieldsBuilder;
class Category extends Field
{
/**
* The field group.
*
* @return array
*/
public function fields()
{
$category = new FieldsBuilder('category', ['style' => 'seamless']);
$category
->setLocation('taxonomy', '==', 'category');
$category
->addText('example');
return $category->build();
}
}
Does it show up on the Edit screen?
no, not more in the edit screen. I tested your example but no field appears
it's ok now on a new class. I think the problem comes as I forgotten the first time to run the command "$ wp acorn vendor:publish --provider="Log1x\AcfComposer\Providers\AcfComposerServiceProvider" I created my class before that command, so I deleted my class, run the command recreate the class with the same name and ... problem :(
Sorry and thank you so much for your quickly answer.
It's ok now, I will change my class name as it will be problematic Best regards
So it makes me think of one thing : is there a clean process to delete a class field ?
I just delete the class file (and accompanying view if working with a Block).
Hi,
I've created a simple group field for the category taxonomy. Unfortunately nothing appear on the new category screen![SCR-20221022-qg0](https://user-images.githubusercontent.com/12874593/197353011-38eb1421-ad0b-4b68-bc39-1cd8ad958818.png)
My field class is however very simple
My configuration : wordpres 6.0.2 / ACF 6.0.3 last version for all modules (fresh install)
A test with : ->setLocation('post_type', '==', 'post'); is ok and field appear on post screen.
Thank you