Changeset 1263350
- Timestamp:
- 10/11/2015 03:58:51 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-content-protection/trunk/include/wpcp-functions.php
r1187257 r1263350 46 46 * Get available post type which is used for creating an posts. 47 47 */ 48 49 50 51 function wpcp_get_available_post_type() { 52 53 global $wpdb; 48 function wpcp_get_available_post_type() { 49 50 $list_posttype =array('page','post'); 51 52 $custom_post_types = get_post_types( array( 53 // Set to FALSE to return only custom post types 54 '_builtin' => FALSE, 55 // Set to TRUE to return only public post types 56 'public' => true 57 ) ); 58 59 if($custom_post_types){ 60 foreach($custom_post_types as $post_type){ 61 $list_posttype[]= $post_type; 62 } 63 } 64 /* global $wpdb; 54 65 $sql_posttype = "SELECT DISTINCT `post_type` FROM " . $wpdb->prefix . "posts WHERE `post_status`='publish' "; 55 66 $arr_posttype = $wpdb->get_results($sql_posttype); 56 return $arr_posttype; 67 return $arr_posttype;*/ 68 return $list_posttype; 57 69 } 58 70
Note: See TracChangeset
for help on using the changeset viewer.