Plugin Directory

Changeset 2231172


Ignore:
Timestamp:
01/21/2020 08:01:46 PM (6 years ago)
Author:
kduffie
Message:

Add category hierarchy into slick:category

Location:
slick-engagement/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • slick-engagement/trunk/SlickEngagement_Plugin.php

    r2230520 r2231172  
    194194    }
    195195
     196    public function removeSemicolons($value)
     197    {
     198        return str_replace(';', ' ', $value);
     199    }
     200
    196201    public function addSlickPageHeader()
    197202    {
    198203        global $post;
     204        echo "\n";
     205        echo '<meta property="slick:wpversion" content="1.0.17" />' . "\n";
    199206        $siteCode = $this->getOption('SiteCode');
    200         echo "\n";
    201         echo '<meta property="slick:wpversion" content="1.0.16" />' . "\n";
    202207        if ($siteCode) {
    203208            $serverUrl = $this->getOption('SlickServerUrl', 'https://app.slickstream.com/e2/embed-nav.js');
     
    224229            foreach ($categories as $category) {
    225230                if (isset($category->slug) && $category->slug !== 'uncategorized') {
    226                     echo '<meta property="slick:category" content="' . $category->slug . ':' . $category->name . '" />' . "\n";
     231                    echo '<meta property="slick:category" content="' . $category->slug . ':' . $this->removeSemicolons($category->name);
     232                    $used = [$category->cat_ID];
     233                    $count = 0;
     234                    $parentCatId = $category->category_parent;
     235                    while ($parentCatId && count < 8 && !in_array($parentCatId, $used)) {
     236                        $parentCat = get_category($parentCatId);
     237                        if (isset($parentCat->slug) && $parentCat->slug !== 'uncategorized') {
     238                            echo ';' . $parentCat->slug . ':' . $this->removeSemicolons($parentCat->name);
     239                            $parentCatId = $parentCat->cat_ID;
     240                        } else {
     241                            break;
     242                        }
     243                        array_push($used, $parentCatId);
     244                        $count = $count + 1;
     245                    }
     246                    echo '" />' . "\n";
    227247                }
    228248            }
  • slick-engagement/trunk/readme.txt

    r2230520 r2231172  
    77Requires at least: 4.0
    88Tested up to: 5.3.2
    9 Stable tag: 1.0.16
     9Stable tag: 1.0.17
    1010
    1111Increase pageviews and delight visitors with fast and responsive site search, beautiful content discovery tools and more.
     
    7373= 1.0.16 =
    7474- Remove (unintended) whitespace from site code
     75
     76= 1.0.17 =
     77- Add category hierarchy into metadata
  • slick-engagement/trunk/slick-engagement.php

    r2230520 r2231172  
    33Plugin Name: Slick Engagement
    44Plugin URI: https://slickstream.com/getting-started
    5 Version: 1.0.16
     5Version: 1.0.17
    66Author: Slickstream
    77Author URI: https://slickstream.com
Note: See TracChangeset for help on using the changeset viewer.