WP Aggregator Feed Limit

// Set custom number of posts for category feeds function custom_category_feed_limit($query) { if ($query->is_feed() && $query->is_category()) { $query->set(‘posts_per_rss’, 100); $query->set(‘nopaging’, true); } } add_action(‘pre_get_posts’, ‘custom_category_feed_limit’);Continue reading

How to Hide Zero Quantity Items in Dropdown Payment Field Notifications

/** * Hiding Zero Quantity Items in Email Notifications for Payment Fields * * @link https://wpforms.com/developers/how-to-hide-zero-quantity-items-in-dropdown-payment-field-notifications */ add_filter(‘wpforms_entry_email_data’, function ($fields, $entry, $form_data) { foreach ($fields as $field_id => $field) { // Adjust to handle ‘payment-single’, ‘payment-select’, or any other types…Continue reading

Modify WooCommerce Coupon Message

add_filter( ‘woocommerce_coupon_message’, ‘modify_woocommerce_coupon_message’, 10, 3 ); function modify_woocommerce_coupon_message( $msg, $msg_code, $coupon ) { if( $msg === __( ‘Coupon code applied successfully.’, ‘woocommerce’ ) ) { $msg = sprintf( __( “You are getting $%s discounts.”, “woocommerce” ), ‘‘ . $coupon->get_amount() .…Continue reading

MX · Add All Post Types to Dashboard “At a Glance”

// Updated 2024-07-29 if ( ! function_exists(‘mx_custom_glance_items’)) { function mx_custom_glance_items() { // Return a list of all saved post_type entries in the database global $wpdb; $post_types_result = $wpdb->get_results(” SELECT DISTINCT(post_type), COUNT(*) as count FROM {$wpdb->posts} GROUP BY post_type ORDER BY…Continue reading

LMS Extra Link in Dashboard Left Menu

add_filter(‘tutor_dashboard/nav_items’, ‘add_some_links_dashboard’); function add_some_links_dashboard($links){ $links[‘custom_link’] = [ “title” => __(‘My link Title’, ‘tutor’), “url” => “https://youtube.com”, “icon” => “tutor-icon-file-blank-page tutor-dashboard-menu-item-icon”, ]; return $links; }Continue reading

Gravity Forms Login User After Registration.

/** * 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