/** * Snippet Name: Gravity Forms Login User After Registration. */ remove_action(“gform_post_submission”, array(“GFUser”, “gf_create_user”)); add_action(“gform_after_submission”, array(“GFUser”, “gf_create_user”), 10, 2); add_action(“gform_user_registered”, “gforms_autologin”, 10, 4); function gforms_autologin($user_id, $config, $entry, $password) { $form = RGFormsModel::get_form_meta($entry[‘form_id’]); $user_login = apply_filters(“gform_username_{$form[‘id’]}”, apply_filters(‘gform_username’, GFUser::get_meta_value(‘username’, $config, $form, $entry),…Continue reading
function wpcode_snippet_replace_howdy( $wp_admin_bar ) { // Edit the line below to set what you want the admin bar to display intead of “Howdy,”. $new_howdy = ‘Welcome,’; $my_account = $wp_admin_bar->get_node( ‘my-account’ ); if ( ! isset( $my_account->title ) ) { return;…Continue reading
// Add custom page to display image list in the media menu function my_custom_image_list_page() { add_media_page( ‘Image List’, // Page title ‘Image List’, // Menu title ‘manage_options’, // Capability ‘image-list’, // Menu slug ‘my_custom_image_list_display’ // Function to display content );…Continue reading
function afficher_table_custom_paginee_direct() { global $wpdb; // Augmenter la limite de mémoire si possible ini_set(‘memory_limit’, ‘256M’); $lignes_par_page = 25; $page = isset($_POST[‘page_num’]) ? intval($_POST[‘page_num’]) : 1; $offset = ($page – 1) * $lignes_par_page; $recherche = isset($_POST[‘search’]) ? trim($_POST[‘search’]) : ”; $manufacturier_filtre…Continue reading
/** * Snippet Name: Change the WooCommerce variable product drop down place holder text */ add_filter( ‘woocommerce_dropdown_variation_attribute_options_args’, ‘change_dropdown_text_args’, 10 ); function change_dropdown_text_args( $args ) { $args[‘show_option_none’] = ‘Choose a size’; return $args; }Continue reading
/** * Snippet: Apply Coupon when a radio button is clicked on The Product Page * Author: https://profiles.wordpress.org/kishores * Url: https://upnrunn.com * Note: Please make sure to create the coupon in the WC Admin */ // Add radio button below…Continue reading
/** * Snippet Name: Exclude Product From Discount Coupons. */ add_filter( ‘woocommerce_coupon_is_valid_for_product’, ‘exclude_product_from_product_promotions’, 999, 4 ); function exclude_product_from_product_promotions( $valid, $product, $coupon, $values ) { // Product id here (i.e. 123) if ( 123 == $product->get_id() ) { $valid = false;…Continue reading