Themosis\Asset\Asset::getArgs PHP Method

getArgs() public method

If nothing is defined, return all properties.
public getArgs ( string $name = '' ) : array | string
$name string The argument name.
return array | string
    public function getArgs($name = '')
    {
        if (!empty($name) && array_key_exists($name, $this->args)) {
            return $this->args[$name];
        }
        return $this->args;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Register a 'style' asset.
  *
  * @param Asset $asset
  * @return void
  */
 protected function registerStyle(Asset $asset)
 {
     $args = $asset->getArgs();
     $media = is_string($args['mixed']) ? $args['mixed'] : 'all';
     $version = is_string($args['version']) ? $args['version'] : false;
     wp_enqueue_style($args['handle'], $args['path'], $args['deps'], $version, $media);
 }
All Usage Examples Of Themosis\Asset\Asset::getArgs