Created
April 10, 2014 21:59
-
-
Save thadallender/10427368 to your computer and use it in GitHub Desktop.
Modification to sell_media_load_template
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
| /** | |
| * 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