| 1 |
<?php |
| 2 |
/** |
| 3 |
* Encode extra carousel container data. |
| 4 |
* |
| 5 |
* @package jetpack |
| 6 |
*/ |
| 7 |
|
| 8 |
// Using JSON_HEX_AMP avoids breakage due to `esc_attr()` refusing to double-encode. |
| 9 |
$extra = wp_json_encode( $this->get_container_extra_data(), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 10 |
?> |
| 11 |
<div |
| 12 |
class="tiled-gallery type-<?php echo esc_html( $this->type ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable ?> tiled-gallery-unresized" |
| 13 |
data-original-width="<?php echo esc_attr( Jetpack_Tiled_Gallery::get_content_width() ); ?>" |
| 14 |
<?php if ( isset( $extra ) ) : ?> |
| 15 |
data-carousel-extra='<?php echo esc_attr( $extra ); ?>' |
| 16 |
<?php endif; ?> |
| 17 |
itemscope itemtype="http://schema.org/ImageGallery" |
| 18 |
> |
| 19 |
<?php $this->template( "$this->type-layout", $context ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable ?> |
| 20 |
</div> |
| 21 |
|