Changeset 47733 for trunk/src/wp-includes/SimplePie/Category.php
- Timestamp:
- 05/01/2020 02:24:42 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/Category.php
r22798 r47733 6 6 * Takes the hard work out of managing a complete RSS/Atom solution. 7 7 * 8 * Copyright (c) 2004-201 2, Ryan Parman, GeoffreySneddon, Ryan McCue, and contributors8 * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors 9 9 * All rights reserved. 10 10 * … … 34 34 * 35 35 * @package SimplePie 36 * @version 1.3.1 37 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue 36 * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue 38 37 * @author Ryan Parman 39 * @author GeoffreySneddon38 * @author Sam Sneddon 40 39 * @author Ryan McCue 41 40 * @link http://simplepie.org/ SimplePie … … 58 57 * Category identifier 59 58 * 60 * @var string 59 * @var string|null 61 60 * @see get_term 62 61 */ … … 66 65 * Categorization scheme identifier 67 66 * 68 * @var string 67 * @var string|null 69 68 * @see get_scheme() 70 69 */ … … 74 73 * Human readable label 75 74 * 76 * @var string 75 * @var string|null 77 76 * @see get_label() 78 77 */ … … 80 79 81 80 /** 81 * Category type 82 * 83 * category for <category> 84 * subject for <dc:subject> 85 * 86 * @var string|null 87 * @see get_type() 88 */ 89 var $type; 90 91 /** 82 92 * Constructor, used to input the data 83 93 * 84 * @param string $term 85 * @param string $scheme 86 * @param string $label 94 * @param string|null $term 95 * @param string|null $scheme 96 * @param string|null $label 97 * @param string|null $type 87 98 */ 88 public function __construct($term = null, $scheme = null, $label = null )99 public function __construct($term = null, $scheme = null, $label = null, $type = null) 89 100 { 90 101 $this->term = $term; 91 102 $this->scheme = $scheme; 92 103 $this->label = $label; 104 $this->type = $type; 93 105 } 94 106 … … 111 123 public function get_term() 112 124 { 113 if ($this->term !== null) 114 { 115 return $this->term; 116 } 117 else 118 { 119 return null; 120 } 125 return $this->term; 121 126 } 122 127 … … 128 133 public function get_scheme() 129 134 { 130 if ($this->scheme !== null) 131 { 132 return $this->scheme; 133 } 134 else 135 { 136 return null; 137 } 135 return $this->scheme; 138 136 } 139 137 … … 141 139 * Get the human readable label 142 140 * 141 * @param bool $strict 143 142 * @return string|null 144 143 */ 145 public function get_label( )144 public function get_label($strict = false) 146 145 { 147 if ($this->label !== null) 148 { 149 return $this->label; 150 } 151 else 146 if ($this->label === null && $strict !== true) 152 147 { 153 148 return $this->get_term(); 154 149 } 150 return $this->label; 151 } 152 153 /** 154 * Get the category type 155 * 156 * @return string|null 157 */ 158 public function get_type() 159 { 160 return $this->type; 155 161 } 156 162 }
Note: See TracChangeset
for help on using the changeset viewer.