WPSEO_Admin_Asset::__construct()publicYoast 1.0

Constructs an instance of the WPSEO_Admin_Asset class.

Метод класса: WPSEO_Admin_Asset{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WPSEO_Admin_Asset = new WPSEO_Admin_Asset();
$WPSEO_Admin_Asset->__construct( $args );
$args(массив) (обязательный)
The arguments for this asset.

Код WPSEO_Admin_Asset::__construct() Yoast 23.5

public function __construct( array $args ) {
	if ( ! isset( $args['name'] ) ) {
		throw new InvalidArgumentException( 'name is a required argument' );
	}

	if ( ! isset( $args['src'] ) ) {
		throw new InvalidArgumentException( 'src is a required argument' );
	}

	$args = array_merge( $this->defaults, $args );

	$this->name      = $args['name'];
	$this->src       = $args['src'];
	$this->deps      = $args['deps'];
	$this->version   = $args['version'];
	$this->media     = $args['media'];
	$this->in_footer = $args['in_footer'];
	$this->rtl       = $args['rtl'];
	$this->suffix    = $args['suffix'];
}