Support » Plugins » First plugin coding. Help Me Please :'(

  • Resolved Karbon8


    Hi all 🙂

    I have to create a plugin for my work and I’m already lose with all these hooks/functions and little thing that provide Plugin API 🙁

    For the moment I have to add some input in the Manage > Category menu so that I will able to add keywords under “Description”.

    I don’t really know if you can understand me (frenchie sux xD) so I made a screenshot of what I want:

    So I have to add 2 input here so that when someone create or modify category he can add keywords.

    I’ve tried to add one of those hooks:

    add_action('create_category', 'my_func');
    add_action('add_category', 'my_func');

    and then in the my_func() function to “echo” something but it looks like it doesn’t work 🙁

    Can someone help me please?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Try using the “edit_link_category_form” hook instead.

    But actually where do you find it? There’s nothing about that in the documentation (

    Hum, it seems like there’s a ‘edit_category_form’ but damn, I can’t understand such a thing -_-‘

    The documentation is not complete, so I found it by looking at the actual WordPress code.

    At the bottom of edit-link-category-form.php is where it makes the call to the ‘edit_link_category_form’ action.

    Edit: Whoops, I was looking at Link Categories. My bad. You are correct, use the ‘edit_category_form’ action hook.

    Does it meen that when there is something like this in core’s code:
    <?php do_action('edit_link_category_form', $category); ?>
    ‘edit_link_category_form’ is a action hook :/ ?

    Ok, actually it looks like it works: 😛

    Thanks man, cya for another question ^^

    Does it meen that when there is something like this in core’s code:
    <?php do_action(‘edit_link_category_form’, $category); ?>
    ‘edit_link_category_form’ is a action hook :/ ?

    Yes, that’s exactly what it means.

    Hey, back again with another question ^^

    I finally created my 2 new inputs in the Category Form and I can see them under the submit button ( ). But actually where does the 2 new datas go when the User will submit?

    According to the core code:

    <p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" />
    <?php do_action('edit_category_form', $category); ?>

    My 2 new data are a part of the form so they will be treated in the “categories.php”. But because it’s not a part of the default settings there is nothing about them in the categories.php file :/ Where can I catch them?

    I think I can create a new form with the help of Javascript and flip the hook so the final code will look like that:

    <p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" />
    <!-- Here was the hook but It will be placed under thanks to JS -->
    <form name="my_form" id="my_form_cat" method="post" action="my_plugin.php">

    And then I will be able to play with my form, but what about if User disable JS :S ? Is it a good solution?

    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.

    I unfortunately have NO IDEA how to submit those form fields to the database. >_<

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘First plugin coding. Help Me Please :'(’ is closed to new replies.