wp/wp-includes/class-wp-dependency.php
changeset 21 48c4eec2b7e6
parent 16 a86126ab1dd4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    14  * Helper class to register a handle and associated data.
    14  * Helper class to register a handle and associated data.
    15  *
    15  *
    16  * @access private
    16  * @access private
    17  * @since 2.6.0
    17  * @since 2.6.0
    18  */
    18  */
       
    19 #[AllowDynamicProperties]
    19 class _WP_Dependency {
    20 class _WP_Dependency {
    20 	/**
    21 	/**
    21 	 * The handle name.
    22 	 * The handle name.
    22 	 *
    23 	 *
    23 	 * @since 2.6.0
    24 	 * @since 2.6.0
    26 	public $handle;
    27 	public $handle;
    27 
    28 
    28 	/**
    29 	/**
    29 	 * The handle source.
    30 	 * The handle source.
    30 	 *
    31 	 *
       
    32 	 * If source is set to false, the item is an alias of other items it depends on.
       
    33 	 *
    31 	 * @since 2.6.0
    34 	 * @since 2.6.0
    32 	 * @var string
    35 	 * @var string|false
    33 	 */
    36 	 */
    34 	public $src;
    37 	public $src;
    35 
    38 
    36 	/**
    39 	/**
    37 	 * An array of handle dependencies.
    40 	 * An array of handle dependencies.
   123 	 *
   126 	 *
   124 	 * @param string $domain The translation textdomain.
   127 	 * @param string $domain The translation textdomain.
   125 	 * @param string $path   Optional. The full file path to the directory containing translation files.
   128 	 * @param string $path   Optional. The full file path to the directory containing translation files.
   126 	 * @return bool False if $domain is not a string, true otherwise.
   129 	 * @return bool False if $domain is not a string, true otherwise.
   127 	 */
   130 	 */
   128 	public function set_translations( $domain, $path = null ) {
   131 	public function set_translations( $domain, $path = '' ) {
   129 		if ( ! is_string( $domain ) ) {
   132 		if ( ! is_string( $domain ) ) {
   130 			return false;
   133 			return false;
   131 		}
   134 		}
   132 		$this->textdomain        = $domain;
   135 		$this->textdomain        = $domain;
   133 		$this->translations_path = $path;
   136 		$this->translations_path = $path;