
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); } /* * The Events Calendar - Make code empty if it's 0 or Free */ add_filter ( 'tribe_get_cost', 'tribe_not_show_free', 10, 3 ); function tribe_not_show_free ( $cost, $post_id, $with_currency_symbol ) { if ( $cost == 0 || $cost == 'Free' ) { $cost = ''; } return $cost; } function ru_conditional_email_template( $search_replace, $sanitized_data ) { $member_message = 'Member luncheon: $30.00 payable in cash or cheque due on the day of luncheon.'; $non_member_message = 'Non-member luncheon: $50.00 payable in cash or cheque due on the day of luncheon; Special Offer: Non-members have your first lunch at the Member rate of $30.00.'; $search_replace['{conditional-message}'] = $non_member_message; if ( isset( $sanitized_data['are-you-a-memberf'] ) && $sanitized_data['are-you-a-memberf'] === 'Yes' ) { $search_replace['{conditional-message}'] = $member_message; } return $search_replace; } add_filter( 'rtec_email_templating', 'ru_conditional_email_template', 10, 2 ); /* add_filter('pre_wp_mail', 'wp_disable_emails'); function wp_disable_emails() { return false; } */ /* function add_captcha_to_pdb_form($content) { $captcha_html = '
'; return $content . $captcha_html; } add_filter('pdb-signup-form', 'add_captcha_to_pdb_form'); function validate_pdb_captcha($submitted_values) { $captcha = $_POST['g-recaptcha-response']; $secretKey = "6LdOhjIrAAAAALAzn1uZzQf4_SFGP63Q0ieopqEZ"; $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secretKey&response=$captcha"); $responseKeys = json_decode($response, true); if (!$responseKeys["success"]) { die("CAPTCHA validation failed. Please try again."); } } add_action('pdb-before_validate_signup', 'validate_pdb_captcha'); */ function generate_math_captcha() { $num1 = rand(1, 10); $num2 = rand(1, 10); $sum = $num1 + $num2; $_SESSION['math_captcha_answer'] = $sum; return "$num1 + $num2 = ?"; }