Skip to content

Instantly share code, notes, and snippets.

@thadallender
Created April 10, 2014 21:59
Show Gist options
  • Select an option

  • Save thadallender/10427368 to your computer and use it in GitHub Desktop.

Select an option

Save thadallender/10427368 to your computer and use it in GitHub Desktop.
Modification to sell_media_load_template
/**
* Loads a template from a specified path
*
* @package Ajax
* @uses load_template()
* @since 0.1
*/
function sell_media_load_template() {
if ( file_exists( get_template_directory() . '/cart.php' ) ) {
$file_path = get_template_directory() . '/cart.php';
} else {
$file_path = SELL_MEDIA_PLUGIN_DIR . '/themes/cart.php';
}
load_template( $file_path );
die();
}
add_action( 'wp_ajax_nopriv_sell_media_load_template', 'sell_media_load_template' );
add_action( 'wp_ajax_sell_media_load_template', 'sell_media_load_template' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment