get_category_to_edit() WordPress Function

The get_category_to_edit() function is used to retrieve a category object by its ID. This function is useful for editing an existing category.

get_category_to_edit( int $id ) #

Get category object for given ID and ‘edit’ filter context.


Parameters

$id

(int)(Required)


Top ↑

Return

(object)


Top ↑

Source

File: wp-admin/includes/taxonomy.php

function get_category_to_edit( $id ) {
	$category = get_term( $id, 'category', OBJECT, 'edit' );
	_make_cat_compat( $category );
	return $category;
}


Top ↑

Changelog

Changelog
VersionDescription
2.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.