collapsibles = $collapsibles; } /** * Outputs the section content if any tab has been added. */ public function display_content() { if ( $this->has_sections() ) { printf( '
', esc_attr( 'wpseo-meta-section-' . $this->name ) ); echo '
'; add_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_forms' ] ); add_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_a11y' ] ); foreach ( $this->collapsibles as $collapsible ) { echo wp_kses_post( $collapsible->content() ); } remove_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_forms' ] ); remove_filter( 'wp_kses_allowed_html', [ 'WPSEO_Utils', 'extend_kses_post_with_a11y' ] ); echo '
'; } } /** * Checks whether the tab has any sections. * * @return bool Whether the tab has any sections */ protected function has_sections() { return ! empty( $this->collapsibles ); } }