Skip to content

Commit

Permalink
Merge branch 'release/2.28.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
JiveDig committed Jun 21, 2023
2 parents fa9bd43 + e2c06e8 commit 714bd21
Show file tree
Hide file tree
Showing 29 changed files with 220 additions and 81 deletions.
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 2.28.2 (6/21/23)
* Added: Better compatibility when using core Post Content and Post Featured Image blocks.
* Added: [Developers] New `$mai_term` global variable for terms in the loop via Mai Term Grid block.
* Changed: Renamed Mai Design Pack to Mai Theme Pro.
* Changed: Added more side spacing to the default select field styling.
* Changed: Update dependencies.
* Fixed: Layout setting per-post not working correctly in some scenarios.
* Fixed: Entry images not filling container when showing left/right full.
* Fixed: Social icons alignment in editor was not working in some configurations.
* Fixed: Function does not exist error for a Genesis function in some edge-case scenarios.
* Fixed: Unexpected border showing on some entry images in Mai Chic.

## 2.28.1 (5/10/23)
* Fixed: Wrong ID being returned on front page for site layout in some scenarios.
* Fixed: Replace deprecated `get_page_by_title()` function.
Expand Down
2 changes: 1 addition & 1 deletion assets/css/advanced-custom-fields.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/blocks.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/editor.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/main.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/themes/chic.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 19 additions & 14 deletions assets/lang/mai-engine.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPL-2.0-or-later.
msgid ""
msgstr ""
"Project-Id-Version: Mai Engine 2.27.0\n"
"Project-Id-Version: Mai Engine 2.28.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mai-engine\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-04-13T16:04:35+00:00\n"
"POT-Creation-Date: 2023-06-21T15:01:02+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Domain: mai-engine\n"
Expand Down Expand Up @@ -115,7 +115,7 @@ msgstr ""
#: lib/admin/admin-menu.php:28
#: lib/admin/admin-menu.php:29
#: lib/functions/deprecated.php:289
#: lib/functions/utilities.php:1743
#: lib/functions/utilities.php:1755
msgid "Mai Theme"
msgstr ""

Expand Down Expand Up @@ -1189,7 +1189,7 @@ msgstr ""
#: lib/fields/grid-display.php:568
#: lib/functions/colors.php:256
#: lib/functions/customizer.php:464
#: lib/functions/utilities.php:1672
#: lib/functions/utilities.php:1684
msgid "Link"
msgstr ""

Expand Down Expand Up @@ -1298,7 +1298,7 @@ msgid "Page "
msgstr ""

#: lib/classes/class-mai-plugins.php:71
msgid "Mai Design Pack plugin is required."
msgid "Mai Theme Pro Plugin plugin is required."
msgstr ""

#: lib/classes/class-mai-plugins.php:90
Expand All @@ -1315,12 +1315,17 @@ msgstr ""

#. translators: %s is replaced with the linked theme name.
#: lib/classes/class-mai-plugins.php:152
msgid "The Mai Design Pack plugin provides everything you need to enhance your website once it's up and running on %s."
msgid "The Mai Theme Pro Bundle provides everything you need to enhance your website once it's up and running on %s."
msgstr ""

#. translators: %s is replaced with the linked plugin name.
#: lib/classes/class-mai-plugins.php:154
msgid "Learn more about pro plugins and the pattern library included with the %s."
msgid "Learn more about pro plugins and the pattern library included with the %s (%s)."
msgstr ""

#. translators: %s is replaced with the linked plugin name.
#: lib/classes/class-mai-plugins.php:154
msgid "formerly Mai Design Pack"
msgstr ""

#: lib/classes/class-mai-plugins.php:160
Expand Down Expand Up @@ -2096,7 +2101,7 @@ msgid "By checking this box, you allow Mai Engine to periodically check for Mai
msgstr ""

#: lib/customize/upsell.php:30
msgid "Mai Design Pack"
msgid "Mai Theme Pro Bundle"
msgstr ""

#: lib/customize/upsell.php:31
Expand Down Expand Up @@ -2970,27 +2975,27 @@ msgstr ""
msgid "Search..."
msgstr ""

#: lib/functions/utilities.php:1669
#: lib/functions/utilities.php:1681
msgid "Primary"
msgstr ""

#: lib/functions/utilities.php:1670
#: lib/functions/utilities.php:1682
msgid "Secondary"
msgstr ""

#: lib/functions/utilities.php:1671
#: lib/functions/utilities.php:1683
msgid "Outline"
msgstr ""

#: lib/functions/utilities.php:1740
#: lib/functions/utilities.php:1752
msgid "View available shortcodes from"
msgstr ""

#: lib/functions/utilities.php:1741
#: lib/functions/utilities.php:1753
msgid "Genesis"
msgstr ""

#: lib/functions/utilities.php:1742
#: lib/functions/utilities.php:1754
msgid "and"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion assets/scss/base/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ textarea {

select {
height: var(--select-height, calc(var(--font-size-md, 1em) * 2));
--input-padding: var(--select-padding, 0);
--input-padding: var(--select-padding, 0 var(--spacing-sm));

&[multiple] {
height: auto;
Expand Down
7 changes: 6 additions & 1 deletion assets/scss/components/blocks/_social-links.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.wp-block-social-links {
margin: 0;
--list-margin: 0;
--list-item-margin-bottom: 0;

&:not(.is-style-no-background) {
gap: var(--spacing-xxs);
}

&.is-style-no-background {

Expand Down
2 changes: 2 additions & 0 deletions assets/scss/components/entry/_entry-image.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
flex: var(--entry-image-link-flex, initial);
align-self: var(--entry-image-link-align, unset);
order: var(--entry-image-link-order, unset);
width: var(--entry-image-width, initial);
height: var(--entry-image-height, initial);
max-width: var(--entry-image-link-max-width, unset);
margin: var(--entry-image-link-margin, var(--entry-image-link-margin-top, 0) var(--entry-image-link-margin-right, 0) var(--entry-image-link-margin-bottom, var(--spacing-md)) var(--entry-image-link-margin-left, 0));
line-height: var(--entry-image-line-height, unset);
Expand Down
4 changes: 2 additions & 2 deletions assets/scss/plugins/advanced-custom-fields.scss
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@
display: flex;
}

.acf-block-panel .acf-block-fields div.acf-field[data-name="padding"] {
.acf-block-panel .acf-block-fields div.acf-field.acf-field-mai-icon-padding {
clear: both !important;
padding-top: 16px;
border-top: 1px solid #e2e4e7;
}

.acf-block-panel .acf-block-fields div.acf-field[data-name="padding"] .acf-input {
.acf-block-panel .acf-block-fields div.acf-field.acf-field-mai-icon-padding .acf-input {
max-width: calc(50% - 16px) !important;
}

Expand Down
9 changes: 6 additions & 3 deletions assets/scss/themes/chic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,15 @@ h6.has-background {
--entry-overlay-opacity: 0.1;
--entry-overlay-hover-color-start: var(--color-primary);
--entry-overlay-hover-color-end: var(--color-primary);
--entry-wrap-background: var(--color-white);
--entry-wrap-background: transparent;

.entry {
--entry-background: var(--color-background);
--entry-border: var(--border);
}

.entry-wrap {
padding: var(--spacing-md);
border: var(--border);

> * {
padding: var(--spacing-xs) var(--spacing-md);
Expand Down Expand Up @@ -170,4 +174,3 @@ h6.has-background {
text-align: center;
}
}

2 changes: 1 addition & 1 deletion lib/admin/admin-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function mai_render_admin_patterns_menu_page() {
echo '<p>';
// Mai Patterns description
/* translators: %1$s %2$s %3$s are replaced with the plugin names. */
printf( esc_html__( 'Create a website design just like the pros using pre-built patterns that provide the ability to add complex sections and layouts to your website. The %1$s is included with the %2$s and is included for our %3$s customers.', 'mai-engine' ), 'Mai Pattern Library', 'Mai Design Pack', 'Mai Solution' );
printf( esc_html__( 'Create a website design just like the pros using pre-built patterns that provide the ability to add complex sections and layouts to your website. The %1$s is included with the %2$s and is included for our %3$s customers.', 'mai-engine' ), 'Mai Pattern Library', 'Mai Theme Pro Plugin', 'Mai Solution' );
echo '</p>';
echo '<p>';
/* translators: %s is replaced with the theme name. */
Expand Down
95 changes: 95 additions & 0 deletions lib/blocks/in-the-loop.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php
/**
* Mai Engine.
*
* @package BizBudding\MaiEngine
* @link https://bizbudding.com
* @author BizBudding
* @copyright Copyright © 2020 BizBudding
* @license GPL-2.0-or-later
*/

// Prevent direct file access.
defined( 'ABSPATH' ) || die;

/**
* Fixes WP core blocks when used outside of the loop, often via a Content Area.
*
* @access private
*/
class Mai_Core_Blocks_In_The_Loop_Fix {
protected $in_the_loop = null;

/**
* Get it started.
*/
function __construct() {
$this->hooks();
}

/**
* Run the hooks.
*
* @return void
*/
function hooks() {
add_filter( 'pre_render_block', [ $this, 'set_in_the_loop' ], 10, 3 );
add_filter( 'render_block_core/post-content', [ $this, 'revert_in_the_loop' ], 10, 3 );
add_filter( 'render_block_core/post-featured-image', [ $this, 'revert_in_the_loop' ], 10, 3 );
}

/**
* Set `$wp_query->in_the_loop` to true any time the post-featured-image block is used.
* This stops the `render_block_core_post_featured_image()` and `render_block_core_post_content()` functions
* from using `the_post()`, which causes other issues like empty content, in Mai Theme.
*
* @param string|null $pre_render The pre-rendered content. Default null.
* @param array $parsed_block The block being rendered.
* @param WP_Block|null $parent_block If this is a nested block, a reference to the parent block.
*
* @return null|string
*/
function set_in_the_loop( $pre_render, $parsed_block, $parent_block ) {
if ( ! isset( $parsed_block['blockName'] ) ) {
return $pre_render;
}

if ( ! in_array( $parsed_block['blockName'], [ 'core/post-featured-image', 'core/post-content' ] ) ) {
return $pre_render;
}

global $wp_query;

if ( isset( $wp_query ) && ! in_the_loop() ) {
$this->in_the_loop = in_the_loop();
$wp_query->in_the_loop = true;
}

return $pre_render;
}

/**
* Revert `$wp_query->in_the_loop` to whatever its value was before `pre_render_block`.
*
* @param string $block_content The block content.
* @param array $block The full block, including name and attributes.
* @param WP_Block $instance The block instance.
* @return string
*/
function revert_in_the_loop( $block_content, $parsed_block, $wp_block ) {
if ( is_null( $this->in_the_loop ) ) {
return $block_content;
}

global $wp_query;

if ( isset( $wp_query ) ) {
$wp_query->in_the_loop = $this->in_the_loop;
}

return $block_content;
}
}

new Mai_Core_Blocks_In_The_Loop_Fix;
8 changes: 8 additions & 0 deletions lib/classes/class-mai-grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,19 @@ public function do_grid_entries() {
* @var WP_Term $term Term object.
*/
foreach ( $term_query->terms as $term ) {
// Set global variable for the term, since WP does not offer this by default.
global $mai_term;
$mai_term = $term;

mai_do_entry( $term, $this->args );

// Add this term to the existing term IDs.
self::$existing_term_ids[] = $term->term_id;
}

// Unset global var.
unset ( $GLOBALS['mai_term'] );

// Clear duplicate IDs.
self::$existing_term_ids = array_unique( self::$existing_term_ids );
}
Expand Down
18 changes: 9 additions & 9 deletions lib/classes/class-mai-plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function ajax() {
if ( $this->is_disabled( $slug ) ) {
wp_send_json_error(
[
'error' => esc_html__( 'Mai Design Pack plugin is required.', 'mai-engine' ),
'error' => esc_html__( 'Mai Theme Pro Plugin plugin is required.', 'mai-engine' ),
]
);

Expand Down Expand Up @@ -135,29 +135,29 @@ function page() {
$plugins_url = add_query_arg(
[
'utm_source' => 'engine',
'utm_medium' => 'mai-design-pack',
'utm_campaign' => 'mai-design-pack',
'utm_medium' => 'mai-theme-pro',
'utm_campaign' => 'mai-theme-pro',
],
'https://bizbudding.com/mai-design-pack/'
'https://bizbudding.com/mai-theme-pro/'
);
$theme_link = '<a target="_blank" rel="noopener" href="https://bizbudding.com/mai-theme/">Mai Theme</a>';
$plugins_link = sprintf( '<a target="_blank" rel="noopener" href="%s">Mai Design Pack</a>', $plugins_url );
$plugins_link = sprintf( '<a target="_blank" rel="noopener" href="%s">Mai Theme Pro Plugin</a>', $plugins_url );

echo '<div class="wrap">';
echo '<h1 class="wp-heading-inline">Mai Plugins</h1>';
printf( '<div class="mai-plugins-description%s">', class_exists( 'Mai_Design_Pack' ) ? ' has-design-pack' : '' );
echo '<div class="mai-plugins-content">';
printf( '<p>%s %s</p>',
/* translators: %s is replaced with the linked theme name. */
sprintf( esc_html__( 'The Mai Design Pack plugin provides everything you need to enhance your website once it\'s up and running on %s.', 'mai-engine' ), $theme_link ),
sprintf( esc_html__( 'The Mai Theme Pro Bundle provides everything you need to enhance your website once it\'s up and running on %s.', 'mai-engine' ), $theme_link ),
/* translators: %s is replaced with the linked plugin name. */
sprintf( esc_html__( 'Learn more about pro plugins and the pattern library included with the %s.', 'mai-engine' ), $plugins_link )
sprintf( esc_html__( 'Learn more about pro plugins and the pattern library included with the %s (%s).', 'mai-engine' ), $plugins_link, __( 'formerly Mai Design Pack', 'mai-engine' ) )
);
echo '</div>';

if ( ! class_exists( 'Mai_Design_Pack' ) ) {
echo '<div class="mai-plugins-cta">';
printf( '<p><a target="_blank" rel="noopener" href="%s" class="button button-primary">%s</a></p>', $plugins_url, sprintf( '%s Mai Design Pack', esc_html__( 'Get', 'mai-engine' ) ) );
printf( '<p><a target="_blank" rel="noopener" href="%s" class="button button-primary">%s</a></p>', $plugins_url, sprintf( '%s Mai Theme Pro', esc_html__( 'Get', 'mai-engine' ) ) );
printf( '<p><a target="_blank" rel="noopener" href="https://bizbudding.com/my-account/">%s →</a></p>', sprintf( 'BizBudding %s', esc_html__( 'Account', 'mai-engine' ) ) );
echo '</div>';
}
Expand Down Expand Up @@ -272,7 +272,7 @@ function get_install_button( $slug ) {
* @return string
*/
function get_button( $action, $class, $text, $slug ) {
$data_disabled = $this->is_disabled( $slug ) ? sprintf( ' data-disabled="Mai Design Pack %s."', esc_html__( 'required', 'mai-engine' ) ) : '';
$data_disabled = $this->is_disabled( $slug ) ? sprintf( ' data-disabled="Mai Theme Pro Plugin %s."', esc_html__( 'required', 'mai-engine' ) ) : '';
$disabled = $this->is_disabled( $slug ) ? ' disabled' : '';

return sprintf( '<button class="mai-plugin-%s button button-%s" data-action="%s" data-slug="%s"%s%s>%s</button>',
Expand Down
Loading

0 comments on commit 714bd21

Please sign in to comment.