WordPress.org

Ready to get started?Download WordPress

Forums

Please move the edit_category_form hook (5 posts)

  1. smurkas
    Member
    Posted 5 years ago #

    Hello.

    I have been working alot with two plugins that relate to and affect categories in WordPress. However these plugins did not play nice with eachother at first and I decided to find out why.

    After alot of code reading I found that the reason they weren't working well together is because the edit_category_form-hook occurs AFTER the submit button for the edit/add category-forms and they both want to be BEFORE the submit button of course.

    I've hacked the plugins so that they work together now but I still think the placement of the hook is wrong. Anyone who wants to add a form field to the category form will most likely want to add it before the submit button, not after. Having to resort to either javascript or other hacks just to get your form field in the right place isn't very good.

    All that needs to be done is to move the hook to before the table is closed in edit-category-form.php and moving it up above the p-tag with the class submit in categories.php.

    If there's a special reason that the hook must be placed after the submit button there should be another hook for those who want to add form fields to the category forms.

    Kindly, Marcus.

  2. 4thfloor
    Member
    Posted 4 years ago #

    Actually I think you can use edit_category_form_fields to do as you are suggesting as opposed to edit_category_form. I really wish that there was more documentation on this though as I've been trying to add fields to the category form for each category but it's tough to find any info on it.

  3. Mark
    Member
    Posted 4 years ago #

    Yep, I can confirm that edit_category_form_fields places the stuff before the submit button.

  4. iron77
    Member
    Posted 4 years ago #

    agree

  5. mymoog
    Member
    Posted 4 years ago #

    Hi,

    edit_category_form_fields is only used in the edit-category-form.php file.

    The form that adds a category on the main categories page does not make any reference to edit_category_form_fields and just like the edit-category-form file, the edit_category_form action is after the submit button

    Is there any reason why there could not be an add_category_form_fields action added in the future? Or at least just call the edit_category_form_fields in categories.php.

    Would be nice anyway

Topic Closed

This topic has been closed to new replies.

About this Topic