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 childtheme_allow_pdf_files( $config ) { | |
$config['plupload']['filters']['extensions'] = 'jpg,jpeg,gif,png,pdf'; | |
return $config; | |
} | |
add_filter( 'appthemes_plupload_config', 'childtheme_allow_pdf_files', 10, 1 ); | |
add_filter( 'app_plupload_config', 'childtheme_allow_pdf_files', 10, 1 ); // legacy, pre CP 3.4 |
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
class MYCP_Buy_Featured extends APP_View { | |
function condition() { | |
return is_singular( APP_POST_TYPE ) && ! empty( $_GET['buy_featured'] ); | |
} | |
function template_redirect() { | |
appthemes_require_login( array( | |
'login_text' => __( 'You must first login to feature ad listing.', APP_TD ), | |
'login_register_text' => __( 'You must first login or <a href="%s">register</a> to feature ad listing.', APP_TD ) |
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 childtheme_add_unique_id( $post_id ) { | |
$post = get_post( $post_id ); | |
if ( $post->post_type != VA_LISTING_PTYPE ) { | |
return; | |
} | |
$id = get_post_meta( $post_id, 'va_id', true ); | |
if ( empty( $id ) ) { | |
$id = uniqid( rand( 10, 1000 ), false ); |
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 | |
add_action('init', 'tribe_allow_large_joins'); | |
function tribe_allow_large_joins(){ | |
global $wpdb; | |
$wpdb->query('SET SQL_BIG_SELECTS=1'); | |
} |
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 childtheme_ad_contact_do_not_use_user_data( $email, $post_id ) { | |
$email['from'] = get_option( 'admin_email' ); | |
$email['from_name'] = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); | |
return $email; | |
} | |
add_filter( 'cp_email_user_ad_contact', 'childtheme_ad_contact_do_not_use_user_data', 10, 2 ); |
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 childtheme_import_geo_coordinates_args( $args ) { | |
$args['custom_fields']['lat'] = 'lat'; | |
$args['custom_fields']['lng'] = 'lng'; | |
return $args; | |
} | |
add_filter( 'cp_csv_importer_args', 'childtheme_import_geo_coordinates_args', 10, 1 ); | |
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 childtheme_control_when_to_display_featured_slider( $featured ) { | |
if ( count( $featured->posts ) < 5 ) { | |
return false; | |
} | |
return $featured; | |
} | |
add_filter( 'cp_featured_slider_ads', 'childtheme_control_when_to_display_featured_slider' ); |
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 childtheme_no_emails( &$phpmailer ) { | |
// Empty out the values that may be set | |
$phpmailer->ClearAllRecipients(); | |
$phpmailer->ClearAttachments(); | |
$phpmailer->ClearCustomHeaders(); | |
$phpmailer->ClearReplyTos(); | |
} | |
add_action( 'phpmailer_init', 'childtheme_no_emails', 99, 1 ); |
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 childtheme_do_not_display_unreliable_coupons_in_slider( $args ) { | |
$args['post_status'] = 'publish'; | |
return $args; | |
} | |
add_filter( 'clpr_featured_slider_args', 'childtheme_do_not_display_unreliable_coupons_in_slider' ); |
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 childtheme_trust_template( $template ) { | |
global $wp_query; | |
if ( ! isset( $wp_query->query_vars['trust'] ) || ! is_singular() ) { | |
return $template; | |
} | |
if ( $trust_template = locate_template( 'trust-template.php' ) ) { | |
return $trust_template; | |
} else { |