WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/25/2010 02:18:07 AM (11 years ago)
Author:
ryan
Message:

Allow searching custom post types when attaching media. Props markoheijnen. fixes #13229

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r14859 r14869  
    32763276                <input type="button" onclick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
    32773277
    3278                 <input type="radio" name="find-posts-what" id="find-posts-posts" checked="checked" value="posts" />
    3279                 <label for="find-posts-posts"><?php _e( 'Posts' ); ?></label>
    3280                 <input type="radio" name="find-posts-what" id="find-posts-pages" value="pages" />
    3281                 <label for="find-posts-pages"><?php _e( 'Pages' ); ?></label>
     3278                <?php
     3279                $post_types = get_post_types( array('public' => true), 'objects' );
     3280                foreach ( $post_types as $post ) {
     3281                    if ( 'attachment' == $post->name )
     3282                        continue;
     3283                ?>
     3284                <input type="radio" name="find-posts-what" id="find-posts-<?php echo esc_attr($post->name); ?>" value="<?php echo esc_attr($post->name); ?>" <?php checked($post->name,  'post'); ?> />
     3285                <label for="find-posts-<?php echo esc_attr($post->name); ?>"><?php echo $post->label; ?></label>
     3286                <?php
     3287                } ?>
    32823288            </div>
    32833289            <div id="find-posts-response"></div>
Note: See TracChangeset for help on using the changeset viewer.