platesModule::TEMPLATE_CANVAS === $this->current_page_template ) { $allowed_core = []; } else { $allowed_core = [ 'header', 'footer' ]; } foreach ( $locations as $location => $settings ) { if ( ! empty( $settings['is_core'] ) && ! in_array( $location, $allowed_core, true ) ) { unset( $locations[ $location ] ); } } return $locations; } }