Category
- Source
wp-includes/SimplePie/src/Category.php:17
Manages all category-related data
Description
Used by \SimplePie\Item::get_category() and \SimplePie\Item::get_categories()
This class can be overloaded with \SimplePie\SimplePie::set_category_class()
Compatibility
- WordPress
- core
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Properties · 4
$termstring|nullpublic- Category identifier
$schemestring|nullpublic- Categorization scheme identifier
$labelstring|nullpublic- Human readable label
$typestring|nullpublic- Category type
Methods · 6
- __construct()Constructor, used to input the data
- __toString()String-ified version
- get_term()Get the category identifier
- get_scheme()Get the categorization scheme identifier
- get_label()Get the human readable label
- get_type()Get the category type
Source code
class Category{ /** * Category identifier * * @var string|null * @see get_term */ public $term; /** * Categorization scheme identifier * * @var string|null * @see get_scheme() */ public $scheme; /** * Human readable label * * @var string|null * @see get_label() */ public $label; /** * Category type * * category for <category> * subject for <dc:subject> * * @var string|null * @see get_type() */ public $type; /** * Constructor, used to input the data * * @param string|null $term * @param string|null $scheme * @param string|null $label * @param string|null $type */ public function __construct(?string $term = null, ?string $scheme = null, ?string $label = null, ?string $type = null) { $this->term = $term; $this->scheme = $scheme; $this->label = $label; $this->type = $type; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the category identifier * * @return string|null */ public function get_term() { return $this->term; } /** * Get the categorization scheme identifier * * @return string|null */ public function get_scheme()Changelog
Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/SimplePie/src/Category.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.