Changeset 2671472
- Timestamp:
- 02/02/2022 04:25:16 PM (4 years ago)
- Location:
- nicejob/trunk
- Files:
-
- 2 edited
-
nicejob.php (modified) (6 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nicejob/trunk/nicejob.php
r2671382 r2671472 3 3 Plugin Name: NiceJob 4 4 Plugin URI: https://get.nicejob.co/ 5 Version: 3. 5.05 Version: 3.6.0 6 6 Author: nicejob 7 7 Description: Easily add NiceJob Stories, Reviews, Trust Badge, Engage, and Collect Leads and Reviews to your Wordpress site. … … 107 107 'js-url' => $cdn_js_url, 108 108 'review-url' => $review_url, 109 'app-url' => $monolith_app_url 109 'app-url' => $monolith_app_url, 110 'source' => '' 110 111 ), $atts ); 111 112 … … 144 145 $params .= (intval($a['max-height'])>0)?' data-max-height="'.intval($a['max-height']).'"':''; 145 146 $params .= ($a['branding']=='top')?'':' data-branding="bottom"'; 147 $source = $a['source'] ?? ''; 148 $params .= get_data_source_attr($source); 146 149 $js_url = $a['js-url']; 147 150 $nj_app = ($a['app-url']!=$app_url)?' nj-app="'.$a['app-url'].'"':''; … … 172 175 'js-url' => $cdn_js_url, 173 176 'review-url' => $review_url, 174 'app-url' => $app_url 177 'app-url' => $app_url, 178 'source' => '' 175 179 ), $atts ); 176 180 … … 196 200 $params = ''; 197 201 $params .= (intval($a['show-reviews'])>0)?' data-show-reviews="1"':''; 202 $source = $a['source'] ?? ''; 203 $params .= get_data_source_attr($source); 198 204 $js_url = $a['js-url']; 199 205 $nj_app = ($a['app-url']!=$app_url)?' nj-app="'.$a['app-url'].'"':''; … … 578 584 } 579 585 add_filter("mce_buttons", "register_buttons_editor"); 586 587 function get_data_source_attr(string $source = ''): string { 588 if (!$source) { 589 return ''; 590 } 591 $trimmedSource = trim($source, ','); 592 if (preg_match("/^[0-9]+(,[0-9]+)*$/", $trimmedSource)) { 593 return ' data-source="' . $trimmedSource . '"'; 594 } 595 if (strtolower($source) === 'account') { 596 return ' data-source="account"'; 597 } 598 599 return ''; 600 } -
nicejob/trunk/readme.txt
r2671382 r2671472 5 5 Requires PHP: 7.0 6 6 Tested up to: 5.8 7 Stable tag: 3. 5.07 Stable tag: 3.6.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 31 31 * max-height: stories maximum height (optional, default none) 32 32 * branding: [top/bottom] brand position (optional, default top) 33 * source: [account,{company_id},{company_id}...] Show stories from all the companies in a account, a few companies (comma separate). (optional, default: current company) 33 34 Example usage of complete options: 34 [nicejob-stories style="grid" show="reviews" max-height=300 branding="bottom" ]35 [nicejob-stories style="grid" show="reviews" max-height=300 branding="bottom" source="account"] 35 36 * [nicejob-badge] 36 37 * show-reviews: [1/0] Show reviews 38 * source: [account,{company_id},{company_id}...] Show reviews from all the companies in a account, a few companies (comma separate). (optional, default: current company) 37 39 Example usage of complete options: 38 [nicejob-badge show-reviews="1" ]40 [nicejob-badge show-reviews="1" source="account"] 39 41 * [nicejob-engage] 40 42 * positions: [left/right] Position on screen … … 74 76 75 77 == Changelog == 78 79 = 3.6.0 = 80 * Add source attribute to trust badge & stories shortcode 76 81 77 82 = 3.5.0 =
Note: See TracChangeset
for help on using the changeset viewer.