Add a color picker field in Formidable Forms

function frm_default_custom_scripts( $scripts ){ $scripts->add( ‘iris’, ‘/wp-admin/js/iris.min.js’, array( ‘jquery-ui-draggable’, ‘jquery-ui-slider’, ‘jquery-touch-punch’ ), ‘1.1.1’, 1 ); $scripts->add( ‘wp-color-picker’, “/wp-admin/js/color-picker.js”, array( ‘iris’ ), false, 1 ); $scripts->set_translations( ‘wp-color-picker’ ); $custom_css = ‘.frm-color-picker .button.wp-color-result{border-radius: var(–border-radius) !important}’ . ‘.frm-color-picker .wp-picker-container{position:relative}’ . ‘.frm-color-picker .wp-picker-clear, .frm-color-picker…Continue reading

Child Support Calculator

function child_support_calculator_shortcode() { // Enqueue the JavaScript wp_enqueue_script(‘child-support-calculator’, get_template_directory_uri() . ‘/path-to-your-js-folder/child-support-calculator.js’, array(‘jquery’), ‘1.0.0’, true); ob_start(); include get_template_directory() . ‘/path-to-your-html-folder/child-support-form.html’; return ob_get_clean(); } add_shortcode(‘child_support_calculator’, ‘child_support_calculator_shortcode’); Javascript document.addEventListener(“DOMContentLoaded”, function() { document.getElementById(“childSupportForm”).addEventListener(“submit”, function(event) { event.preventDefault(); const grossIncome = parseFloat(document.getElementById(“grossIncome”).value); let numChildren = parseInt(document.getElementById(“numChildren”).value);…Continue reading

MemberPress: Require Specific Coupon to Register

function mepr_only_with_coupon( $errors ) { $membership_id = 123; //Change this ID to your membership ID $coupons = array( ‘IMRECOMMENDED’, ‘DISCOUNTED’ ); //Change these titles to your coupon title(s) if( $_POST[‘mepr_product_id’] == $membership_id ) { if( !isset( $_POST[‘mepr_coupon_code’] ) || empty(…Continue reading

MemberPress: Require Coupon at Checkout

function mepr_must_fill_out_coupon_code( $errors ) { if( !isset($_POST[‘mepr_coupon_code’]) || empty($_POST[‘mepr_coupon_code’] ) ) { $errors[] = “You must fill out the Coupon code field before registering.”; } return $errors; } add_filter( ‘mepr-validate-signup’, ‘mepr_must_fill_out_coupon_code’, 11, 1 );Continue reading

Auto Vote 5 sao cho bài viết mới

function auto_vote_5_stars_on_publish($ID, $post) { if ($post->post_status === ‘publish’) { if (function_exists(‘kk_star_ratings_insert’)) { kk_star_ratings_insert(“5”, $ID); } } } add_action(‘publish_post’, ‘auto_vote_5_stars_on_publish’, 10, 2);Continue reading

MemberPress: Disable Admin Password Lost/Changed Email

function mepr_disable_admin_pw_changed_email( $recipients, $subject, $message, $headers ) { if( strpos( $subject, ‘Password Lost/Changed’ ) !== false ) { $recipients = array(); // no recipients } return $recipients; } add_filter( ‘mepr-wp-mail-recipients’, ‘mepr_disable_admin_pw_changed_email’, 11, 4 );Continue reading