find_posts_div

Outputs the modal window used for attaching media to posts or pages in the media-listing screen.

Description

find_posts_div( (string) $found_action = '' ); 

Parameters (1)

0. $found_action — Optional. (string) => ''
The found action.

Usage

  1. if ( !function_exists( 'find_posts_div' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/template.php'; 
  3.  
  4. // The found action. 
  5. $found_action = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = find_posts_div($found_action); 
  9.  

Defined (1)

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

/wp-admin/includes/template.php  
  1. function find_posts_div($found_action = '') { 
  2. ?> 
  3. <div id="find-posts" class="find-box" style="display: none;"> 
  4. <div id="find-posts-head" class="find-box-head"> 
  5. <?php _e( 'Attach to existing content' ); ?> 
  6. <button type="button" id="find-posts-close"><span class="screen-reader-text"><?php _e( 'Close media attachment panel' ); ?></button> 
  7. </div> 
  8. <div class="find-box-inside"> 
  9. <div class="find-box-search"> 
  10. <?php if ( $found_action ) { ?> 
  11. <input type="hidden" name="found_action" value="<?php echo esc_attr($found_action); ?>" /> 
  12. <?php } ?> 
  13. <input type="hidden" name="affected" id="affected" value="" /> 
  14. <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?> 
  15. <label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label> 
  16. <input type="text" id="find-posts-input" name="ps" value="" /> 
  17. <span class="spinner"></span> 
  18. <input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /> 
  19. <div class="clear"></div> 
  20. </div> 
  21. <div id="find-posts-response"></div> 
  22. </div> 
  23. <div class="find-box-buttons"> 
  24. <?php submit_button( __( 'Select' ), 'primary alignright', 'find-posts-submit', false ); ?> 
  25. <div class="clear"></div> 
  26. </div> 
  27. </div> 
  28. <?php