shalior
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Referral Code] mannually add referralsUse the snippet below. hopefully, it’s clear enough.
update_user_meta( $user_id, 'wrc_referrer_id', $referrer_user_id ); wp_referral_code_add_user_to_referrer_invite_list( $user_id, $referrer_user_id );
- This reply was modified 2 years, 6 months ago by shalior.
Forum: Reviews
In reply to: [WP Referral Code] usefulHappy to see it’s useful for you. Good lucks!
Forum: Plugins
In reply to: [WP Referral Code] how can i change username to name or last nameHello,
You’re welcome,
paste this snippet in your child theme’s functions.php file. this will show the user’s first name + last name.
hope it helpsadd_filter('wp_referral_code_invited_user_text' , function ($user_login, $user_id){ $user = get_userdata( $user_id ); if($user){ if (!empty( $user->first_name ) && !empty( $user->last_name)){ return esc_html($user->first_name . " " . $user->last_name); } } return $user_login; } , 10, 2);
Forum: Plugins
In reply to: [WP Referral Code] where do users get their referal codeNo Problem
if you’re changing footer.php file
try this:
<?php echo do_shortcode('[wp-referral-code var=”copy_ref_link”]'); ?>
Forum: Plugins
In reply to: [WP Referral Code] where do users get their referal codeNo problem.
For example, if you’re using WordPress block editor you can paste that in shortcode block. same story with elementor and other page builders.
Google
how to use shortcodes in wordpress
;Forum: Plugins
In reply to: [WP Referral Code] How do i use the action hooks?Hey
Example to use the hook:add_action( 'wp_referral_code_after_refer_submitted', function ($new_user_id, $referrer_user_id, $ref_code, $new_user_ref_code){ },10, 4 );
use it in functions.php of the child theme.
Forum: Plugins
In reply to: [WP Referral Code] where do users get their referal codeHey,
You need to use this shortcode, the logged-in user will be able to see/copy his link.[wp-referral-code var="copy_ref_link"]
Forum: Plugins
In reply to: [NSFW] [WP Referral Code] how to add referral person incomeI’m afraid there is no easy answer to this, you’ll have to add some custom code according to your need.
Forum: Plugins
In reply to: [WP Referral Code] Where does data getting saved to?It’s in the user metadata. and yes you can access/change those data like anything else in WP.
You’re welcome.
you can set your registration URL in settings. check the plugin screenshots.
or use this snippet like this:
add_filter('register_url', function ($url){ return site_url('lp-profile', 'login'); },20,1);
you can do some cool stuff in LearnPress with this plugin. like when someone referred 5 people they can enroll in a specific course. I’ll send you details if you ask.
good luck
Forum: Plugins
In reply to: [WP Referral Code] Add Referred by to WooCommerce order listNot tested but should work
function wprc_add_referred_by_col_header_woocommerce( $columns ) { $new_columns = array(); foreach ( $columns as $column_name => $column_info ) { $new_columns[ $column_name ] = $column_info; if ( 'order_total' === $column_name ) { $new_columns['order_profit'] = __( 'Referred By' ); } } return $new_columns; } add_filter( 'manage_edit-shop_order_columns', 'wprc_add_referred_by_col_header_woocommerce', 20 ); function wprc_fill_referred_by_col( $column ) { global $post; if ( 'invited_by' === $column ) { $order = wc_get_order( $post->ID ); $user_id = $order->get_customer_id(); $referrer_id = ( new WP_Refer_Code( $user_id ) )->get_referrer_id(); if ( empty( $referrer_id ) ) { echo ''; } $referrer_username = esc_html(get_userdata( $referrer_id )->user_login); if ( current_user_can( 'edit_user', $referrer_id ) ) { $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $referrer_id ) ) ); $edit = "<strong><a href=\"{$edit_link}\">{$referrer_username}</a></strong>"; } else { $edit = "<strong>{$referrer_username}</strong>"; } echo $edit; } } add_action( 'manage_shop_order_posts_custom_column', 'wprc_fill_referred_by_col' );
No problem. Well, I don’t like bugs.
Thanks again for reporting and rating the plugin.
Thank you for reporting. fixed, update to 1.3.1
Forum: Plugins
In reply to: [WP Referral Code] Compatibility with wooHi, You’re welcome.
It is possible, but it’s not one snippet simple solution.
In the near future, I’m going to integrate this plugin with WooCommerce for one of my own projects. I’m thinking about a points system. if that interests you stay tuned, I’ll update this thread with the news.
Forum: Plugins
In reply to: [WP Referral Code] Custom codeUpdate to version 1.3.0 ??