Edit File by line
/home/barbar84/www/wp-inclu.../SimplePi...
File: Category.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* SimplePie
[2] Fix | Delete
*
[3] Fix | Delete
* A PHP-Based RSS and Atom Feed Framework.
[4] Fix | Delete
* Takes the hard work out of managing a complete RSS/Atom solution.
[5] Fix | Delete
*
[6] Fix | Delete
* Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
[7] Fix | Delete
* All rights reserved.
[8] Fix | Delete
*
[9] Fix | Delete
* Redistribution and use in source and binary forms, with or without modification, are
[10] Fix | Delete
* permitted provided that the following conditions are met:
[11] Fix | Delete
*
[12] Fix | Delete
* * Redistributions of source code must retain the above copyright notice, this list of
[13] Fix | Delete
* conditions and the following disclaimer.
[14] Fix | Delete
*
[15] Fix | Delete
* * Redistributions in binary form must reproduce the above copyright notice, this list
[16] Fix | Delete
* of conditions and the following disclaimer in the documentation and/or other materials
[17] Fix | Delete
* provided with the distribution.
[18] Fix | Delete
*
[19] Fix | Delete
* * Neither the name of the SimplePie Team nor the names of its contributors may be used
[20] Fix | Delete
* to endorse or promote products derived from this software without specific prior
[21] Fix | Delete
* written permission.
[22] Fix | Delete
*
[23] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
[24] Fix | Delete
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
[25] Fix | Delete
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
[26] Fix | Delete
* AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
[27] Fix | Delete
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
[28] Fix | Delete
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
[29] Fix | Delete
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
[30] Fix | Delete
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
[31] Fix | Delete
* POSSIBILITY OF SUCH DAMAGE.
[32] Fix | Delete
*
[33] Fix | Delete
* @package SimplePie
[34] Fix | Delete
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
[35] Fix | Delete
* @author Ryan Parman
[36] Fix | Delete
* @author Sam Sneddon
[37] Fix | Delete
* @author Ryan McCue
[38] Fix | Delete
* @link http://simplepie.org/ SimplePie
[39] Fix | Delete
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
[40] Fix | Delete
*/
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* Manages all category-related data
[44] Fix | Delete
*
[45] Fix | Delete
* Used by {@see SimplePie_Item::get_category()} and {@see SimplePie_Item::get_categories()}
[46] Fix | Delete
*
[47] Fix | Delete
* This class can be overloaded with {@see SimplePie::set_category_class()}
[48] Fix | Delete
*
[49] Fix | Delete
* @package SimplePie
[50] Fix | Delete
* @subpackage API
[51] Fix | Delete
*/
[52] Fix | Delete
class SimplePie_Category
[53] Fix | Delete
{
[54] Fix | Delete
/**
[55] Fix | Delete
* Category identifier
[56] Fix | Delete
*
[57] Fix | Delete
* @var string|null
[58] Fix | Delete
* @see get_term
[59] Fix | Delete
*/
[60] Fix | Delete
var $term;
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Categorization scheme identifier
[64] Fix | Delete
*
[65] Fix | Delete
* @var string|null
[66] Fix | Delete
* @see get_scheme()
[67] Fix | Delete
*/
[68] Fix | Delete
var $scheme;
[69] Fix | Delete
[70] Fix | Delete
/**
[71] Fix | Delete
* Human readable label
[72] Fix | Delete
*
[73] Fix | Delete
* @var string|null
[74] Fix | Delete
* @see get_label()
[75] Fix | Delete
*/
[76] Fix | Delete
var $label;
[77] Fix | Delete
[78] Fix | Delete
/**
[79] Fix | Delete
* Category type
[80] Fix | Delete
*
[81] Fix | Delete
* category for <category>
[82] Fix | Delete
* subject for <dc:subject>
[83] Fix | Delete
*
[84] Fix | Delete
* @var string|null
[85] Fix | Delete
* @see get_type()
[86] Fix | Delete
*/
[87] Fix | Delete
var $type;
[88] Fix | Delete
[89] Fix | Delete
/**
[90] Fix | Delete
* Constructor, used to input the data
[91] Fix | Delete
*
[92] Fix | Delete
* @param string|null $term
[93] Fix | Delete
* @param string|null $scheme
[94] Fix | Delete
* @param string|null $label
[95] Fix | Delete
* @param string|null $type
[96] Fix | Delete
*/
[97] Fix | Delete
public function __construct($term = null, $scheme = null, $label = null, $type = null)
[98] Fix | Delete
{
[99] Fix | Delete
$this->term = $term;
[100] Fix | Delete
$this->scheme = $scheme;
[101] Fix | Delete
$this->label = $label;
[102] Fix | Delete
$this->type = $type;
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
/**
[106] Fix | Delete
* String-ified version
[107] Fix | Delete
*
[108] Fix | Delete
* @return string
[109] Fix | Delete
*/
[110] Fix | Delete
public function __toString()
[111] Fix | Delete
{
[112] Fix | Delete
// There is no $this->data here
[113] Fix | Delete
return md5(serialize($this));
[114] Fix | Delete
}
[115] Fix | Delete
[116] Fix | Delete
/**
[117] Fix | Delete
* Get the category identifier
[118] Fix | Delete
*
[119] Fix | Delete
* @return string|null
[120] Fix | Delete
*/
[121] Fix | Delete
public function get_term()
[122] Fix | Delete
{
[123] Fix | Delete
return $this->term;
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
/**
[127] Fix | Delete
* Get the categorization scheme identifier
[128] Fix | Delete
*
[129] Fix | Delete
* @return string|null
[130] Fix | Delete
*/
[131] Fix | Delete
public function get_scheme()
[132] Fix | Delete
{
[133] Fix | Delete
return $this->scheme;
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
/**
[137] Fix | Delete
* Get the human readable label
[138] Fix | Delete
*
[139] Fix | Delete
* @param bool $strict
[140] Fix | Delete
* @return string|null
[141] Fix | Delete
*/
[142] Fix | Delete
public function get_label($strict = false)
[143] Fix | Delete
{
[144] Fix | Delete
if ($this->label === null && $strict !== true)
[145] Fix | Delete
{
[146] Fix | Delete
return $this->get_term();
[147] Fix | Delete
}
[148] Fix | Delete
return $this->label;
[149] Fix | Delete
}
[150] Fix | Delete
[151] Fix | Delete
/**
[152] Fix | Delete
* Get the category type
[153] Fix | Delete
*
[154] Fix | Delete
* @return string|null
[155] Fix | Delete
*/
[156] Fix | Delete
public function get_type()
[157] Fix | Delete
{
[158] Fix | Delete
return $this->type;
[159] Fix | Delete
}
[160] Fix | Delete
}
[161] Fix | Delete
[162] Fix | Delete
[163] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function