Plugin Directory

Changeset 2122496


Ignore:
Timestamp:
07/13/2019 12:02:58 PM (7 years ago)
Author:
restpack
Message:

User tracking

Location:
announcekit/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • announcekit/trunk/index.php

    r2116111 r2122496  
    55 * Plugin URI: https://announcekit.app/docs
    66 * Description: Beautifully designed newsfeed powered with fancy widgets and email notifications.
    7  * Version: 1.2
     7 * Version: 1.3
    88 * Text Domain: announcekit
    99 * Author: AnnounceKit
     
    189189      "key" => "selector_manual"
    190190    ));
     191
     192    add_settings_field(
     193      "user_tracking",
     194      "User tracking",
     195      array(&$this, 'render_settings_field'),
     196      __FILE__,
     197      $first_section,
     198      array(
     199        "key" => "user_tracking"
     200      )
     201    );
    191202
    192203    add_settings_field("position_right", 'Right', array(&$this, 'render_settings_field'), __FILE__, $first_section, array(
     
    253264          $value .
    254265          "' />";
     266        break;
     267
     268      case 'user_tracking':
     269        $html = '<input value="1" ' . ($value == "1" ? "checked" : "") . ' type="checkbox" ' . $default_attrs . ' />';
    255270        break;
    256271
     
    462477      $conf[$type] = ['style' => $stlye];
    463478
     479      if ($item['user_tracking']) {
     480        $current_user = wp_get_current_user();
     481        if ($current_user->exists()) {
     482          $conf['data'] = [
     483            "user_id" => $current_user->ID,
     484            "user_name" => $current_user->display_name,
     485            "user_email" => $current_user->user_email,
     486            "user_login" => $current_user->user_login
     487          ];
     488        }
     489      }
     490
    464491      if ($item['selector'] == "0" && $item['selector_manual']) {
    465492        $conf['selector'] = $item['selector_manual'];
  • announcekit/trunk/readme.txt

    r2116108 r2122496  
    44Requires at least: 4.1
    55Tested up to: 5.2.1
    6 Stable tag: 1.2
     6Stable tag: 1.3
    77Requires PHP: 5.2.4
    88License: GNUGPLv3
     
    3333== Changelog ==
    3434
     35= 1.3 =
     36* Support for user tracking
     37
    3538= 1.2 =
    3639* Ability to set own element selector
Note: See TracChangeset for help on using the changeset viewer.