mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 14:35:07 +00:00
Hooks needed to allow alternate category admin inteface. Props alexkingorg. fixes #3408
git-svn-id: http://svn.automattic.com/wordpress/trunk@4595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5eb76b01df
commit
bff928f8b8
@ -716,12 +716,19 @@ function cat_rows( $parent = 0, $level = 0, $categories = 0 ) {
|
|||||||
$categories = get_categories( 'hide_empty=0' );
|
$categories = get_categories( 'hide_empty=0' );
|
||||||
|
|
||||||
if ( $categories ) {
|
if ( $categories ) {
|
||||||
|
ob_start();
|
||||||
foreach ( $categories as $category ) {
|
foreach ( $categories as $category ) {
|
||||||
if ( $category->category_parent == $parent) {
|
if ( $category->category_parent == $parent) {
|
||||||
echo "\t" . _cat_row( $category, $level );
|
echo "\t" . _cat_row( $category, $level );
|
||||||
cat_rows( $category->cat_ID, $level +1, $categories );
|
cat_rows( $category->cat_ID, $level +1, $categories );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$output = ob_get_contents();
|
||||||
|
ob_end_clean();
|
||||||
|
|
||||||
|
$output = apply_filters('cat_rows', $output);
|
||||||
|
|
||||||
|
echo $output;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,14 @@ if ( ! empty($cat_ID) ) {
|
|||||||
$form = '<form name="editcat" id="editcat" method="post" action="categories.php">';
|
$form = '<form name="editcat" id="editcat" method="post" action="categories.php">';
|
||||||
$action = 'editedcat';
|
$action = 'editedcat';
|
||||||
$nonce_action = 'update-category_' . $cat_ID;
|
$nonce_action = 'update-category_' . $cat_ID;
|
||||||
|
do_action('edit_category_form_pre', $category);
|
||||||
} else {
|
} else {
|
||||||
$heading = __('Add Category');
|
$heading = __('Add Category');
|
||||||
$submit_text = __('Add Category »');
|
$submit_text = __('Add Category »');
|
||||||
$form = '<form name="addcat" id="addcat" method="post" action="categories.php">';
|
$form = '<form name="addcat" id="addcat" method="post" action="categories.php">';
|
||||||
$action = 'addcat';
|
$action = 'addcat';
|
||||||
$nonce_action = 'add-category';
|
$nonce_action = 'add-category';
|
||||||
|
do_action('add_category_form_pre', $category);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user