Skip to content

Instantly share code, notes, and snippets.

@aprakasa
Last active December 23, 2015 16:49
Show Gist options
  • Save aprakasa/6664473 to your computer and use it in GitHub Desktop.
Save aprakasa/6664473 to your computer and use it in GitHub Desktop.
<?php
add_action( 'init', 'ap_enable_autoembed_intro' );
/**
* Run shortcodes and enable autoembed at Genesis archive intro text.
*/
function ap_enable_autoembed_intro(){
/** Global $wp_embed */
global $wp_embed;
/** For Registered Taxonomy Archive Intro Text */
add_filter( 'genesis_term_intro_text_output', 'do_shortcode' );
add_filter( 'genesis_term_intro_text_output', array( $wp_embed, 'run_shortcode'), 8 );
add_filter( 'genesis_term_intro_text_output', array( $wp_embed, 'autoembed'), 8 );
/** For Author Archive Intro Text */
add_filter( 'genesis_author_intro_text_output', 'do_shortcode' );
add_filter( 'genesis_author_intro_text_output', array( $wp_embed, 'run_shortcode'), 8 );
add_filter( 'genesis_author_intro_text_output', array( $wp_embed, 'autoembed'), 8 );
/** For Registered Post Type Archive Intro Text */
add_filter( 'genesis_cpt_archive_intro_text_output', 'do_shortcode' );
add_filter( 'genesis_cpt_archive_intro_text_output', array( $wp_embed, 'run_shortcode'), 8 );
add_filter( 'genesis_cpt_archive_intro_text_output', array( $wp_embed, 'autoembed'), 8 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment