Make WordPress Core

Changeset 12941


Ignore:
Timestamp:
02/04/2010 10:51:58 AM (12 years ago)
Author:
dd32
Message:

Migrate Category Edit UI hooks, Standardise on custom-taxonomies hooks, add custom-fields for taxonomies UI hooks. See #11838, Fixes #11191

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-tag-form.php

    r12818 r12941  
    2020}
    2121
    22 do_action('edit_tag_form_pre', $tag); ?>
     22if ( 'category' == $taxonomy )
     23    do_action('edit_category_form_pre', $tag );
     24else
     25    do_action('edit_tag_form_pre', $tag);
     26do_action('edit_' . $taxonomy . '_form_pre', $tag, $taxonomy);  ?>
    2327
    2428<div class="wrap">
     
    5761            <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
    5862        </tr>
    59         <?php do_action('edit_tag_form_fields', $tag); ?>
     63        <?php
     64        if ( 'category' == $taxonomy )
     65            do_action('edit_category_form_fields', $tag);
     66        else
     67            do_action('edit_tag_form_fields', $tag);
     68        do_action('edit_' . $taxonomy . '_form_fields', $tag, $taxonomy);
     69        ?>
    6070    </table>
    6171<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Tag'); ?>" /></p>
    62 <?php do_action('edit_tag_form', $tag); ?>
     72<?php
     73if ( 'category' == $taxonomy )
     74    do_action('edit_category_form_', $tag);
     75else
     76    do_action('edit_tag_form_', $tag);
     77do_action('edit_' . $taxonomy . '_form', $tag, $taxonomy);
     78?>
    6379</form>
    6480</div>
  • trunk/wp-admin/edit-tags.php

    r12835 r12941  
    290290
    291291<?php if ( current_user_can($tax->edit_cap) ) {
    292     do_action('add_tag_form_pre', $taxonomy); ?>
     292    if ( 'category' == $taxonomy )
     293        do_action('add_category_form_pre', (object)array('parent' => 0) );
     294    else
     295        do_action('add_tag_form_pre', $taxonomy);
     296    do_action('add_' . $taxonomy . '_form_pre', $taxonomy);
     297?>
    293298
    294299<div class="form-wrap">
     
    324329</div>
    325330
     331<?php
     332if ( 'category' == $taxonomy )
     333    do_action('add_category_form_fields');
     334else
     335    do_action('add_tag_form_fields', $taxonomy);
     336do_action('add_' . $taxonomy . '_form_fields', $taxonomy);
     337?>
     338
    326339<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p>
    327 <?php do_action('add_tag_form', $taxonomy); ?>
     340<?php
     341if ( 'category' == $taxonomy )
     342    do_action('edit_category_form', (object)array('parent' => 0) );
     343else
     344    do_action('add_tag_form', $taxonomy);
     345do_action('add_' . $taxonomy . '_form', $taxonomy);
     346?>
    328347</form></div>
    329348<?php } ?>
Note: See TracChangeset for help on using the changeset viewer.