grunion_add_bulk_edit_option

The Jetpack by WordPress.com grunion add bulk edit option function.

Description

grunion_add_bulk_edit_option(); 

Usage

  1. if ( !function_exists( 'grunion_add_bulk_edit_option' ) ) { 
  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_bulk_edit_option(); 
  7.  

Defined (1)

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

/modules/contact-form/admin.php  
  1. function grunion_add_bulk_edit_option() { 
  2.  
  3. $screen = get_current_screen(); 
  4.  
  5. if ( 'edit-feedback' != $screen->id ) { 
  6. return; 
  7.  
  8. // When viewing spam we want to be able to be able to bulk delete 
  9. // When viewing anything we want to be able to bulk move to spam 
  10. if ( isset( $_GET['post_status'] ) && 'spam' == $_GET['post_status'] ) { 
  11. // Create Delete Permanently bulk item 
  12. $option_val = 'delete'; 
  13. $option_txt = __( 'Delete Permanently', jetpack ); 
  14. $pseudo_selector = 'last-child'; 
  15.  
  16. } else { 
  17. // Create Mark Spam bulk item 
  18. $option_val = 'spam'; 
  19. $option_txt = __( 'Mark as Spam', jetpack ); 
  20. $pseudo_selector = 'first-child'; 
  21.  
  22. ?> 
  23. <script type="text/javascript"> 
  24. jQuery(document).ready(function($) { 
  25. $('#posts-filter .actions select').filter('[name=action], [name=]').find('option:<?php echo $pseudo_selector; ?>').after('<option value="<?php echo $option_val; ?>"><?php echo esc_attr( $option_txt ); ?></option>' ); 
  26. }) 
  27. </script> 
  28. <?php