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