Changeset 1656300
- Timestamp:
- 05/13/2017 01:38:00 AM (9 years ago)
- Location:
- wp-rest-api-contact/trunk
- Files:
-
- 3 edited
-
includes/api-custom/class.wprac-api-contact-controller.php (modified) (1 diff)
-
includes/api-custom/class.wprac-api-newsletter-controller.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-rest-api-contact/trunk/includes/api-custom/class.wprac-api-contact-controller.php
r1654887 r1656300 241 241 $hook = add_menu_page('Contacts', 'Contacts', 'manage_options', 242 242 $menuSlug,array($instance,'wprac_contact_page') 243 , 'dashicons-email-alt', 58);243 , 'dashicons-email-alt', null); 244 244 add_action( "load-$hook", array($instance, 'wprac_screen_option') ); 245 245 -
wp-rest-api-contact/trunk/includes/api-custom/class.wprac-api-newsletter-controller.php
r1654887 r1656300 44 44 // Đăng ký ajax 45 45 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')); 46 49 47 50 return $instance; … … 172 175 $hook = add_menu_page('Newsletter', 'Newsletter', 'manage_options', 173 176 $menuSlug,array($instance,'wprac_newsletter_page') 174 , 'dashicons-warning', 58);177 , 'dashicons-warning', null); 175 178 add_action( "load-$hook", array($instance, 'wprac_screen_option') ); 176 179 … … 321 324 return $instance; 322 325 } 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 } 323 356 } 324 357 -
wp-rest-api-contact/trunk/readme.txt
r1655229 r1656300 1 1 === WP REST API NPA === 2 Contributors: Thien Pham NPA2 Contributors: Thien Pham, NPA 3 3 Donate link: https://www.paypal.me/ThienPham175 4 4 Tags: wp rest api contact, rest api contact, api contact, wp rest api newsletter, rest api newsletter, api newsletter … … 43 43 = 1.0.0 = 44 44 * First version. 45 46 45 == Upgrade Notice == 47 46 48 = 1.0.2 =49 * Create WP Rest API Subscribe Newsletter.50 51 = 1.0.1 =52 * Create WP Rest API Contact.53 54 47 = 1.0.0 = 55 * First version .48 * First version 56 49 57 50 == Features you will love ==
Note: See TracChangeset
for help on using the changeset viewer.