Skip to content

Commit

Permalink
Fix act_page notices (#1091)
Browse files Browse the repository at this point in the history
Fix notices when act_page is not defined
  • Loading branch information
lithrel authored Jul 19, 2023
1 parent 6d35446 commit 3774e52
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/blocks/class-covers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 3774e52

Please sign in to comment.