Ticket #46795: 46795.diff
File 46795.diff, 1.5 KB (added by , 6 years ago) |
---|
-
src/wp-admin/includes/post.php
1185 1185 } 1186 1186 1187 1187 /** 1188 * Get all available post MIME types for a given post type.1189 *1190 * @since 2.5.01191 *1192 * @global wpdb $wpdb WordPress database abstraction object.1193 *1194 * @param string $type1195 * @return mixed1196 */1197 function get_available_post_mime_types( $type = 'attachment' ) {1198 global $wpdb;1199 1200 $types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type ) );1201 return $types;1202 }1203 1204 /**1205 1188 * Get the query variables for the current attachments request. 1206 1189 * 1207 1190 * @since 4.2.0 -
src/wp-includes/post.php
6891 6891 function wp_cache_set_posts_last_changed() { 6892 6892 wp_cache_set( 'last_changed', microtime(), 'posts' ); 6893 6893 } 6894 6895 /** 6896 * Get all available post MIME types for a given post type. 6897 * 6898 * @since 2.5.0 6899 * 6900 * @global wpdb $wpdb WordPress database abstraction object. 6901 * 6902 * @param string $type 6903 * @return mixed 6904 */ 6905 function get_available_post_mime_types( $type = 'attachment' ) { 6906 global $wpdb; 6907 6908 $types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type ) ); 6909 return $types; 6910 }