carasmo
9/4/2017 - 5:07 PM

Genesis Archive Description oEmbed Shortcode support

Genesis Archive Description oEmbed Shortcode support

<?php
//don't add again


add_action( 'genesis_before', 'your_prefix_embed_shortcode_archive_intro_text_support' );
/** 
 * Add oEmbed and Shortcode support Genesis archive description
 */
function your_prefix_embed_shortcode_archive_intro_text_support() {

	global $wp_embed;

	// Allow shortcodes and embeds on Genesis Archive Intro Text Tags and Categories
	if ( is_category() || is_tag() || is_tax() ) :
		
		add_filter( 'genesis_term_intro_text_output', array( $wp_embed, 'autoembed' ) );
		add_filter( 'genesis_term_intro_text_output', 'do_shortcode' );

	endif;
	
	// Allow shortcodes and embeds on CPT archive descriptions
	if ( is_post_type_archive() && genesis_has_post_type_archive_support() ) :
		
		add_filter( 'genesis_cpt_archive_intro_text_output', array( $wp_embed, 'autoembed') );
		add_filter( 'genesis_cpt_archive_intro_text_output', 'do_shortcode' );

	endif;

	// Allow shortcodes and embeds on Genesis Author Intro Text
	if ( is_author() ) :
		
		add_filter( 'genesis_author_intro_text_output', array( $wp_embed, 'autoembed') );
		add_filter( 'genesis_author_intro_text_output', 'do_shortcode' );

	endif;
		
}