From 3774e520ac8ad6df92682b9aeed759cc3dbac3a2 Mon Sep 17 00:00:00 2001 From: Florent Hernandez Date: Wed, 19 Jul 2023 13:52:24 +0200 Subject: [PATCH] Fix act_page notices (#1091) Fix notices when act_page is not defined --- classes/blocks/class-covers.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/blocks/class-covers.php b/classes/blocks/class-covers.php index f09de0629..9a5ef5571 100644 --- a/classes/blocks/class-covers.php +++ b/classes/blocks/class-covers.php @@ -206,11 +206,10 @@ public static function get_covers( $fields ): array { */ private static function filter_posts_for_act_pages( $fields ) { $tag_ids = $fields['tags'] ?? []; - $options = get_option( 'planet4_options' ); - $parent_act_id = $options['act_page']; + $parent_act_id = (int) planet4_get_option( 'act_page', -1 ); $layout = $fields['layout'] ?? self::GRID_LAYOUT; - if ( 0 !== absint( $parent_act_id ) ) { + if ( -1 !== $parent_act_id ) { $args = [ 'post_type' => 'page', 'post_status' => 'publish',