diff --git a/CHANGES.md b/CHANGES.md index 369169b..65d7cfb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # Changelog +## 1.9.3 (11/27/23) +* Fixed: CCA's showing up on different post types than set in location settings. + ## 1.9.2 (11/27/23) * Changed: Updated the updater. * Changed: Updated character encoding function for PHP 8.2 compatibility. diff --git a/includes/functions.php b/includes/functions.php index 50a924f..fd50bcf 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -93,8 +93,8 @@ function maicca_do_single_cca( $args ) { // If not already including, check post types. // Using '*' is not currently an option. This is here for future use. - if ( ! $include && ! ( in_array( '*', $args['types'] ) || ! in_array( $post_type, $args['types'] ) ) ) { - return []; + if ( ! $include && ! ( in_array( '*', $args['types'] ) || in_array( $post_type, $args['types'] ) ) ) { + return; } // If not already including, and have keywords, check for them. @@ -272,8 +272,8 @@ function maicca_do_archive_cca( $args ) { // Bail if shop page and not showing here. // Using '*' is not currently an option. This is here for future use. if ( maicca_is_shop_archive() ) { - if ( ! $args['types'] && ( ! in_array( '*', $args['types'] ) || ! in_array( 'product', $args['types'] ) ) ) { - return []; + if ( ! $args['types'] && ! ( in_array( '*', $args['types'] ) || in_array( 'product', $args['types'] ) ) ) { + return; } } // Bail if not showing on this post type archive. @@ -282,8 +282,8 @@ function maicca_do_archive_cca( $args ) { $post_type = isset( $wp_query->query['post_type'] ) ? $wp_query->query['post_type'] : ''; - if ( ! $args['types'] && ( ! in_array( '*', $args['types'] ) || ! is_post_type_archive( $post_type ) ) ) { - return []; + if ( ! $args['types'] && ! ( in_array( '*', $args['types'] ) || is_post_type_archive( $post_type ) ) ) { + return; } } } diff --git a/mai-custom-content-areas.php b/mai-custom-content-areas.php index 623a7bb..94e9742 100644 --- a/mai-custom-content-areas.php +++ b/mai-custom-content-areas.php @@ -4,7 +4,7 @@ * Plugin Name: Mai Custom Content Areas * Plugin URI: https://bizbudding.com/mai-theme/plugins/mai-custom-content-areas/ * Description: Display content, calls to action, ads, etc. on posts, pages, and custom post types conditionally by category, tag, taxonomy, entry title, and more. - * Version: 1.9.2 + * Version: 1.9.3 * * Author: BizBudding * Author URI: https://bizbudding.com @@ -92,7 +92,7 @@ public function __wakeup() { private function setup_constants() { // Plugin version. if ( ! defined( 'MAI_CCA_VERSION' ) ) { - define( 'MAI_CCA_VERSION', '1.9.2' ); + define( 'MAI_CCA_VERSION', '1.9.3' ); } // Plugin Folder Path.