Last active
September 4, 2017 17:14
-
-
Save carasmo/895b99b6b3ccd37d4e24e18bfb550f47 to your computer and use it in GitHub Desktop.
Genesis Archive Description oEmbed Shortcode support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment