Plugin Directory

Changeset 2102728


Ignore:
Timestamp:
06/08/2019 04:24:13 PM (7 years ago)
Author:
restpack
Message:

Minor

Location:
announcekit/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • announcekit/trunk/index.php

    r2100965 r2102728  
    55 * Plugin URI: https://announcekit.app/docs
    66 * Description: Beautifully designed newsfeed powered with fancy widgets and email notifications.
    7  * Version: 1.0.0
     7 * Version: 1.1
    88 * Text Domain: announcekit
    99 * Author: AnnounceKit
     
    442442      }
    443443
    444       $conf['selector'] = $item['selector'] ? ".menu-item-" . $item['selector'] : null;
     444      $conf['selector'] = $item['selector'] ? "XXXSELECTORXXX" : null;
    445445      $conf['widget'] = $item['widget_url'];
    446446      $conf[$type] = ['style' => $stlye];
    447447
    448       $widgets .= 'window.announcekit.push(' . json_encode(array_filter((array) $conf), JSON_UNESCAPED_SLASHES) . ');';
     448      $js = json_encode(array_filter((array) $conf), JSON_UNESCAPED_SLASHES);
     449
     450      if ($conf['selector']) {
     451        $js = str_replace(
     452          '"XXXSELECTORXXX"',
     453          "'.' + (document.querySelector('.menu-item-" .
     454            $item['selector'] .
     455            "') || document.querySelector('.ak-man')).getAttribute('class').replace(/ /g, '.')",
     456          $js
     457        );
     458      }
     459
     460      $widgets .= 'window.announcekit.push(' . $js . ');';
    449461    }
    450462
  • announcekit/trunk/readme.txt

    r2100965 r2102728  
    44Requires at least: 4.1
    55Tested up to: 5.2.1
    6 Stable tag: 1.0.0
     6Stable tag: 1.1
    77Requires PHP: 5.2.4
    88License: GNUGPLv3
     
    3333== Changelog ==
    3434
     35= 1.1 =
     36* Bug fixes
     37
    3538= 1.0 =
    3639* First release
Note: See TracChangeset for help on using the changeset viewer.