| @@ -7,8 +7,9 @@ | ||
| 7 | 7 | |
| 8 | 8 | namespace LassoLite\Classes; |
| 9 | 9 | |
| 10 | 10 | use LassoLite\Classes\Helper; |
| 11 | +use LassoLite\Classes\Setting; | |
| 11 | 12 | use Lasso_Shortcode; |
| 12 | 13 | |
| 13 | 14 | /** |
| 14 | 15 | * Shortcode |
| @@ -14,9 +15,26 @@ | ||
| 14 | 15 | * Shortcode |
| 15 | 16 | */ |
| 16 | 17 | class Shortcode { |
| 17 | 18 | |
| 18 | - const LASSO_PRO_POST_TYPE = 'lasso-urls'; | |
| 19 | + const LASSO_PRO_POST_TYPE = 'lasso-urls'; | |
| 20 | + const AAWP_SUPPORT_FIELDS_VALUE = array( | |
| 21 | + 'title', | |
| 22 | + 'image', | |
| 23 | + 'thumb', | |
| 24 | + 'button', | |
| 25 | + 'price', | |
| 26 | + 'list_price', | |
| 27 | + 'amount_saved', | |
| 28 | + 'percentage_saved', | |
| 29 | + 'rating', | |
| 30 | + 'star_rating', | |
| 31 | + 'description', | |
| 32 | + 'reviews', | |
| 33 | + 'url', | |
| 34 | + 'link', | |
| 35 | + 'last_update', | |
| 36 | + ); | |
| 19 | 37 | |
| 20 | 38 | /** |
| 21 | 39 | * Lasso Display Boxes |
| 22 | 40 | * |
| @@ -22,10 +40,26 @@ | ||
| 22 | 40 | * |
| 23 | 41 | * @param array $attr Attributes of shortcode. |
| 24 | 42 | */ |
| 25 | 43 | public function lasso_lite_core_shortcode( $attr ) { |
| 26 | - $post_id = $attr['id'] ?? ''; | |
| 44 | + $post_id = $attr['id'] ?? ''; | |
| 45 | + $title = $attr['title'] ?? ''; | |
| 46 | + $title_url = $attr['title_url'] ?? ''; | |
| 47 | + $title_type = $attr['title_type'] ?? ''; | |
| 48 | + $description = $attr['description'] ?? ''; | |
| 49 | + $badge = $attr['badge'] ?? ''; | |
| 50 | + $price = $attr['price'] ?? ''; | |
| 51 | + $primary_url = $attr['primary_url'] ?? ''; | |
| 52 | + $primary_text = $attr['primary_text'] ?? ''; | |
| 53 | + $image_url = $attr['image_url'] ?? ''; | |
| 54 | + $anchor_id = $attr['anchor_id'] ?? ''; | |
| 55 | + $brag = $attr['brag'] ?? ''; | |
| 27 | 56 | |
| 57 | + if ( empty( $anchor_id ) ) { | |
| 58 | + $unique_id = $post_id; | |
| 59 | + $anchor_id = 'lasso-lite-anchor-id-' . $unique_id; | |
| 60 | + } | |
| 61 | + | |
| 28 | 62 | // ? Lasso Lite must be having "id" parameter |
| 29 | 63 | if ( ! $post_id ) { |
| 30 | 64 | return false; |
| 31 | 65 | } |
| @@ -51,10 +85,24 @@ | ||
| 51 | 85 | } |
| 52 | 86 | |
| 53 | 87 | // ? Check post_type surl to execute shortcode correctly |
| 54 | 88 | if ( SIMPLE_URLS_SLUG === $post->post_type ) { |
| 89 | + $pass_data = array( | |
| 90 | + 'post' => $post, | |
| 91 | + 'title' => $title, | |
| 92 | + 'title_type' => $title_type, | |
| 93 | + 'title_url' => $title_url, | |
| 94 | + 'description' => $description, | |
| 95 | + 'badge' => $badge, | |
| 96 | + 'price' => $price, | |
| 97 | + 'primary_url' => $primary_url, | |
| 98 | + 'primary_text' => $primary_text, | |
| 99 | + 'image_url' => $image_url, | |
| 100 | + 'anchor_id' => $anchor_id, | |
| 101 | + 'brag' => $brag, | |
| 102 | + ); | |
| 55 | 103 | // ? Default single-style display box |
| 56 | - return Helper::include_with_variables( Helper::get_path_views_folder() . 'displays/single.php', array( 'post' => $post ) ); | |
| 104 | + return Helper::include_with_variables( Helper::get_path_views_folder() . 'displays/single.php', $pass_data ); | |
| 57 | 105 | } |
| 58 | 106 | |
| 59 | 107 | return false; |
| 60 | 108 | } |