Plugin Directory

Changeset 2671472


Ignore:
Timestamp:
02/02/2022 04:25:16 PM (4 years ago)
Author:
nicejob
Message:

updated the plugin version to 3.6.0

Location:
nicejob/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nicejob/trunk/nicejob.php

    r2671382 r2671472  
    33Plugin Name: NiceJob
    44Plugin URI: https://get.nicejob.co/
    5 Version: 3.5.0
     5Version: 3.6.0
    66Author: nicejob
    77Description: Easily add NiceJob Stories, Reviews, Trust Badge, Engage, and Collect Leads and Reviews to your Wordpress site.
     
    107107    'js-url' => $cdn_js_url,
    108108    'review-url' => $review_url,
    109     'app-url' => $monolith_app_url
     109    'app-url' => $monolith_app_url,
     110    'source' => ''
    110111  ), $atts );
    111112
     
    144145  $params .= (intval($a['max-height'])>0)?' data-max-height="'.intval($a['max-height']).'"':'';
    145146  $params .= ($a['branding']=='top')?'':' data-branding="bottom"';
     147  $source = $a['source'] ?? '';
     148  $params .= get_data_source_attr($source);
    146149  $js_url = $a['js-url'];
    147150  $nj_app = ($a['app-url']!=$app_url)?' nj-app="'.$a['app-url'].'"':'';
     
    172175    'js-url' => $cdn_js_url,
    173176    'review-url' => $review_url,
    174     'app-url' => $app_url
     177    'app-url' => $app_url,
     178    'source' => ''
    175179  ), $atts );
    176180
     
    196200  $params = '';
    197201  $params .= (intval($a['show-reviews'])>0)?' data-show-reviews="1"':'';
     202  $source = $a['source'] ?? '';
     203  $params .= get_data_source_attr($source);
    198204  $js_url = $a['js-url'];
    199205  $nj_app = ($a['app-url']!=$app_url)?' nj-app="'.$a['app-url'].'"':'';
     
    578584}
    579585add_filter("mce_buttons", "register_buttons_editor");
     586
     587function 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  
    55Requires PHP: 7.0
    66Tested up to: 5.8
    7 Stable tag: 3.5.0
     7Stable tag: 3.6.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3131       * max-height: stories maximum height (optional, default none)
    3232       * 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)
    3334       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"]
    3536   * [nicejob-badge]
    3637       * 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)
    3739       Example usage of complete options:
    38        [nicejob-badge show-reviews="1"]
     40       [nicejob-badge show-reviews="1" source="account"]
    3941   * [nicejob-engage]
    4042       * positions: [left/right] Position on screen
     
    7476
    7577== Changelog ==
     78
     79= 3.6.0 =
     80* Add source attribute to trust badge & stories shortcode
    7681
    7782= 3.5.0 =
Note: See TracChangeset for help on using the changeset viewer.