Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

add conditional for detecting wide-align support declared through theme.json #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions class-block-unit-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ public function upgrade_completed( $upgrader_object, $options ) {
*/
public function content() {

$layout_settings = wp_get_global_settings(array( 'layout' ));
$content_size_in_theme_json = $layout_settings['contentSize'];

$content = '';

$content .= '
Expand Down Expand Up @@ -598,7 +601,7 @@ public function content() {
<!-- /wp:paragraph -->
';

if ( get_theme_support( 'align-wide' ) ) {
if ( get_theme_support( 'align-wide' ) || isset( $content_size_in_theme_json ) ) {
$content .= '
<!-- wp:pullquote {"align":"wide"} -->
<blockquote class="wp-block-pullquote alignwide">
Expand Down Expand Up @@ -666,7 +669,7 @@ public function content() {
<!-- /wp:image -->
';

if ( get_theme_support( 'align-wide' ) ) {
if ( get_theme_support( 'align-wide' ) || isset( $content_size_in_theme_json ) ) {
$content .= '
<!-- wp:heading {"level":3} -->
<h3>' . esc_html__( 'Wide aligned', '@@textdomain' ) . '</h3>
Expand Down Expand Up @@ -724,7 +727,7 @@ public function content() {
<!-- /wp:paragraph -->
';

if ( get_theme_support( 'align-wide' ) ) {
if ( get_theme_support( 'align-wide' ) || isset( $content_size_in_theme_json ) ) {
$content .= '
<!-- wp:heading {"level":3} -->
<h3>' . esc_html__( 'Wide aligned', '@@textdomain' ) . '</h3>
Expand Down Expand Up @@ -760,7 +763,7 @@ public function content() {

';

if ( get_theme_support( 'align-wide' ) ) {
if ( get_theme_support( 'align-wide' ) || isset( $content_size_in_theme_json ) ) {
$content .= '
<!-- wp:heading {"level":3} -->
<h3>' . esc_html__( 'Wide aligned', '@@textdomain' ) . '</h3>
Expand Down Expand Up @@ -1037,7 +1040,7 @@ public function content() {
<!-- /wp:gallery -->
';

if ( get_theme_support( 'align-wide' ) ) {
if ( get_theme_support( 'align-wide' ) || isset( $content_size_in_theme_json ) ) {
$content .= '
<!-- wp:heading {"level":2} -->
<h2>Wide aligned Gallery Blocks</h2>
Expand Down