Title: [Plugin: WP-Lifestream2] Custom Post_Type support ?
Last modified: August 20, 2016

---

# [Plugin: WP-Lifestream2] Custom Post_Type support ?

 *  [anthonymasure](https://wordpress.org/support/users/anthonymasure/)
 * (@anthonymasure)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-lifestream2-custom-post_type-support/)
 * Hi,
 * Than you for upgrading the original Lifestream Plugin (maybe you can tell about
   the fork source in the description, because it confused people).
 * I’ve seen that the plugin create a custom post_type ‘lsevent’ for each event 
   imported.
 * The code who register the post_type is located in inc/core.php line 662 :
 *     ```
       register_post_type('lsevent', array(
       			'label' => $this->__('Lifestream Events'),
       			'singular_label' => $this->__('Lifestream Event'),
       			'show_ui' => false,
       			'public' => true,
       			'exclude_from_search' => true,
       			'hierarchical' => false,
       			'capability_type' => 'post',
       			'rewrite' => array('slug', 'lifestream'),
       			'query_var' => false,
       			'can_export' => false,
       			'show_in_nav_menus' => false,
       			'supports' => array('title', 'comments')
       		));
       ```
   
 * The n, the function who create a post_type for each event is located line 1961:
 *     ```
       function create_post_for_event($event)
       	{
       		global $wpdb;
   
       		// TODO: find a better title
       		$post = array(
       			'post_title' => 'Lifestream Event',
       			'post_content' => '',
       			'post_status' => 'publish',
       			'post_author' => $event->owner_id,
       			'post_type' => 'lsevent',
       			// should we insert the feed types into the tags?
       			// 'tags_input' => ''
       			'post_date' => date('Y-m-d H:i:s', $event->timestamp),
       		);
       		$post_id = wp_insert_post($post);
       		$event->post_id = $post_id;
       		$event_list = array();
       		if ($event->is_grouped)
       		{
       			$wpdb->query($wpdb->prepare("UPDATE <code>&quot;.$wpdb->prefix.&quot;lifestream_event_group</code> set <code>post_id</code> = %d WHERE <code>id</code> = %d", $event->post_id, $event->id));
       			foreach ($event->data as $event)
       			{
       				// TODO: append to $event_list
       			}
       		}
       		else
       		{
       			$event_list[] = $event;
       		}
       		// TODO: process event list and update post ids
       	}
       ```
   
 * So, my goal is to extend the possibilities of the plugin by using custom post_types
   capabilities : edit, tags, categories, thumbnails…
 * I’m able to show ‘lsevent’ post_types in WP Admin with this code :
 *     ```
       register_post_type('lsevent', array(
       'label' => 'Lifestream',
       'singular_label' => 'Event',
       'show_ui' => true,
       'public' => true,
       'exclude_from_search' => true,
       'hierarchical' => false,
       'capability_type' => 'post',
       'rewrite' => true,
       'query_var' => true,
       'can_export' => false,
       'show_in_nav_menus' => false,
       'menu_position' => 4,
       'supports' => array('editor', 'title','excerpt', 'custom-fields', 'thumbnail'),
       'taxonomies' => array('category', 'post_tag'), // this is IMPORTANT
       '_builtin' => false, // It's a custom post type, not built in!
       ));
       ```
   
 * But, the problem is that all ‘lsevent’ post_types are empty (they don’t have 
   content), so for the moment it’s useless to query them.
 * So, my question is : How can I do do allow the plugin to import the events contents
   in the post_types ? The content can be included in the content box and in the
   title… With this way of thinking, we will be able to categorize event, for exemple
   to query all events (google reader, tweets…) relative to “WordPress” subject,
   usefull !
 * Thanks a lot for your advices.
    Anthony (from Paris)
 * [http://wordpress.org/extend/plugins/wp-lifestream2/](http://wordpress.org/extend/plugins/wp-lifestream2/)

The topic ‘[Plugin: WP-Lifestream2] Custom Post_Type support ?’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-lifestream2.svg)
 * [WP-Lifestream2](https://wordpress.org/plugins/wp-lifestream2/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-lifestream2/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-lifestream2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-lifestream2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-lifestream2/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [anthonymasure](https://wordpress.org/support/users/anthonymasure/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-wp-lifestream2-custom-post_type-support/)
 * Status: not a support question