[wp-hackers] Inconsistency between the category edit form and the category add form

Gregory Cornelius gcorne at bu.edu
Thu Jan 28 14:12:39 UTC 2010


FWIW, I reported the same issue with tags:
http://core.trac.wordpress.org/ticket/11191

Use Case:
I have created a plugin that does two things: (1) allows slug for a term to
be managed, and (2) allows a landing page to specified that overrides the
wordpress-taxonomy page.  The use case for the second feature is not as
common as the first, essentially by sending the wordpress to an actual page,
there are more options for integrating other content with the listing of
posts in a given term.

The hooks to make it work are below.  Note: that that if you are simply
adding args to wp_insert_term and wp_update_term you just have to carefully
name your fields because $_POST is passed along.

//create the form elements
add_action('add_tag_form_fields', 'bu_taxonomy_term_fields', 1, 1);
add_action('edit_tag_form_fields', 'bu_taxonomy_term_fields', 1, 1);

//save the data
add_action('created_' . $tax->name, 'bu_term_saved', 1, 2);
add_action('edited_' . $tax->name, 'bu_term_saved', 1, 2);

Gregory

On 1/28/10 2:03 AM, "Andrew Nacin" <wp at andrewnacin.com> wrote:

>> 
>> In the former (in edit-category-form.php), there is an action hook
>> (edit_category_form_fields) that allows for the addition of extra fields to
>> the form.  These can then be handled by update_terms action hook in
>> update_term.  The edit_category_form_fields action, however, is not present
>> in the category add form (in categories.php).
>> 
> 
> This has been previously suggested. Please see
> http://core.trac.wordpress.org/ticket/11285 and comment there -- a core
> developer is looking for an example plugin to implement this.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list