grunion_add_empty_spam_button

The Jetpack by WordPress.com grunion add empty spam button function.

Description

grunion_add_empty_spam_button(); 

Usage

  1. if ( !function_exists( 'grunion_add_empty_spam_button' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/contact-form/admin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = grunion_add_empty_spam_button(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/modules/contact-form/admin.php  
  1. function grunion_add_empty_spam_button() { 
  2. $screen = get_current_screen(); 
  3.  
  4. // Only add to feedback, only to spam view 
  5. if ( 'edit-feedback' != $screen->id 
  6. || empty( $_GET['post_status'] ) 
  7. || 'spam' !== $_GET['post_status'] ) { 
  8. return; 
  9.  
  10. // Get HTML for the button 
  11. $button_html = wp_nonce_field( 'bulk-destroy', '_destroy_nonce', true, false ); 
  12. $button_html .= get_submit_button( __( 'Empty Spam', jetpack ), 'apply', 'delete_all', false ); 
  13.  
  14. // Add the button next to the filter button via js 
  15. ?> 
  16. <script type="text/javascript"> 
  17. jQuery(document).ready(function($) { 
  18. $('#posts-filter #post-query-submit').after('<?php echo $button_html; ?>' ); 
  19. }) 
  20. </script> 
  21. <?php