ignored_shortcodes = \apply_filters( 'embed_privacy_ignored_shortcodes', $this->ignored_shortcodes ); return $this->ignored_shortcodes; } /** * Display an Opt-out shortcode. * * @param array|string $attributes Shortcode attributes * @return string The shortcode output */ public static function opt_out( $attributes ) { $attributes = \shortcode_atts( [ 'headline' => \__( 'Embed providers', 'embed-privacy' ), 'show_all' => 0, 'subline' => \__( 'Enable or disable embed providers globally. By enabling a provider, its embedded content will be displayed directly on every page without asking you anymore.', 'embed-privacy' ), ], $attributes ); $cookie = Embed_Privacy::get_instance()->get_cookie(); $embed_providers = Providers::get_instance()->get_list(); $enabled_providers = \array_keys( (array) $cookie ); if ( empty( $embed_providers ) ) { return ''; } $headline = '
' . \esc_html( $attributes['subline'] ) . '
' . \PHP_EOL, $attributes ); $output = '' . \PHP_EOL; return $output; } /** * Print Embed Privacy assets if page contains the shortcode. * * @since 1.11.1 * * @param string $content Current page content * @return string Current page content */ public function print_assets_for_shortcode( $content ) { if ( \has_shortcode( $content, 'embed_privacy_opt_out' ) ) { Embed_Privacy::get_instance()->frontend->print_assets(); } return $content; } }