Zero Bs Crm Shortcodes

Below, you’ll find a detailed guide on how to add the Zero Bs Crm 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 Zero Bs Crm Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Zero Bs Crm Plugin and the shortcodes it provides:

Plugin Icon
Jetpack CRM – Clients, Leads, Invoices, Billing, Email Marketing, & Automation

"Jetpack CRM is a comprehensive plugin for managing clients, leads, invoices, billing, and email marketing. It offers robust automation features, making it a one-stop solution for your business needs."

★★★★✩ (133) Active Installs: 40000+ Tested with: 6.3.2 PHP Version: 7.3
Included Shortcodes:
  • [jetpackcrm_form]
  • [jetpackcrm_unsubscribe]
  • [jetpackcrm_clientportal]

Zero Bs Crm [jetpackcrm_form] Shortcode

The Zero-BS-CRM shortcode is a function that embeds CRM forms into your website. It extracts attributes like ‘id’ and ‘style’ from the shortcode and uses them to build the form HTML. This shortcode ensures the necessary scripts are enqueued and exposes the PID, crucial for form processing. It returns an error message if no style is specified.

Shortcode: [jetpackcrm_form]

Parameters

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

  • id – Unique identifier of the contact form
  • style – Defines the appearance of the form, ‘simple’ by default

Examples and Usage

Basic example – A simple usage of the shortcode to display a CRM form with a specific ID and the default style.

[jetpackcrm_form id=1 /]

Advanced examples

Displaying a CRM form with a specific ID and a custom style. This allows you to customize the appearance of the form according to your website’s design.

[jetpackcrm_form id=1 style="custom" /]

In case you want to use the shortcode without specifying the form ID, the plugin will use the default form. You can still customize the style.

[jetpackcrm_form style="custom" /]

When no style is specified, the shortcode will use the ‘simple’ style as default. This is useful when you want to quickly add a form without worrying about its appearance.

[jetpackcrm_form id=1 /]

PHP Function Code

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

Shortcode line:

add_shortcode('jetpackcrm_form','zeroBSCRM_forms_shortcode');

Shortcode PHP function:

function zeroBSCRM_forms_shortcode($atts){

	// retrieve attr
	extract( shortcode_atts( array(
		'id' => 'true',
		'style' => 'simple'
	), $atts ) );

	// force enquement
	zeroBSCRM_forms_enqueuements();
	zeroBSCRM_exposePID();

	// return the form html
	return zeroBSCRM_forms_build_form_html($atts['id'],$atts['style'],__('CRM Forms: You have not entered a style in your form shortcode','zero-bs-crm'));

}

Code file location:

zero-bs-crm/zero-bs-crm/includes/ZeroBSCRM.Forms.php

Zero Bs Crm [jetpackcrm_unsubscribe] Shortcode

The Jetpack CRM Unsubscribe shortcode is a crucial tool for user management. It allows users to opt-out of mailing lists, enhancing user experience and privacy. This shortcode triggers the ‘zeroBSCRM_mailDelivery_unsubPage’ function. Upon activation, it performs the ‘zerobscrm_catch_unsubs’ action, effectively unsubscribing users from mailing lists.

Shortcode: [jetpackcrm_unsubscribe]

Examples and Usage

Basic example – The below shortcode is used to catch unsubscribe requests from users.

[jetpackcrm_unsubscribe /]

PHP Function Code

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

Shortcode line:

add_shortcode('jetpackcrm_unsubscribe', 'zeroBSCRM_mailDelivery_unsubPage');

Shortcode PHP function:

function zeroBSCRM_mailDelivery_unsubPage(){

	// this catches unsubs (managed mc2)
	do_action('zerobscrm_catch_unsubs');

}

Code file location:

zero-bs-crm/zero-bs-crm/includes/ZeroBSCRM.Mail.php

Zero Bs Crm [jetpackcrm_clientportal] Shortcode

The Zero-BS-CRM Client Portal shortcode is a powerful tool that enables user interaction. It checks if the user is on the front-end, sets a default endpoint, and allows for customization. It further scans query variables to match endpoints, allowing tweaks before running endpoint actions. The result is output buffering, ensuring no echo, only a return.

Shortcode: [jetpackcrm_clientportal]

Examples and Usage

Basic example – A simple usage of the jetpackcrm_clientportal shortcode without any additional parameters.

[jetpackcrm_clientportal /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'jetpackcrm_clientportal', array( $this, 'client_portal_shortcode' ) );

Shortcode PHP function:

function client_portal_shortcode() {
		// This function is being called by a shortcode (add_shortcode) and should never return any output (e.g. echo).
		// The implementation is old and removing all the output requires a lot of work. This is a quick workaround to fix it.
		ob_start();
		// this checks that we're on the front-end
		// ... a necessary step, because the editor (wp) now runs the shortcode on loading (probs gutenberg)
		// ... and because this should RETURN, instead it ECHO's directly
		// ... it should not run on admin side, because that means is probs an edit page!
		if ( !is_admin() ) {
			global $wp_query;

			// Setting the default endpoint to be the dashboard.
			// This could be customizable by the user if we want to.
			$endpoints_slug_array_column = array_column($this->endpoints, null, 'slug');
			// Let the default endpoint to be overriden by plugins.
			$default_endpoint_slug = apply_filters( 'jpcrm_client_portal_default_endpoint_slug', 'dashboard', $this );
			$endpoint = $endpoints_slug_array_column[$default_endpoint_slug];
			$portal_query_vars = $this->get_portal_query_vars( $wp_query->query_vars );

			foreach( $portal_query_vars as $var_key => $var_value ) {
				foreach ( $this->endpoints as $endpoint_search ) {
					if ( $endpoint_search->slug === $var_key ) {
						$endpoint = $endpoint_search;
						$endpoint->param_value = $var_value;
						break 2; // Breaks this loop and the outer loop, hence 2.
					}
				}
			}

			// allows one to tweak endpoint properties as needed before running endpoint actions
			$endpoint->before_endpoint_actions();
			$endpoint->perform_endpoint_action();
		}

		$result = ob_get_contents();
		ob_end_clean();
		return $result;
	}

Code file location:

zero-bs-crm/zero-bs-crm/modules/portal/class-client-portal.php

Conclusion

Now that you’ve learned how to embed the Zero Bs Crm 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 *