WP-Appbox Shortcode

Below, you’ll find a detailed guide on how to add the WP-Appbox Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the WP-Appbox Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the WP-Appbox Plugin and the shortcodes it provides:

Plugin Icon
WP-Appbox

"WP-Appbox is a powerful WordPress plugin that allows for easy and quick integration of app details from various platforms into your posts and pages. Ideal for app review sites!"

★★★★✩ (62) Active Installs: 5000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [appbox]

WP-Appbox [appbox] Shortcode

The WP-Appbox shortcode is designed to create an app box within WordPress. This shortcode calls the function ‘wpAppbox_createAppbox’, which generates an app box based on the provided attributes. It checks if the current user is an admin, then begins to calculate the runtime. It creates new instances of the ‘wpAppbox_CreateAttributs’ and ‘wpAppbox_CreateOutput’ classes, and uses these to generate the app box. If this is the first time the shortcode is being used, it registers styles and loads fonts. It then calculates the total runtime and returns the generated output.

Shortcode: [appbox]

Parameters

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

  • appboxAttributs – sets the attributes for the app box
  • content – defines the content within the app box

Examples and Usage

Basic example – A simple usage of the wp-appbox shortcode to display an app box for a specific app by using its app ID.

[appbox appid="com.example.app" /]

Advanced examples

Display an app box with additional parameters. This example includes the app’s ID, the store it’s available on, and a custom title for the app box.

[appbox appid="com.example.app" store="googleplay" title="My Favorite App" /]

Display an app box with even more parameters. This example includes the app’s ID, the store it’s available on, a custom title for the app box, and a custom image for the app box.

[appbox appid="com.example.app" store="googleplay" title="My Favorite App" image="http://example.com/myimage.jpg" /]

Please note that the actual parameters and their usage may vary depending on the configuration and customization of the wp-appbox plugin.

PHP Function Code

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

Shortcode line:

add_shortcode( 'appbox', 'wpAppbox_createAppbox' );

Shortcode PHP function:

function wpAppbox_createAppbox( $appboxAttributs, $content = null ) {
	if ( is_admin() ) return( false );
	global $wpAppboxFirstShortcode;
	$runtimeStart = microtime( true );
	wpAppbox_errorOutput( "//=================================================" );
	$attr = new wpAppbox_CreateAttributs;
	$attr = $attr->devideAttributs( $appboxAttributs );
	wpAppbox_errorOutput( "APP-ID: ".$attr['appid'] );
	$output = new wpAppbox_CreateOutput;
	$output = $output->theOutput( $attr );
	if ( $wpAppboxFirstShortcode ):
		if ( !get_option('wpAppbox_disableDefer') ):
			wpAppbox_registerStyle();
			wpAppbox_loadFonts();
		endif;
		$wpAppboxFirstShortcode = false;
	endif;
	$runtimeEnd = microtime( true );
	$runetimeResult = $runtimeEnd - $runtimeStart;
	wpAppbox_errorOutput( "function: wpAppbox_createAppbox() ---> Runtime: $runetimeResult seconds\n" );
	wpAppbox_errorOutput( "//=================================================\n\n" );
	return( $output );
}

Code file location:

wp-appbox/wp-appbox/wp-appbox.php

Conclusion

Now that you’ve learned how to embed the WP-Appbox Plugin shortcode, 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 *