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
| [tw_contact_form] |
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 | |
| /** | |
| * Filters the size of thumbnail in Sell Media | |
| */ | |
| function sell_media_filter_thumbnail_size(){ | |
| return 'large'; | |
| } | |
| add_filter( 'sell_media_thumbnail', 'sell_media_filter_thumbnail_size' ); | |
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
| jQuery(document).ready(function($){ | |
| $('.filter').on('click', function(){ | |
| var cat = $(this).data('filter'); | |
| $('.item').each(function(){ | |
| if($(this).hasClass(cat)){ | |
| $(this).show().removeClass('hide').addClass('show'); | |
| } else { | |
| $(this).hide().removeClass('show').addClass('hide'); | |
| } | |
| }); |
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
| /** | |
| * Filter the post status of newly created Sell Media items | |
| * Applies only to Add Bulk and Add Package features | |
| * Useful if you don't want contributors to publish new items | |
| * Without first being approved | |
| */ | |
| function my_sell_media_post_status(){ | |
| if ( current_user_can( 'manage_options' ) ) { | |
| return 'publish'; | |
| } else { |
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
| sellMediaCart.total = function(){ | |
| var total = 0; | |
| sellMediaCart.each(function (item) { | |
| total += item.total(); | |
| }); | |
| // take 10 off it qty is greater than or equal to 5 | |
| if ( sellMediaCart.quantity() >= 5 ){ | |
| total -= 10; |
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
| function my_search_filter( $query ) { | |
| if ( !$query->is_admin && $query->is_search ) { | |
| $query->set( 'post_type', array('post', 'page' ) ); | |
| } | |
| return $query; | |
| } | |
| add_filter( 'pre_get_posts', 'my_search_filter' ); |
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
| function my_set_add_to_cart_button() { | |
| global $wp_scripts; | |
| $data = $wp_scripts->get_data( 'sell_media', 'data' ); | |
| if( !is_array( $data ) ) { | |
| $data = json_decode( str_replace( 'var sell_media = ', '', substr( $data, 0, -1 ) ), true ); | |
| } | |
| $data['added_to_cart'] = 'New Add Cart Button Text'; | |
| $wp_scripts->add_data( 'sell_media', 'data', '' ); |
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' ) ) { |
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
| function my_sell_media_download_size_text(){ | |
| return 'Parameters'; | |
| } | |
| add_filter( 'sell_media_download_size_text', 'my_sell_media_download_size_text' ); |
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
| function my_sell_media_after_successful_payment( $payment_id ){ | |
| wp_mail( '[email protected]', 'New Sale!', 'A new payment was successfully recorded and I figured you might want to know.' ); | |
| } | |
| add_action( 'sell_media_after_successful_payment', 'my_sell_media_after_successful_payment' ); |