You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.3 KiB
80 lines
1.3 KiB
<?php |
|
/** |
|
* Class AMP_Base_Embed_Handler |
|
* |
|
* Used by some children. |
|
* |
|
* @package AMP |
|
*/ |
|
|
|
/** |
|
* Class AMP_Base_Embed_Handler |
|
*/ |
|
abstract class AMP_Base_Embed_Handler { |
|
/** |
|
* Default width. |
|
* |
|
* @var int |
|
*/ |
|
protected $DEFAULT_WIDTH = 600; |
|
|
|
/** |
|
* Default height. |
|
* |
|
* @var int |
|
*/ |
|
protected $DEFAULT_HEIGHT = 480; |
|
|
|
/** |
|
* Default arguments. |
|
* |
|
* @var array |
|
*/ |
|
protected $args = []; |
|
|
|
/** |
|
* Whether or not conversion was completed. |
|
* |
|
* @var boolean |
|
*/ |
|
protected $did_convert_elements = false; |
|
|
|
/** |
|
* Registers embed. |
|
*/ |
|
abstract public function register_embed(); |
|
|
|
/** |
|
* Unregisters embed. |
|
*/ |
|
abstract public function unregister_embed(); |
|
|
|
/** |
|
* Constructor. |
|
* |
|
* @param array $args Height and width for embed. |
|
*/ |
|
public function __construct( $args = [] ) { |
|
$this->args = wp_parse_args( |
|
$args, |
|
[ |
|
'width' => $this->DEFAULT_WIDTH, |
|
'height' => $this->DEFAULT_HEIGHT, |
|
] |
|
); |
|
} |
|
|
|
/** |
|
* Get mapping of AMP component names to AMP script URLs. |
|
* |
|
* This is normally no longer needed because the whitelist |
|
* sanitizer will automatically detect the need for them via |
|
* the spec. |
|
* |
|
* @see AMP_Tag_And_Attribute_Sanitizer::get_scripts() |
|
* @return array Scripts. |
|
*/ |
|
public function get_scripts() { |
|
return []; |
|
} |
|
}
|
|
|