-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Meta Boxes for Categories and Taxonomies #53
Comments
I quite don't get what you mean by category order custom taxonomy. Do you mean in the edit-tags.php page? |
Yes. |
I personally have never had a need to place a meta box in that page. Can you describe how it would be useful? Also a picture would be helpful that shows how it should look like. |
Well I´m working on a project currently and they want to add some icons to each category. I can add an icon via CSS with the ID of the category or slug, but it would be nice if they can adjust this icon by themselves when there is an update of the page for example or the icon. |
It doesn't have to be a meta box, does it, then? |
What would be the alternative instead of an image upload field? |
I don't understand the question. Instead of a meta box, not an image upload field, right? Just regular input fields would work. To be clear, you should post an image that shows how it should look like. |
Okay. Let me see if I can add that functionality. In the meantime, how should the framework save the data? Should it add a column in the term_taxonomy table? I guess not, because it's hard to restore the initial state once a column is added. So I guess storing the data in the options table would be realistic. In that case, the naming of the option keys and the option structure needs to be carefully decided. Imagine when you retrieve the saved data, and which one would you prefer? Or tell me if there is a better way.
Or
|
Storing the data in the option table is not quite intuitive, but as wordpress does not support such term meta functionality the only other way is to to add a new table to the database named termmeta similar to postmeta. But I´d be satisfied with your second solution. |
The branch now includes this feature: https://github.com/michaeluno/admin-page-framework/tree/v3/fields_in_taxonomy_page How to Use
e.g. new APF_TaxonomyField( 'apf_sample_taxonomy' ); When retrieving the saved options, do like the following: $iTermID = 8; // you need to determine your term id
$sFieldID = 'your_field_id';
$aOptions = get_option( 'APF_TaxonomyField' ); // the key is just an example, you should set your own key here
$vValue = isset( $aOptions[ $iTermID ][ $sFieldID ] ) ? $aOptions[ $iTermID ][ $sFieldID ] : null; The example of instantiating the extended class is included in the demo plugin. ( |
It's been functioning well so I'm closing the topic. |
Hi there,
maybe this is an idea for an enhancement to add some meta boxes/ custom fields to a category oder custom taxonomy?
The text was updated successfully, but these errors were encountered: