Plugin Directory

Changeset 2012557


Ignore:
Timestamp:
01/15/2019 08:58:09 AM (7 years ago)
Author:
designwall
Message:

release version 1.0.2

Location:
dw-notifications
Files:
48 added
6 edited

Legend:

Unmodified
Added
Removed
  • dw-notifications/trunk/assets/js/dw-notifications.js

    r1903697 r2012557  
    1313    var currentTimeRequest = 10000;
    1414    var timeoutPopup = 15000;
     15
     16    if(dwnotif.dwnotif_min_time_request >= 2 && dwnotif.dwnotif_min_time_request <= 10){
     17        minTimeRequest = dwnotif.dwnotif_min_time_request * 1000;
     18    }
    1519   
    1620
  • dw-notifications/trunk/dw-notifications.php

    r1903697 r2012557  
    55 *  Author: DesignWall
    66 *  Author URI: http://www.designwall.com
    7  *  Version: 1.0.1
     7 *  Version: 1.0.2
    88 *  Text Domain: dw-notifications
    99 */
     
    1616class DW_Notifications{
    1717    public function __construct() {
    18         $this->version = '1.0.1';
     18        $this->version = '1.0.2';
    1919        $this->define_constants();
    2020        $this->includes();
  • dw-notifications/trunk/inc/Notification.php

    r1891940 r2012557  
    306306            'post_type' => 'dw-notification',
    307307            'post_status' => array('publish', 'dw_auto'),
    308             'post_per_page' => '-1',
     308            'posts_per_page' => '-1',
    309309            'meta_query' => array(
    310310                array(
     
    349349
    350350        $notifications = $this->get_notifications($data);
    351         // $show_list = $this->getListTemplate($data);
    352         // $count_unchecked = $this->countNotificationsUserUnchecked();
     351        $count_unchecked = $this->count_user_unchecked();
    353352
    354353        $file_dir = dwnotif_load_template( 'notification-alert', false);
     
    475474                ),
    476475            ),
    477             'post_per_page' => -1
     476            'posts_per_page' => -1
    478477        );
    479478        $args = apply_filters( 'dwnotif_count_user_unchecked_args', $args);
  • dw-notifications/trunk/inc/Script.php

    r1891940 r2012557  
    1212
    1313    function enqueue_style() {
     14        global $dw_notif_options;
     15
     16        $min_time_request = isset( $dw_notif_options['min-time-request'] ) ?  $dw_notif_options['min-time-request'] : 0;
     17
    1418        $dw_notifications_script_vars = apply_filters('dwnotif_script_vars', array(
    1519            'dwnotif_nonce' => wp_create_nonce('dwnotif_nonce'),
     
    2630            ),
    2731           
     32            'dwnotif_min_time_request' => $min_time_request
    2833        ));
    2934
  • dw-notifications/trunk/inc/Settings.php

    r1891940 r2012557  
    77class DWNOTIF_Settings {
    88    public function __construct(){
    9         //not done
    10         // add_menu_page( 'DW Notifications', 'DW Notifications', 'manage_options', 'dw-notifications', callable $function = '', 'dashicons-warning');
     9        add_action( 'admin_menu', array( $this, 'admin_menu' ) );
     10        add_action( 'admin_init', array( $this, 'register_settings' ) );
     11        add_action( 'init', array( $this, 'init_options' ), 9 );
    1112    }
    1213
    13     // public function dwnotif_
     14    public function admin_menu(){
     15        add_submenu_page( 'edit.php?post_type=dw-notification', __( 'Plugin Settings','dw-notifications' ), __( 'Settings','dw-notifications' ), 'manage_options', 'dw-notification-settings', array( $this, 'settings_display' )  );
     16    }
     17
     18    public function settings_display(){
     19        ?>
     20        <div class="wrap">
     21            <h2>DW Notification Settings</h2>
     22            <?php settings_errors(); ?>
     23
     24            <form method="post" action="options.php" class="dw-gdpr-settings-body">
     25            <?php
     26
     27            settings_fields( 'dw-notification-settings' );
     28            do_settings_sections( 'dw-notification-settings' );
     29            submit_button();
     30
     31            ?>
     32            </form>
     33        </div>
     34        <?php
     35    }
     36
     37    public function register_settings(){
     38        // Question Settings
     39        add_settings_section(
     40            'dw-notification-settings',
     41            __( 'General Setting', 'dwqa' ),
     42            false,
     43            'dw-notification-settings'
     44        );
     45
     46        add_settings_field(
     47            'dw_notif_options[min-time-request]',
     48            __( 'Min Time Request','dwqa' ),
     49            array($this, 'min_time_request'),
     50            'dw-notification-settings',
     51            'dw-notification-settings'
     52        );
     53
     54        register_setting( 'dw-notification-settings', 'dw_notif_options' );
     55    }
     56
     57    public function min_time_request(){
     58        global $dw_notif_options;
     59        $value = isset( $dw_notif_options['min-time-request'] ) ?  $dw_notif_options['min-time-request'] : 0;
     60        echo '<p><input id="dw_notif_min_time_request" type="number" name="dw_notif_options[min-time-request]" class="small-text" value="'.$value.'" min="2" max="10"> <span class="description">'.__( 'Time interval between requests. From 2 to 10','dw-notifications' ).'</span></p>';
     61    }
     62
     63    public function init_options(){
     64        global $dw_notif_options;
     65        $dw_notif_options = wp_parse_args( get_option( 'dw_notif_options' ), array(
     66            'min-time-request' => '2'
     67        ) );
     68    }
    1469}
  • dw-notifications/trunk/readme.txt

    r1907396 r2012557  
    33Tags: alert, bar, counter, notification, notification bar, mobile, jquery, plugin, foobar
    44Requires at least: 3.0.1
    5 Tested up to: 4.9.6
    6 Stable tag: 1.0.1
     5Tested up to: 5.0.3
     6Stable tag: 1.0.2
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4242We provide support both on support forum on WordPress.org and our [support page](http://www.designwall.com/question/) on DesignWall.
    4343
    44 Shortcode: **[dw_notif]**
    45 
    4644= Source =
    4745[Free for commercial use](https://www.iconfinder.com/icons/728992/configuration_control_dashboard_setting_speed_system_tool_icon#size=128)
     
    4947= Languages supported: =
    5048* English (default)
    51 * Arabic (ar_AR) - by Qamdad
    5249* Vietnamese
    5350
     
    56531. Upload `dw-notification` to the `/wp-content/plugins/` directory
    57542. Activate the plugin through the 'Plugins' menu in WordPress
    58 3. Insert shortcode [dw_notif]
    59     Very simple with the following shortcode:
    60     - Use in the page, post or widget: `[dw_notif]`
    61     - Use in the php file: `<div class="dw-notif-menu"><?php echo do_shortcode('[dw_notif]'); ?></div>`
    62     - Use in a menu item: `[dw_notif]`
    6355
    6456== Screenshots ==
    6557
    66 1. Insert shortcode in menu
     58
    6759
    6860== Changelog ==
     61
     62= 1.0.1 =
     63
     64* Fix count alert
     65* Add setting time interval between requests
    6966
    7067= 1.0.1 =
Note: See TracChangeset for help on using the changeset viewer.