Edit File by line
/home/barbar84/www/wp-inclu...
File: class-wp-dependency.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Dependencies API: _WP_Dependency class
[2] Fix | Delete
*
[3] Fix | Delete
* @since 4.7.0
[4] Fix | Delete
*
[5] Fix | Delete
* @package WordPress
[6] Fix | Delete
* @subpackage Dependencies
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* Class _WP_Dependency
[11] Fix | Delete
*
[12] Fix | Delete
* Helper class to register a handle and associated data.
[13] Fix | Delete
*
[14] Fix | Delete
* @access private
[15] Fix | Delete
* @since 2.6.0
[16] Fix | Delete
*/
[17] Fix | Delete
class _WP_Dependency {
[18] Fix | Delete
/**
[19] Fix | Delete
* The handle name.
[20] Fix | Delete
*
[21] Fix | Delete
* @since 2.6.0
[22] Fix | Delete
* @var string
[23] Fix | Delete
*/
[24] Fix | Delete
public $handle;
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* The handle source.
[28] Fix | Delete
*
[29] Fix | Delete
* @since 2.6.0
[30] Fix | Delete
* @var string
[31] Fix | Delete
*/
[32] Fix | Delete
public $src;
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* An array of handle dependencies.
[36] Fix | Delete
*
[37] Fix | Delete
* @since 2.6.0
[38] Fix | Delete
* @var string[]
[39] Fix | Delete
*/
[40] Fix | Delete
public $deps = array();
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* The handle version.
[44] Fix | Delete
*
[45] Fix | Delete
* Used for cache-busting.
[46] Fix | Delete
*
[47] Fix | Delete
* @since 2.6.0
[48] Fix | Delete
* @var bool|string
[49] Fix | Delete
*/
[50] Fix | Delete
public $ver = false;
[51] Fix | Delete
[52] Fix | Delete
/**
[53] Fix | Delete
* Additional arguments for the handle.
[54] Fix | Delete
*
[55] Fix | Delete
* @since 2.6.0
[56] Fix | Delete
* @var array
[57] Fix | Delete
*/
[58] Fix | Delete
public $args = null; // Custom property, such as $in_footer or $media.
[59] Fix | Delete
[60] Fix | Delete
/**
[61] Fix | Delete
* Extra data to supply to the handle.
[62] Fix | Delete
*
[63] Fix | Delete
* @since 2.6.0
[64] Fix | Delete
* @var array
[65] Fix | Delete
*/
[66] Fix | Delete
public $extra = array();
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Translation textdomain set for this dependency.
[70] Fix | Delete
*
[71] Fix | Delete
* @since 5.0.0
[72] Fix | Delete
* @var string
[73] Fix | Delete
*/
[74] Fix | Delete
public $textdomain;
[75] Fix | Delete
[76] Fix | Delete
/**
[77] Fix | Delete
* Translation path set for this dependency.
[78] Fix | Delete
*
[79] Fix | Delete
* @since 5.0.0
[80] Fix | Delete
* @var string
[81] Fix | Delete
*/
[82] Fix | Delete
public $translations_path;
[83] Fix | Delete
[84] Fix | Delete
/**
[85] Fix | Delete
* Setup dependencies.
[86] Fix | Delete
*
[87] Fix | Delete
* @since 2.6.0
[88] Fix | Delete
* @since 5.3.0 Formalized the existing `...$args` parameter by adding it
[89] Fix | Delete
* to the function signature.
[90] Fix | Delete
*
[91] Fix | Delete
* @param mixed ...$args Dependency information.
[92] Fix | Delete
*/
[93] Fix | Delete
public function __construct( ...$args ) {
[94] Fix | Delete
list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = $args;
[95] Fix | Delete
if ( ! is_array( $this->deps ) ) {
[96] Fix | Delete
$this->deps = array();
[97] Fix | Delete
}
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
/**
[101] Fix | Delete
* Add handle data.
[102] Fix | Delete
*
[103] Fix | Delete
* @since 2.6.0
[104] Fix | Delete
*
[105] Fix | Delete
* @param string $name The data key to add.
[106] Fix | Delete
* @param mixed $data The data value to add.
[107] Fix | Delete
* @return bool False if not scalar, true otherwise.
[108] Fix | Delete
*/
[109] Fix | Delete
public function add_data( $name, $data ) {
[110] Fix | Delete
if ( ! is_scalar( $name ) ) {
[111] Fix | Delete
return false;
[112] Fix | Delete
}
[113] Fix | Delete
$this->extra[ $name ] = $data;
[114] Fix | Delete
return true;
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
/**
[118] Fix | Delete
* Sets the translation domain for this dependency.
[119] Fix | Delete
*
[120] Fix | Delete
* @since 5.0.0
[121] Fix | Delete
*
[122] Fix | Delete
* @param string $domain The translation textdomain.
[123] Fix | Delete
* @param string $path Optional. The full file path to the directory containing translation files.
[124] Fix | Delete
* @return bool False if $domain is not a string, true otherwise.
[125] Fix | Delete
*/
[126] Fix | Delete
public function set_translations( $domain, $path = null ) {
[127] Fix | Delete
if ( ! is_string( $domain ) ) {
[128] Fix | Delete
return false;
[129] Fix | Delete
}
[130] Fix | Delete
$this->textdomain = $domain;
[131] Fix | Delete
$this->translations_path = $path;
[132] Fix | Delete
return true;
[133] Fix | Delete
}
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function