Plugin Directory

Changeset 1656300


Ignore:
Timestamp:
05/13/2017 01:38:00 AM (9 years ago)
Author:
chithien175
Message:

update 13052017

Location:
wp-rest-api-contact/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-rest-api-contact/trunk/includes/api-custom/class.wprac-api-contact-controller.php

    r1654887 r1656300  
    241241        $hook = add_menu_page('Contacts', 'Contacts', 'manage_options',
    242242        $menuSlug,array($instance,'wprac_contact_page')
    243         , 'dashicons-email-alt', 58);
     243        , 'dashicons-email-alt', null);
    244244        add_action( "load-$hook", array($instance, 'wprac_screen_option') );
    245245       
  • wp-rest-api-contact/trunk/includes/api-custom/class.wprac-api-newsletter-controller.php

    r1654887 r1656300  
    4444        // Đăng ký ajax
    4545        add_action('wp_ajax_do_send_mail_newsletter', array($instance, 'do_send_mail_newsletter'));
     46
     47        //Add hook to Admin Menu.
     48        // add_action('admin_menu', array($instance, 'notification_count_in_admin_menu'));
    4649
    4750        return $instance;
     
    172175        $hook = add_menu_page('Newsletter', 'Newsletter', 'manage_options',
    173176        $menuSlug,array($instance,'wprac_newsletter_page')
    174         , 'dashicons-warning', 58);
     177        , 'dashicons-warning', null);
    175178        add_action( "load-$hook", array($instance, 'wprac_screen_option') );
    176179       
     
    321324        return $instance;
    322325    }
     326
     327    public static function notification_count_in_admin_menu()
     328    {
     329        $instance = self::getInstance();
     330
     331        global $menu;
     332        // echo "<pre>";
     333        // print_r($menu);
     334        // echo "</pre>";
     335        // die();
     336       
     337        $post_count = 1;
     338        if(!empty($post_count))
     339        {
     340            foreach ( (array)$menu as $key => $item )
     341            {
     342                if ( $item[2] == 'tp-contact' )
     343                {
     344                    $menu[$key][0] = $menu[$key][0].'<span class="update-count">'.$post_count.'</span>';
     345                }
     346            }
     347        }
     348       
     349        return $instance;
     350    }
     351    public static function get_number_of_pending_post_by_type($type)
     352    {
     353        global $wpdb;
     354        return $wpdb->get_var( "SELECT COUNT(ID) as count FROM {$wpdb->post} WHERE `post_status`='pending' AND `post_type`='{$type}';" );
     355    }
    323356}
    324357
  • wp-rest-api-contact/trunk/readme.txt

    r1655229 r1656300  
    11=== WP REST API NPA ===
    2 Contributors: Thien Pham NPA
     2Contributors: Thien Pham, NPA
    33Donate link: https://www.paypal.me/ThienPham175
    44Tags: wp rest api contact, rest api contact, api contact, wp rest api newsletter, rest api newsletter, api newsletter
     
    4343= 1.0.0 =
    4444* First version.
    45 
    4645== Upgrade Notice ==
    4746
    48 = 1.0.2 =
    49 * Create WP Rest API Subscribe Newsletter.
    50 
    51 = 1.0.1 =
    52 * Create WP Rest API Contact.
    53 
    5447= 1.0.0 =
    55 * First version.
     48* First version
    5649
    5750== Features you will love ==
Note: See TracChangeset for help on using the changeset viewer.