Skip to content

Commit

Permalink
Merge branch 'release/1.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
JiveDig committed Jan 3, 2024
2 parents 0c556ce + 9eb18dc commit 3bbdced
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.4.1 (1/3/24)
* Fixed: Only load choices in the archive page editor. Fixes error when it trying to load fields on other screens.

## 1.4.0 (12/28/23)
* Added: Support for author archives and search results pages.
* Added: New setting to choose whether the content be inside the entries container or full width outside of the container.
Expand Down
16 changes: 13 additions & 3 deletions mai-archive-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Mai Archive Pages
* Plugin URI: https://bizbudding.com/mai-design-pack/
* Description: Build robust and SEO-friendly archive pages with blocks.
* Version: 1.4.0
* Version: 1.4.1
*
* Author: BizBudding
* Author URI: https://bizbudding.com
Expand Down Expand Up @@ -92,7 +92,7 @@ public function __wakeup() {
private function setup_constants() {
// Plugin version.
if ( ! defined( 'MAI_ARCHIVE_PAGES_PLUGIN_VERSION' ) ) {
define( 'MAI_ARCHIVE_PAGES_PLUGIN_VERSION', '1.4.0' );
define( 'MAI_ARCHIVE_PAGES_PLUGIN_VERSION', '1.4.1' );
}

// Plugin Folder Path.
Expand Down Expand Up @@ -286,7 +286,17 @@ function load_location_choices( $field ) {
return $field;
}

global $post;
global $pagenow, $post;

// Bail if not the editor.
if ( ! ( in_array( $pagenow, [ 'post-new.php', 'post.php' ], true ) && 'mai_archive_page' === get_post_type() ) ) {
return $field;
}

// Bail if no post.
if ( ! ( $post && isset( $post->post_name ) ) ) {
return $field;
}

$after = str_contains( $post->post_name, '_after_' );
$before = ! $after;
Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '2f744dd8d2a5c3c7ec5e7aee19ca01a8b1e9ace7',
'reference' => '842e42a4374d65160d75ce2bf4c2349e3ea20dd2',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '2f744dd8d2a5c3c7ec5e7aee19ca01a8b1e9ace7',
'reference' => '842e42a4374d65160d75ce2bf4c2349e3ea20dd2',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down

0 comments on commit 3bbdced

Please sign in to comment.