WordPress.org

Make WordPress Core

Changeset 38112


Ignore:
Timestamp:
07/20/2016 07:32:26 AM (2 years ago)
Author:
DrewAPicture
Message:

Docs: Add missing class, method, and property DocBlocks for feed classes.

Covers:

  • WP_Feed_Cache
  • WP_Feed_Cache_Transient
  • WP_SimplePie_File
  • WP_SimplePie_Sanitize_KSES

Props ramiy, stevenkword.
Fixes #36295.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-feed.php

    r37518 r38112  
    44    require_once( ABSPATH . WPINC . '/class-simplepie.php' );
    55
     6/**
     7 * Core class used to implement a feed cache.
     8 *
     9 * @since 2.8.0
     10 *
     11 * @see SimplePie_Cache
     12 */
    613class WP_Feed_Cache extends SimplePie_Cache {
    7     /**
    8      * Create a new SimplePie_Cache object
    9      *
    10      * @static
     14
     15    /**
     16     * Creates a new SimplePie_Cache object.
     17     *
     18     * @since 2.8.0
    1119     * @access public
    1220     *
     
    2129}
    2230
     31/**
     32 * Core class used to implement feed cache transients.
     33 *
     34 * @since 2.8.0
     35 */
    2336class WP_Feed_Cache_Transient {
     37
     38    /**
     39     * Holds the transient name.
     40     *
     41     * @since 2.8.0
     42     * @access public
     43     * @var string
     44     */
    2445    public $name;
     46
     47    /**
     48     * Holds the transient mod name.
     49     *
     50     * @since 2.8.0
     51     * @access public
     52     * @var string
     53     */
    2554    public $mod_name;
    26     public $lifetime = 43200; //Default lifetime in cache of 12 hours
    27 
    28     /**
    29      * Class instantiator.
    30      *
     55
     56    /**
     57     * Holds the cache duration in seconds.
     58     *
     59     * Defaults to 43200 seconds (12 hours).
     60     *
     61     * @since 2.8.0
     62     * @access public
     63     * @var int
     64     */
     65    public $lifetime = 43200;
     66
     67    /**
     68     * Constructor.
     69     *
     70     * @since 2.8.0
     71     * @since 3.2.0 Updated to use a PHP5 constructor.
     72     * @access public
     73     *
    3174     * @param string $location  URL location (scheme is used to determine handler).
    3275     * @param string $filename  Unique identifier for cache object.
     
    5093
    5194    /**
     95     * Sets the transient.
     96     *
     97     * @since 2.8.0
    5298     * @access public
    5399     *
     
    66112
    67113    /**
    68      * @access public
     114     * Gets the transient.
     115     *
     116     * @since 2.8.0
     117     * @access public
     118     *
     119     * @return mixed Transient value.
    69120     */
    70121    public function load() {
     
    73124
    74125    /**
    75      * @access public
     126     * Gets mod transient.
     127     *
     128     * @since 2.8.0
     129     * @access public
     130     *
     131     * @return mixed Transient value.
    76132     */
    77133    public function mtime() {
     
    80136
    81137    /**
    82      * @access public
     138     * Sets mod transient.
     139     *
     140     * @since 2.8.0
     141     * @access public
     142     *
     143     * @return bool False if value was not set and true if value was set.
    83144     */
    84145    public function touch() {
     
    87148
    88149    /**
    89      * @access public
     150     * Deletes transients.
     151     *
     152     * @since 2.8.0
     153     * @access public
     154     *
     155     * @return true Always true.
    90156     */
    91157    public function unlink() {
     
    96162}
    97163
     164/**
     165 * Core class for fetching remote files and reading local files with SimplePie.
     166 *
     167 * @since 2.8.0
     168 *
     169 * @see SimplePie_File
     170 */
    98171class WP_SimplePie_File extends SimplePie_File {
    99172
     173    /**
     174     * Constructor.
     175     *
     176     * @since 2.8.0
     177     * @since 3.2.0 Updated to use a PHP5 constructor.
     178     * @access public
     179     *
     180     * @param string       $url             Remote file URL.
     181     * @param integer      $timeout         Optional. How long the connection should stay open in seconds.
     182     *                                      Default 10.
     183     * @param integer      $redirects       Optional. The number of allowed redirects. Default 5.
     184     * @param string|array $headers         Optional. Array or string of headers to send with the request.
     185     *                                      Default null.
     186     * @param string       $useragent       Optional. User-agent value sent. Default null.
     187     * @param boolean      $force_fsockopen Optional. Whether to force opening internet or unix domain socket
     188     *                                      connection or not. Default false.
     189     */
    100190    public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
    101191        $this->url = $url;
     
    137227
    138228/**
    139  * WordPress SimplePie Sanitization Class
    140  *
    141  * Extension of the SimplePie_Sanitize class to use KSES, because
    142  * we cannot universally count on DOMDocument being available
    143  *
    144  * @package WordPress
     229 * Core class used to implement SimpliePie feed sanitization.
     230 *
     231 * Extends the SimplePie_Sanitize class to use KSES, because
     232 * we cannot universally count on DOMDocument being available.
     233 *
    145234 * @since 3.5.0
     235 *
     236 * @see SimplePie_Sanitize
    146237 */
    147238class WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize {
     239
     240    /**
     241     * WordPress SimplePie sanitization using KSES.
     242     *
     243     * Sanitizes the incoming data, to ensure that it matches the type of data expected, using KSES.
     244     *
     245     * @since 3.5.0
     246     * @access public
     247     *
     248     * @param mixed   $data The data that needs to be sanitized.
     249     * @param integer $type The type of data that it's supposed to be.
     250     * @param string  $base Optional. The `xml:base` value to use when converting relative
     251     *                      URLs to absolute ones. Default empty.
     252     * @return mixed Sanitized data.
     253     */
    148254    public function sanitize( $data, $type, $base = '' ) {
    149255        $data = trim( $data );
Note: See TracChangeset for help on using the changeset viewer.