PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 108
Lasso Lite – Affiliate Link Manager & Product Displays v108
157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 116 All 56 releases
← All changes | classes/class-shortcode.php +2 -33 112108 View file →
@@ -7,9 +7,8 @@
7 7
8 8 namespace LassoLite\Classes;
9 9
10 10 use LassoLite\Classes\Helper;
11 -use LassoLite\Classes\Setting;
12 11 use Lasso_Shortcode;
13 12
14 13 /**
15 14 * Shortcode
@@ -23,26 +22,10 @@
23 22 *
24 23 * @param array $attr Attributes of shortcode.
25 24 */
26 25 public function lasso_lite_core_shortcode( $attr ) {
27 - $post_id = $attr['id'] ?? '';
28 - $title = $attr['title'] ?? '';
29 - $title_url = $attr['title_url'] ?? '';
30 - $title_type = $attr['title_type'] ?? '';
31 - $description = $attr['description'] ?? '';
32 - $badge = $attr['badge'] ?? '';
33 - $price = $attr['price'] ?? '';
34 - $primary_url = $attr['primary_url'] ?? '';
35 - $primary_text = $attr['primary_text'] ?? '';
36 - $image_url = $attr['image_url'] ?? '';
37 - $anchor_id = $attr['anchor_id'] ?? '';
38 - $brag = $attr['brag'] ?? '';
26 + $post_id = $attr['id'] ?? '';
39 27
40 - if ( empty( $anchor_id ) ) {
41 - $unique_id = $post_id;
42 - $anchor_id = 'lasso-lite-anchor-id-' . $unique_id;
43 - }
44 -
45 28 // ? Lasso Lite must be having "id" parameter
46 29 if ( ! $post_id ) {
47 30 return false;
48 31 }
@@ -68,24 +51,10 @@
68 51 }
69 52
70 53 // ? Check post_type surl to execute shortcode correctly
71 54 if ( SIMPLE_URLS_SLUG === $post->post_type ) {
72 - $pass_data = array(
73 - 'post' => $post,
74 - 'title' => $title,
75 - 'title_type' => $title_type,
76 - 'title_url' => $title_url,
77 - 'description' => $description,
78 - 'badge' => $badge,
79 - 'price' => $price,
80 - 'primary_url' => $primary_url,
81 - 'primary_text' => $primary_text,
82 - 'image_url' => $image_url,
83 - 'anchor_id' => $anchor_id,
84 - 'brag' => $brag,
85 - );
86 55 // ? Default single-style display box
87 - return Helper::include_with_variables( Helper::get_path_views_folder() . 'displays/single.php', $pass_data );
56 + return Helper::include_with_variables( Helper::get_path_views_folder() . 'displays/single.php', array( 'post' => $post ) );
88 57 }
89 58
90 59 return false;
91 60 }