# simple-urls/109/classes/class-shortcode.php

Lasso Lite – Affiliate Link Manager &amp; Product Displays, version 109. 62 lines.

- Page: https://pluginprobe.com/plugins/simple-urls/109/code/classes/class-shortcode.php
- Raw: https://pluginprobe.com/plugins/simple-urls/109/raw/classes/class-shortcode.php
- Modified: 2022-08-02T03:33:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/simple-urls/109/code/classes/class-shortcode.php#L10-L20`.

```php
<?php
/**
 * Declare class Shortcode
 *
 * @package Page
 */

namespace LassoLite\Classes;

use LassoLite\Classes\Helper;
use Lasso_Shortcode;

/**
 * Shortcode
 */
class Shortcode {

	const LASSO_PRO_POST_TYPE = 'lasso-urls';

	/**
	 * Lasso Display Boxes
	 *
	 * @param array $attr Attributes of shortcode.
	 */
	public function lasso_lite_core_shortcode( $attr ) {
		$post_id = $attr['id'] ?? '';

		// ? Lasso Lite must be having "id" parameter
		if ( ! $post_id ) {
			return false;
		}

		$post = get_post( $post_id );
		// ? Check existing post
		if ( is_null( $post ) ) {
			return false;
		}

		// ? Check case Lasso Lite deleted
		if ( 'trash' === $post->post_status ) {
			return false;
		}

		// ? Check post_type is Lasso Lite or not
		if ( SIMPLE_URLS_SLUG !== $post->post_type ) {
			if ( class_exists( 'Lasso_Shortcode' ) ) {
				$shortcode_pro = new Lasso_Shortcode();
				return $shortcode_pro->lasso_core_shortcode( $attr );
			}
			return false;
		}

		// ? Check post_type surl to execute shortcode correctly
		if ( SIMPLE_URLS_SLUG === $post->post_type ) {
			// ? Default single-style display box
			return Helper::include_with_variables( Helper::get_path_views_folder() . 'displays/single.php', array( 'post' => $post ) );
		}

		return false;
	}
}

```
