Registration Forms Shortcodes

Below, you’ll find a detailed guide on how to add the Registration Forms Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Registration Forms Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Registration Forms Plugin and the shortcodes it provides:

Plugin Icon
Registration Forms – User Registration Forms, Invitation-Based Registrations, Front-end User Profile, Login Form & Content Restriction

"Registration Forms – User Registration Forms is a dynamic WordPress plugin. It facilitates invitation-based registrations, front-end user profiles, login forms, and content restriction."

★★★★✩ (214) Active Installs: 3000+ Tested with: 6.3.2 PHP Version: 5.6
Included Shortcodes:
  • [pieregister_for_wpb]
  • [pie_register_login]
  • [pie_register_profile]
  • [pie_register_forgot_password]
  • [pie_register_renew_account]
  • [pie_register_form]
  • [pie_user_profile_pic]

Registration Forms [pieregister_for_wpb] Shortcode

The Pie-Register shortcode is designed to render different forms based on the ‘form_id’ attribute. It checks if the WPBakery Page Builder is active and adds a ‘disabled’ fieldset to the form output. This shortcode can display the login form, forgot password form, or any other form by specifying its ID. The forms are wrapped in a ‘div’ for easy styling.

Shortcode: [pieregister_for_wpb]

Parameters

Here is a list of all possible pieregister_for_wpb shortcode parameters and attributes:

  • form_id – Determines the type of form to display
In the given shortcode, the ‘form_id’ parameter can take three possible values:
  • login_form – Displays the login form
  • forgot_password – Shows the forgot password form
  • id – If neither ‘login_form’ nor ‘forgot_password’ is specified, the ‘id’ of a specific form can be used to display that particular form

Examples and Usage

Basic example – A simple usage of the shortcode to display a login form.

[pieregister_for_wpb form_id="login_form" /]

Advanced examples

Utilizing the shortcode to display a custom registration form by referencing its form_id. The form will be rendered based on the form_id provided.

[pieregister_for_wpb form_id="custom_form_1" /]

Implementing the shortcode to display the forgot password form. This is useful in cases where you want to provide users the ability to reset their password from a specific page or post.

[pieregister_for_wpb form_id="forgot_password" /]

Applying the shortcode without any form_id. By default, it will render the registration form. This is useful when you want to provide a registration form on a page or post without specifying a custom form.

[pieregister_for_wpb /]

PHP Function Code

In case you have difficulties debugging what causing issues with [pieregister_for_wpb] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('pieregister_for_wpb',array($this,'shortcode_html'));

Shortcode PHP function:

                    function shortcode_html($atts, $content = null){
        $output = '';

        if ( $this->is_wpb_editor() ) {
            add_filter(
                'pie_register_frontend_output_before',
                function ( $registration_from_fields ) {
                    $registration_from_fields .= '<fieldset disabled>';
                    return $registration_from_fields;
                }
            );
            add_filter(
                'pie_register_frontend_output_after',
                function ( $registration_from_fields ) {
                    $registration_from_fields .= '</fieldset>';
                    return $registration_from_fields;
                }
            );
            add_filter(
                'pie_register_frontend_login_output_before',
                function ( $login_form_fields ) {
                    $login_form_fields .= '<fieldset disabled>';
                    return $login_form_fields;
                }
            );
            add_filter(
                'pie_register_frontend_login_output_after',
                function ( $login_form_fields ) {
                    $login_form_fields .= '</fieldset>';
                    return $login_form_fields;
                }
            );
            add_filter(
                'pie_register_forgot_pass_output_before',
                function ( $forgot_pass_fields ) {
                    $forgot_pass_fields .= '<fieldset disabled>';
                    return $forgot_pass_fields;
                }
            );
            add_filter(
                'pie_register_forgot_pass_output_after',
                function ( $forgot_pass_fields ) {
                    $forgot_pass_fields .= '</fieldset>';
                    return $forgot_pass_fields;
                }
            );
        }

        extract( shortcode_atts( array(
            'form_id'   =>  '',
        ), $atts ) );
 
        if($form_id == 'login_form'){
            $output = '<div>';
                $output .= do_shortcode("[pie_register_login]");
            $output .= '</div>';
        }else if($form_id == 'forgot_password'){
            $output = '<div>';
                $output .= do_shortcode("[pie_register_forgot_password]");
            $output .= '</div>';
        }else{
            $output = '<div>';
                $output .= do_shortcode("[pie_register_form id='".$form_id."']");
            $output .= '</div>';
        }

        return $output;
    }
                    

Code file location:

pie-register/pie-register/editors/wpbakery/wpbakery-pie-element.php

Registration Forms [pie_register_login] Shortcode

The Pie-Register Login shortcode is a powerful tool that generates a custom login form for your website. It provides a secure way for users to access their accounts. The shortcode includes functionalities such as SSL redirection, form preview, and account renewal. It also displays a message if the user is already logged in. It’s a comprehensive solution for user login needs.

Shortcode: [pie_register_login]

Examples and Usage

Basic example – A simple usage of the ‘pie_register_login’ shortcode to display the login form on a page or post.

[pie_register_login]

PHP Function Code

In case you have difficulties debugging what causing issues with [pie_register_login] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pie_register_login',  array($this,'showLoginForm') );

Shortcode PHP function:

                    function showLoginForm()
		{
			$this->piereg_ssl_template_redirect();
			global $errors,$pagenow;
			$option 		= $this->get_pr_global_options();

			//  For Form with Gutenberg or WPBakery Preview
			$this->is_pr_preview = ( (isset($_GET['context']) && $_GET['context'] == 'edit') || (isset($_GET['vc_editable']) && $_GET['vc_editable'] == 'true') ) ? true :  $this->is_pr_preview;
			
			if(isset($_GET['pr_renew_account']) && $_GET['pr_renew_account'] == true)
			{
				$this->pie_post_array['warning'] = (__("Please renew your account","pie-register"));
				if( file_exists(PIEREG_DIR_NAME . "/renew_account.php") )
					include_once("renew_account.php");
				
				$is_renew_after_auth = false;
				$user_array = array();
				
				if(isset($_GET['auth'], $_GET['auth_key']) && !empty($_GET['auth']) && !empty($_GET['auth_key']) )
				{
					$user_name = sanitize_text_field(urldecode($_GET['auth']));
					$auth_key = sanitize_text_field(urldecode($_GET['auth_key']));
					
					$user_name = sanitize_user(urldecode(base64_decode($user_name)));
					$user = get_user_by("login",$user_name);
					
					if(!empty($user))
					{
						$auth_key = sanitize_text_field($_GET['auth_key']);
						$auth_key_hash = get_user_meta($user->ID,"pr_renew_account_hash", true);
						if(!empty($auth_key_hash))
						{
							if(trim($auth_key) == trim($auth_key_hash))
							{
								$is_renew_after_auth = true;
								$user_array['username'] = $user->data->user_login;
								$user_array['email'] = $user->data->user_email;
							}
						}
					}
				}
				
				$PR_show_renew_account = PR_show_renew_account($is_renew_after_auth,$user_array);
				return $PR_show_renew_account;
			}
			else{
				if (is_user_logged_in() && !$this->is_pr_preview && !is_admin()) {											
					return apply_filters("pie_login_form_logged_in_msg",__("<p>You are already logged in.</p>","pie-register"));
				} 

				$this->set_pr_stats("login","view");
				if( file_exists(PIEREG_DIR_NAME . "/login_form.php") )
					include_once("login_form.php");
				$output = pieOutputLoginForm();
				return  $output;
			}
		}
                    

Code file location:

pie-register/pie-register/pie-register.php

Registration Forms [pie_register_profile] Shortcode

The Pie Register Profile shortcode is a powerful tool that enables user profile management. It allows users to view and edit their profiles if logged in. The PHP code associated with this shortcode validates user inputs, updates user data, and handles error messages. It also includes hooks and filters for customization. If the user isn’t logged in, the shortcode returns a message prompting them to log in. Overall, this shortcode enhances user experience by providing profile management functionality.

Shortcode: [pie_register_profile]

Examples and Usage

Basic example – Display the profile of the current logged-in user with the pie_register_profile shortcode.

[pie_register_profile /]

PHP Function Code

In case you have difficulties debugging what causing issues with [pie_register_profile] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pie_register_profile', array($this,'showProfile') );

Shortcode PHP function:

                    function showProfile()
		{
			$option = $this->get_pr_global_options();
			$this->piereg_ssl_template_redirect();
			global $current_user,$pie_success,$pie_error,$pie_error_msg,$pie_suucess_msg,$profile_updated;
			if ( is_user_logged_in() ){
				
				global $current_user;			
				wp_get_current_user();
				$form_id = get_user_meta($current_user->ID,"user_registered_form_id",true);
				if( isset($_GET['edit_user']) && $_GET['edit_user'] == "1" ){
					$form 		= new Edit_form($current_user,$form_id);
					if( isset($_POST['pie_submit_update'], $_POST['piereg_edit_profile_nonce']) && wp_verify_nonce($_POST['piereg_edit_profile_nonce'], 'piereg_wp_edit_profile_nonce') ) {
						$form->error = "";
						$errors = new WP_Error();
						$errors = $form->validateRegistration($errors);	
						if(sizeof($errors->errors) > 0) {
							foreach($errors->errors as $err)
							{
								$form->error .= $err[0] . "<br />";	
							}		  	
						}	
						else
						{
							$user_data = array('ID' => $current_user->ID);
							if(isset($_POST['url'])) {
								$user_data["user_url"] =  esc_url_raw($_POST['url']);	 
								$form->pie_success = 1;
							}
							 
							if($current_user->data->user_email != $_POST['e_mail']) {
								$user_data["user_email"] =  sanitize_email($_POST['e_mail']);
								$form->pie_success = 1;
							}
							if(isset($_POST['old_password']) && wp_check_password( $_POST['old_password'], $current_user->data->user_pass, $current_user->ID ) && $_POST['password'] != ''){

								if(isset($_POST['confirm_password'])){
									if($_POST['password'] == $_POST['confirm_password']){
										$user_data["user_pass"] =  trim($_POST['password']);
										$form->pie_success = 1;		
									}
								}else{
									$user_data["user_pass"] =  trim($_POST['password']);
									$form->pie_success = 1;
								}							
							}
							
							$this->pie_post_array	= $this->piereg_sanitize_post_data_escape( ( (isset($_POST) && !empty($_POST)) ? $_POST : array() ) );
							
							# newlyAddedHookFilter 
							do_action( 'piereg_update_profile_event', $current_user->ID, $form_id, $this->pie_post_array );
							
							$user =  get_userdata( $current_user->ID );

							$id = wp_update_user( $user_data );						
							// $form->UpdateUser();
							if ( $form->UpdateUser() == 1 )
							{
								$profile_updated = 1;
							}
							$this->send_admin_notifications($option,$user,$user->data->user_pass);
							do_action( 'piereg_after_update_profile_event' );
						}
								
					}
					$output = '';
					$output .= '<div class="piereg_container pieregWrapper">';	
					if($form->pie_success)
						$output .= '<div class="alert alert-success"><p class="piereg_message">'.$form->pie_success_msg.'</p></div>';
	
					elseif($form->error != "")
						$output .= '<div class="alert alert-danger"><p class="piereg_login_error">'.$form->error.'</p></div>';	

					if(isset($this->pie_post_array['success']) && $this->pie_post_array['success'] != "")
						$output .= '<p class="piereg_message">'.apply_filters('piereg_messages',__($this->pie_post_array['success'],"pie-register")).'</p>';
	
					if(isset($this->pie_post_array['error']) && $this->pie_post_array['error'] != "")
						$output .= '<p class="piereg_login_error">'.apply_filters('piereg_messages',__($this->pie_post_array['error'],"pie-register")).'</p>';
						
					if( isset($_GET['pr_msg'], $_GET['type']) && !empty($_GET['pr_msg']) && $_GET['type'] == "success" )
						$output .= '<p class="piereg_message">'.apply_filters('piereg_messages',sanitize_text_field(base64_decode($_GET['pr_msg']))).'</p>';
					elseif( isset($_GET['pr_msg'], $_GET['type']) && !empty($_GET['pr_msg']) && $_GET['type'] == "error" )
						$output .= '<p class="piereg_login_error">'.apply_filters('piereg_messages',sanitize_text_field(base64_decode($_GET['pr_msg']))).'</p>';
					
					if( file_exists(PIEREG_DIR_NAME."/edit_form.php") )
						require_once(PIEREG_DIR_NAME."/edit_form.php");
					
					$output.= pie_edit_userdata($form_id);
					$output .= '</div>';
					return $output;
				}
				else
				{
					$form_id = get_user_meta($current_user->ID,"user_registered_form_id",true);
					if( $form_id == "" ) {
						$form_free_id 	= $this->regFormForFreeVers();
						update_user_meta($current_user->ID, 'user_registered_form_id', $form_free_id);
						$form_id 		= $form_free_id;
					}
					
					$profile_front = new Profile_front($current_user,$form_id);
					// Newly added hook to make changes to the profile content
					$profile_form_data = apply_filters('piereg_after_profile_printed', __($profile_front->print_user_profile($form_id),'pie-register')); 
					return $profile_form_data;
				}
			}
			else
			{
				$notloggedinmsg = esc_html__('Please','pie-register').' <a class="linkStyle1" href="'.esc_url(wp_login_url()).'">'. esc_html__('login','pie-register').'</a> '.esc_html__('to see your profile','pie-register');
				
				$notloggedinmsg = apply_filters('piereg_profile_if_not_loggedin',$notloggedinmsg); # newlyAddedHookFilter
				
				return $notloggedinmsg;
			}	
		}
                    

Code file location:

pie-register/pie-register/pie-register.php

Registration Forms [pie_register_forgot_password] Shortcode

The Pie-Register shortcode is designed to display the ‘Forgot Password’ form on your site. The PHP function ‘showForgotPasswordForm’ is triggered when this shortcode is used. It first checks if the user is already logged in. If they are, a message is returned indicating this. If the user is not logged in, it will display the ‘Forgot Password’ form. It also includes a check for form preview mode, which is useful during site development.

Shortcode: [pie_register_forgot_password]

Examples and Usage

Basic example – A simple usage of the ‘pie_register_forgot_password’ shortcode to display the forgot password form on any page or post.

[pie_register_forgot_password /]

Advanced examples

Using the ‘pie_register_forgot_password’ shortcode with additional parameters to customize the form. Here, we are using ‘context’ and ‘vc_editable’ parameters. The ‘context’ parameter is used to check if the form is being previewed in the Gutenberg or WPBakery editor, and ‘vc_editable’ parameter is used to check if the form is editable in the WPBakery page builder.

[pie_register_forgot_password context="edit" vc_editable="true" /]

Note: The ‘context’ and ‘vc_editable’ parameters are not directly used in the shortcode but are checked in the PHP function ‘showForgotPasswordForm’ which is called by the shortcode. These parameters should be passed in the URL of the page where the form is being previewed or edited.

PHP Function Code

In case you have difficulties debugging what causing issues with [pie_register_forgot_password] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pie_register_forgot_password',  array($this,'showForgotPasswordForm') );

Shortcode PHP function:

                    function showForgotPasswordForm()
		{
			$this->piereg_ssl_template_redirect();
			global $errors;
			
			$option 		= get_option(OPTION_PIE_REGISTER);
			//  For Form with Gutenberg Or WPBakery Preview
			$this->is_pr_preview = ( (isset($_GET['context']) && $_GET['context'] == 'edit') || (isset($_GET['vc_editable']) && $_GET['vc_editable'] == 'true') ) ? true :  $this->is_pr_preview;

			if(!is_admin() && is_user_logged_in() && !$this->is_pr_preview)
			{
				return apply_filters("pie_forgot_form_logged_in_msg",__("<p>You are already logged in.</p>","pie-register"));
			}
			else
			{							
				$this->set_pr_stats("forgot","view");
				
				if( file_exists(PIEREG_DIR_NAME . "/forgot_password.php") )
					include_once("forgot_password.php");
				$output =  pieResetFormOutput();
				return $output;
			}
				
		}
                    

Code file location:

pie-register/pie-register/pie-register.php

Registration Forms [pie_register_renew_account] Shortcode

The Pie-Register plugin shortcode, ‘pie_register_renew_account’, enables users to renew their accounts. It redirects to an SSL secured page, checks if the ‘renew_account.php’ file exists, and includes it.

Shortcode: [pie_register_renew_account]

Examples and Usage

Basic example – A simple usage of the shortcode to renew the user account in the Pie Register plugin.

[pie_register_renew_account]

PHP Function Code

In case you have difficulties debugging what causing issues with [pie_register_renew_account] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pie_register_renew_account',  array($this,'show_renew_account') );

Shortcode PHP function:

                    function show_renew_account()
		{
			$this->piereg_ssl_template_redirect();
			if( file_exists(PIEREG_DIR_NAME . "/renew_account.php") )
				include_once("renew_account.php");
			
			$show_renew_account = PR_show_renew_account();
			return $show_renew_account;
		}
                    

Code file location:

pie-register/pie-register/pie-register.php

Registration Forms [pie_register_form] Shortcode

The Pie Register Form shortcode is a key feature of the Pie-Register plugin. It generates a registration form on the webpage. It allows customization of form attributes, such as ID, title, and description. The shortcode also includes conditions for form preview, ensuring only administrators can view it. It supports various page builders like Elementor, Gutenberg, and WPBakery for form preview. Furthermore, it validates the form ID and checks if the form is enabled or disabled by the admin. If the form is disabled or the shortcode is incorrect, it returns an error message.

Shortcode: [pie_register_form]

Parameters

Here is a list of all possible pie_register_form shortcode parameters and attributes:

  • id – Unique identifier for the registration form
  • title – Controls the display of the form title
  • description – Controls the display of the form description

Examples and Usage

Basic example – Display a registration form using the Pie Register shortcode. This example only uses the form ID as an attribute.

[pie_register_form id="1" /]

Advanced examples

Display a registration form with a specific title. The title attribute allows you to specify a custom title for your form.

[pie_register_form id="1" title="Custom Registration Form" /]

Display a registration form with a specific description. The description attribute allows you to add a custom description to your form.

[pie_register_form id="1" description="This is a custom registration form." /]

Display a registration form with a specific title and description. This example combines the usage of both the title and description attributes.

[pie_register_form id="1" title="Custom Registration Form" description="This is a custom registration form." /]

PHP Function Code

In case you have difficulties debugging what causing issues with [pie_register_form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pie_register_form',  array($this,'piereg_registration_form') );

Shortcode PHP function:

                    function piereg_registration_form($attributes="") {
			$this->piereg_ssl_template_redirect();
			
			$id 			= !empty($form_attr) && isset($form_attr['id']) ? $form_attr['id'] : 0;
			$title 			= !empty($form_attr) && isset($form_attr['title']) ? $form_attr['title'] : "true" ;
			$description 	= !empty($form_attr) && isset($form_attr['description']) ? $form_attr['description'] : "true" ;
			$is_preview 	= false;
			
			//// **** ONLY ADMINISTRATOR CAN VIEW FORM PREVIEW ELSE IT WILL SHOW PAGE CONTENT **** ////
			$show_preview_form 	= $this->check_if_role_admin();
			$elementor_preview  = isset($_GET['action']) && $_GET['action'] == 'elementor' ? true : false;
			//  For Form with Gutenberg Preview
			$gutenberg_preview  = isset($_GET['context']) && $_GET['context'] == 'edit' ? true : false;
			// For WPBakery Frontend Preview
			$WPBakery_preview  = isset($_GET['vc_editable']) && $_GET['vc_editable'] == 'true' ? true : false;

			if( (isset($_GET['pr_preview']) || $elementor_preview ) && $show_preview_form ){
				$is_preview 		= true;
				$prFormId 			= isset($_GET['prFormId']) ? intval(trim($_GET['prFormId'])) : '';
				$preview_form_id 	= 0;
				
				if(isset($_GET['prFormId']) && $prFormId > 0){
					$preview_form_id 	= $prFormId;
				}
				
			}
			
			$use_free_form 		= false;
			if( !is_array($attributes) ){
				$use_free_form = true;
			}
			
			if(is_array($attributes) || $is_preview || $use_free_form ){
				
				if( $use_free_form && !$is_preview )
				{
					$id = $this->regFormForFreeVers();
				}
				else {
					
					if(is_array($attributes)) extract($attributes);					
					
					if( $id != $this->regFormForFreeVers() ) {
						$id = false;
					}
					
				}
				
				if($is_preview && $preview_form_id > 0){
					$id = $preview_form_id;
				}
				
				if( intval($id) != 0 )
				{
					$check_form_in_db = get_option("piereg_form_fields_".((int)$id));
					if($check_form_in_db == false || trim($check_form_in_db) == "")
					{
						$id = false;
					}else{
						$check_form_in_db = get_option("piereg_form_field_option_".((int)$id));
						if( ($check_form_in_db['Status'] == "enable" && (!isset($check_form_in_db['IsDeleted']) || trim($check_form_in_db['IsDeleted']) != 1) ) || $is_preview){
							if (is_user_logged_in() && !is_admin() && !$is_preview && !$this->is_pr_preview && !$gutenberg_preview && !$WPBakery_preview ) {
								$global_options = $this->get_pr_global_options();
									
								return apply_filters("pie_reg_form_logged_in_msg",sprintf(__("<p>Already logged in, Click <a href='%s'>here</a> to edit profile.<p>","pie-register"),esc_url($this->get_page_uri($global_options["alternate_profilepage"],"edit_user=1")) ) );
							} 
							if(!$is_preview){
								$check_form_in_db['Views'] = ( intval($check_form_in_db['Views'])+1 );
								update_option("piereg_form_field_option_".((int)$id),$check_form_in_db);
								$this->set_pr_stats("register","view");
							}
							return $this->showForm($id,$title,$description);
						}else{
							return esc_html__("This form is disabled by the administrator.","pie-register");
						}
					}
				}else{
					$id = false;
				}
				
				if($id == false){
					$this->pr_error_log("Incorrect shortcode used.".($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__)));
					return esc_html__("Incorrect shortcode used.","pie-register");
				}
			}
			else{
				$this->pr_error_log("Incorrect shortcode used.".($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__)));
				return esc_html__("Incorrect shortcode used.","pie-register");
			}
			
		}
                    

Code file location:

pie-register/pie-register/pie-register.php

Registration Forms [pie_user_profile_pic] Shortcode

The Pie-Register shortcode is designed to display the user’s profile picture. It retrieves the current user’s ID and checks for a profile picture in the user meta table. If a custom profile picture is found, it is displayed. If not, the default avatar is used. The image is embedded within a div for easy styling. If the shortcode is used incorrectly, an error message is returned.

Shortcode: [pie_user_profile_pic]

Examples and Usage

Basic example – Display the current user’s profile picture.

[pie_user_profile_pic /]

Advanced examples

Unfortunately, the given shortcode does not accept any parameters or attributes. It works solely based on the logged-in user’s ID to fetch and display the user’s profile picture. Therefore, it’s not possible to provide advanced usage examples with various parameters or attributes for this shortcode.

However, if you want to customize the output of this shortcode, you would need to modify the PHP function piereg_user_profile_pic() in the Pie Register plugin. Please note that any changes you make to the plugin’s code will be overwritten when you update the plugin. To avoid this, you can create a child theme and override the function in your child theme’s functions.php file.

Please remember that modifying plugin or theme code requires a good understanding of PHP and WordPress development. If you’re not comfortable with this, it’s recommended to hire a professional developer or contact the plugin’s support for assistance.

PHP Function Code

In case you have difficulties debugging what causing issues with [pie_user_profile_pic] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pie_user_profile_pic',  array($this,'piereg_user_profile_pic') );

Shortcode PHP function:

                    function piereg_user_profile_pic(){
			$this->piereg_ssl_template_redirect();

			global $wpdb;
			$user_id = get_current_user_id();
			$data    = '';

			if($user_id){
				$sql_query = "SELECT * FROM {$wpdb->prefix}usermeta WHERE `meta_key` LIKE '%pie_profile_pic_%' AND `user_id`={$user_id}";

				$result = $wpdb->get_results($sql_query);

				if(isset($result[0]) && $result[0]->meta_value){
					$imgPath = $result[0]->meta_value;
				}else{
					$imgPath = get_avatar_url($user_id);
				}

				$data .= '<div class="show-profile-img">';
					$data .= '<div class="file-wrapper"><img src="'.esc_url($imgPath).'" alt="'.esc_attr__('User Profile Picture',"pie-register").'" />';
					$data .= '</div>';
				$data .= '</div>';

				return $data;
			}else{
				return esc_html__("Incorrect shortcode used.","pie-register");
				$this->pr_error_log("Incorrect shortcode used.".($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__)));
			}
		}
                    

Code file location:

pie-register/pie-register/pie-register.php

Conclusion

Now that you’ve learned how to embed the Registration Forms Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *