diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php deleted file mode 100644 index 711121be1..000000000 --- a/wp-admin/edit-link-categories.php +++ /dev/null @@ -1,237 +0,0 @@ -%s category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) ); - - wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); - } - - $location = 'edit-link-categories.php'; - if ( $referer = wp_get_referer() ) { - if ( false !== strpos($referer, 'edit-link-categories.php') ) - $location = $referer; - } - - $location = add_query_arg('message', 6, $location); - wp_redirect($location); - exit(); - } -} elseif ( ! empty($_GET['_wp_http_referer']) ) { - wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); - exit; -} - -$title = __('Link Categories'); - -wp_enqueue_script('admin-categories'); -if ( current_user_can('manage_categories') ) - wp_enqueue_script('inline-edit-tax'); - -add_contextual_help($current_screen, '

' . __('You can create groups of links by using link categories. Link category names must be unique and link categories are separate from the categories you use for posts.') . '

' . - '

' . __('You can delete link categories, but that action does not delete the links within the category. Instead, it moves them to the default link category.') . '

' . - '

' . __('For more information:') . '

' . - '

' . __('Link Categories Documentation') . '

' . - '

' . __('Support Forums') . '

' -); - -require_once ('admin-header.php'); - -$messages[1] = __('Category added.'); -$messages[2] = __('Category deleted.'); -$messages[3] = __('Category updated.'); -$messages[4] = __('Category not added.'); -$messages[5] = __('Category not updated.'); -$messages[6] = __('Categories deleted.'); ?> - -
- -

' . __('Search results for “%s”') . '', esc_html( stripslashes($_GET['s']) ) ); ?> -

- - -

- - -
- -
-
- -
- -
-
-
-
- - add_query_arg( 'pagenum', '%#%' ), - 'format' => '', - 'prev_text' => __('«'), - 'next_text' => __('»'), - 'total' => ceil(wp_count_terms('link_category') / $catsperpage), - 'current' => $pagenum -)); - -if ( $page_links ) - echo "
$page_links
"; -?> - -
- - - -
- -
-
- -
- - - - - - - - - - - - - - - - $start, 'number' => $catsperpage, 'hide_empty' => 0); -if ( !empty( $_GET['s'] ) ) - $args['search'] = $_GET['s']; - -$categories = get_terms( 'link_category', $args ); -if ( $categories ) { - $output = ''; - foreach ( $categories as $category ) { - $output .= link_cat_row($category); - } - echo $output; - unset($category); -} - -?> - -
- -
-$page_links
"; -?> - -
- - -
- -
-
-
- - -
-

Note:
Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category %s.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?>

-
- - -
-
- -
-
- -parent = 0; do_action('add_link_category_form_pre', $category); ?> - -
-

-
-
- - - -
- - -
- -
- - -

-
- -
- - -

-
- -

- -
-
- - - -
-
- -
- - - - diff --git a/wp-admin/edit-link-category-form.php b/wp-admin/edit-link-category-form.php deleted file mode 100644 index 7e7c004c4..000000000 --- a/wp-admin/edit-link-category-form.php +++ /dev/null @@ -1,92 +0,0 @@ -' . __('Edit Link Category') . ''; - $submit_text = __('Update Category'); - $form = '
'; - $action = 'editedcat'; - $nonce_action = 'update-link-category_' . $cat_ID; - do_action('edit_link_category_form_pre', $category); -} else { - $heading = '

' . __('Add Link Category') . '

'; - $submit_text = __('Add Category'); - $form = ''; - $action = 'addcat'; - $nonce_action = 'add-link-category'; - do_action('add_link_category_form_pre', $category); -} - -/** - * @ignore - * @since 2.7 - * @internal Used to prevent errors in page when no category is being edited. - * - * @param object $category - */ -function _fill_empty_link_category(&$category) { - if ( ! isset( $category->name ) ) - $category->name = ''; - - if ( ! isset( $category->slug ) ) - $category->slug = ''; - - if ( ! isset( $category->description ) ) - $category->description = ''; -} - -_fill_empty_link_category($category); -?> - -
- - -
- - - - - - - - - - - - - - - - - - - - -

-

-
-

- - -
diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php index c219747d1..7dc2eae4e 100644 --- a/wp-admin/edit-tag-form.php +++ b/wp-admin/edit-tag-form.php @@ -16,10 +16,14 @@ if ( empty($tag_ID) ) { ?> return; } +// Back compat hooks if ( 'category' == $taxonomy ) do_action('edit_category_form_pre', $tag ); +elseif ( 'link_category' == $taxonomy ) + do_action('edit_link_category_form_pre', $tag ); else do_action('edit_tag_form_pre', $tag); + do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
@@ -61,18 +65,26 @@ do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>

diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 1bed21853..37fc73bb8 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -283,10 +283,14 @@ endif; } if ( current_user_can($tax->cap->edit_terms) ) { + // Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form if ( 'category' == $taxonomy ) - do_action('add_category_form_pre', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form + do_action('add_category_form_pre', (object)array('parent' => 0) ); + elseif ( 'link_category' == $taxonomy ) + do_action('add_link_category_form_pre', (object)array('parent' => 0) ); else - do_action('add_tag_form_pre', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories + do_action('add_tag_form_pre', $taxonomy); + do_action($taxonomy . '_pre_add_form', $taxonomy); ?> @@ -333,10 +337,14 @@ do_action($taxonomy . '_add_form_fields', $taxonomy); ?>

0) ); // Back compat hook. Deprecated in preference to $taxonomy_add_form + do_action('add_category_form', (object)array('parent' => 0) ); +elseif ( 'link_category' == $taxonomy ) + do_action('add_link_category_form', (object)array('parent' => 0) ); else - do_action('add_tag_form', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories + do_action('add_tag_form', $taxonomy); + do_action($taxonomy . '_add_form', $taxonomy); ?>
diff --git a/wp-admin/link-category.php b/wp-admin/link-category.php deleted file mode 100644 index caf73923e..000000000 --- a/wp-admin/link-category.php +++ /dev/null @@ -1,100 +0,0 @@ -%s category: this is the default one"), $cat_name)); - - wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); - - $location = 'edit-link-categories.php'; - if ( $referer = wp_get_original_referer() ) { - if ( false !== strpos($referer, 'edit-link-categories.php') ) - $location = $referer; - } - - $location = add_query_arg('message', 2, $location); - - wp_redirect($location); - exit; - -break; - -case 'edit': - $title = __('Edit Category'); - $parent_file = 'link-manager.php'; - $submenu_file = 'edit-link-categories.php'; - require_once ('admin-header.php'); - $cat_ID = (int) $_GET['cat_ID']; - $category = get_term_to_edit($cat_ID, 'link_category'); - include('./edit-link-category-form.php'); - include('./admin-footer.php'); - exit; -break; - -case 'editedcat': - $cat_ID = (int) $_POST['cat_ID']; - check_admin_referer('update-link-category_' . $cat_ID); - - if ( !current_user_can('manage_categories') ) - wp_die(__('Cheatin’ uh?')); - - $location = 'edit-link-categories.php'; - if ( $referer = wp_get_original_referer() ) { - if ( false !== strpos($referer, 'edit-link-categories.php') ) - $location = $referer; - } - - $update = wp_update_term($cat_ID, 'link_category', $_POST); - - if ( $update && !is_wp_error($update) ) - $location = add_query_arg('message', 3, $location); - else - $location = add_query_arg('message', 5, $location); - - wp_redirect($location); - exit; -break; -} - -?>