stSEO()->helpers->options->set( $target_option, [] ); return true; } return false; } } eturn bool */ protected function should_show_search_engines_discouraged_notification() { return $this->search_engines_are_discouraged() && $this->options_helper->get( 'ignore_search_engines_discouraged_notice', false ) === false; } /** * Remove the search engines discouraged notification if it exists. * * @return void */ protected function remove_search_engines_discouraged_notification_if_exists() { $this->notification_center->remove_notification_by_id( self::NOTIFICATION_ID ); } /** * Add the search engines discouraged notification if it does not exist yet. * * @return void */ protected function maybe_add_search_engines_discouraged_notification() { if ( ! $this->notification_center->get_notification_by_id( self::NOTIFICATION_ID ) ) { $notification = $this->notification(); $this->notification_helper->restore_notification( $notification ); $this->notification_center->add_notification( $notification ); } } /** * Checks whether search engines are discouraged from indexing the site. * * @return bool Whether search engines are discouraged from indexing the site. */ protected function search_engines_are_discouraged() { return (string) \get_option( 'blog_public' ) === '0'; } /** * Whether the search engines notice should be shown. * * @return bool */ protected function should_show_search_engines_discouraged_notice() { $pages_to_show_notice = [ 'index.php', 'plugins.php', 'update-core.php', ]; return ( $this->search_engines_are_discouraged() && $this->capability_helper->current_user_can( 'manage_options' ) && $this->options_helper->get( 'ignore_search_engines_discouraged_notice', false ) === false && ( $this->current_page_helper->is_yoast_seo_page() || \in_array( $this->current_page_helper->get_current_admin_page(), $pages_to_show_notice, true ) ) && $this->current_page_helper->get_current_yoast_seo_page() !== 'wpseo_dashboard' ); } /** * Show the search engines discouraged notice. * * @return void */ protected function show_search_engines_discouraged_notice() { \printf( '
%1$s
', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output from present() is considered safe. $this->presenter->present() ); } /** * Returns an instance of the notification. * * @return Yoast_Notification The notification to show. */ protected function notification() { return new Yoast_Notification( $this->presenter->present(), [ 'type' => Yoast_Notification::ERROR, 'id' => self::NOTIFICATION_ID, 'capabilities' => 'wpseo_manage_options', 'priority' => 1, ] ); } /** * Should restore the ignore option for the search engines discouraged notice. * * @return void */ public function restore_ignore_option() { if ( ! $this->search_engines_are_discouraged() ) { $this->options_helper->set( 'ignore_search_engines_discouraged_notice', false ); } } } $content = is_array( $context ) && isset( $context['content'] ) ? $context['content'] : ''; $content = '' === $content && $context instanceof \WP_Block_Template ? $context->content : $content; $content = '' === $content && $context instanceof \WP_Post ? $context->post_content : $content; return $content; } /** * Given a provided context, returns whether the context refers to header content. * * @param array|\WP_Post|\WP_Block_Template $context Where the block is embedded. * @param string $area The area to check against before inserting. * @since 8.5.0 * @return boolean */ protected function is_template_part_or_pattern( $context, $area ) { $is_pattern = is_array( $context ) && ( ( isset( $context['blockTypes'] ) && in_array( 'core/template-part/' . $area, $context['blockTypes'], true ) ) || ( isset( $context['categories'] ) && in_array( $area, $context['categories'], true ) ) ); $is_template_part = $context instanceof \WP_Block_Template && $area === $context->area; return ( $is_pattern || $is_template_part ); } /** * Given a provided context, returns whether the context refers to the target area and isn't marked as excluded. * * @param array|\WP_Post|\WP_Block_Template $context the context to check. * @param string $area The area to check against before inserting. * @since 8.5.0 * @return boolean */ protected function is_target_area( $context, $area ) { if ( $this->is_template_part_or_pattern( $context, $area ) && ! $this->pattern_is_excluded( $context ) ) { return true; } return false; } /** * Returns whether the pattern is excluded or not * * @since 8.5.0 * * @param array|\WP_Block_Template $context Where the block is embedded. * @return boolean */ protected function pattern_is_excluded( $context ) { /** * A list of pattern slugs to exclude from auto-insert (useful when there are patterns that have a very specific location for the block) * Note: The patterns that are currently excluded are the ones that don't work well with the mini-cart block or customer-account block. * * @since 8.5.0 */ $pattern_exclude_list = apply_filters( 'woocommerce_hooked_blocks_pattern_exclude_list', array_unique( array_merge( isset( $this->hooked_block_excluded_patterns ) ? $this->hooked_block_excluded_patterns : array(), array( 'twentytwentytwo/header-centered-logo', 'twentytwentytwo/header-stacked' ) ) ) ); $pattern_slug = is_array( $context ) && isset( $context['slug'] ) ? $context['slug'] : ''; if ( ! $pattern_slug ) { /** * Woo patterns have a slug property in $context, but core/theme patterns dont. * In that case, we fallback to the name property, as they're the same. */ $pattern_slug = is_array( $context ) && isset( $context['name'] ) ? $context['name'] : ''; } return in_array( $pattern_slug, $pattern_exclude_list, true ); } }
Fatal error: Trait "Automattic\WooCommerce\Blocks\Utils\BlockHooksTrait" not found in /htdocs/pianosmichiels.be/wp-content/plugins/woocommerce/src/Blocks/BlockTypes/CustomerAccount.php on line 11