This file contains 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 | |
function ecpt_include_post_types_in_search($query) { | |
if(is_search()) { | |
$post_types = get_post_types(array('public' => true, 'exclude_from_search' => false), 'objects'); | |
$searchable_types = array(); | |
if($post_types) { | |
foreach( $post_types as $type) { | |
$searchable_types[] = $type->name; | |
} |
This file contains 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 edd_get_currencies() { | |
$currencies = apply_filters('edd_currencies', array( | |
'USD' => __('US Dollars ($)', 'edd'), | |
'EUR' => __('Euros (€)', 'edd'), | |
'GBP' => __('Pounds Sterling (£)', 'edd'), | |
'AUD' => __('Australian Dollars ($)', 'edd'), | |
'BRL' => __('Brazilian Real ($)', 'edd'), | |
'CAD' => __('Canadian Dollars ($)', 'edd'), | |
'CZK' => __('Czech Koruna', 'edd'), | |
'DKK' => __('Danish Krone', 'edd'), |
This file contains 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 | |
function edd_load_upload_filter() { | |
add_action('load-edit.php', 'edd_change_downloads_upload_dir'); | |
add_action('load-post.php', 'edd_change_downloads_upload_dir'); | |
} | |
add_action('admin_init', 'edd_load_upload_filter'); | |
function edd_change_downloads_upload_dir() { | |
$current_screen = get_current_screen(); |
This file contains 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 ecpt_meta_field_classes($classes) { | |
$meta_value = get_post_meta(get_the_ID(), 'ecpt_fieldname', true); | |
if($meta_value) { | |
$classes[] = $meta_value; | |
} | |
return $classes; | |
} | |
add_filter('post_class', 'ecpt_meta_field_classes'); |
This file contains 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 get_header(); ?> | |
<div id="main-content" class="row store-template"> | |
<div class="content clearfix"> | |
<?php | |
$current_page = get_query_var('paged'); | |
$per_page = get_option('posts_per_page'); | |
$offset = $current_page > 0 ? $per_page * ($current_page-1) : 0; | |
$product_args = array( | |
'post_type' => 'download', |
This file contains 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
<a href="<?php echo edd_get_checkout_uri(); ?>"> | |
Cart (<span class="header-cart edd-cart-quantity"><?php echo edd_get_cart_quantity(); ?></span>) | |
</a> |
This file contains 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 | |
function modify_edd_product_supports($supports) { | |
$supports[] = 'comments'; | |
return $supports; | |
} | |
add_filter('edd_download_supports', 'modify_edd_product_supports'); |
This file contains 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 | |
function set_download_labels($labels) { | |
$labels = array( | |
'name' => _x('Products', 'post type general name', 'your-domain'), | |
'singular_name' => _x('Product', 'post type singular name', 'your-domain'), | |
'add_new' => __('Add New', 'your-domain'), | |
'add_new_item' => __('Add New Product', 'your-domain'), | |
'edit_item' => __('Edit Product', 'your-domain'), | |
'new_item' => __('New Product', 'your-domain'), | |
'all_items' => __('All Products', 'your-domain'), |
This file contains 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 | |
echo date( get_option('date_format'), get_post_meta( $post->ID, 'ecpt_datefieldname', true) ); |
This file contains 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 | |
function edd_change_downloads_upload_dir() { | |
global $pagenow; | |
if ( ! empty( $_POST['post_id'] ) && ( 'async-upload.php' == $pagenow || 'media-upload.php' == $pagenow ) ) { | |
if ( 'download' == get_post_type( $_REQUEST['post_id'] ) ) { | |
$wp_upload_dir = wp_upload_dir(); | |
$upload_path = $wp_upload_dir['basedir'] . '/edd' . $wp_upload_dir['subdir']; | |
if (wp_mkdir_p($upload_path) && !file_exists($upload_path.'/.htaccess')) { |
OlderNewer