Buddypress use custom post type to achieve that. You may not need a custom post type to do that. You can use a page as handler for your plugin and rewrite URLs so that your requested URL is redirected to that page.
Then from your plugin, you can use action hook template_redirect
. As you are using plugin, you do it like this
add_action('template_redirect', array(&$this,'my_custom_template'));
Now from my_custom_template
you can check the page id and serve a different template from your plugin or add filter the_content
if you only want to change the content of the page.
function my_custom_template(){
if( is_page($my_handler_page_id) ){
add_filter('the_content', array(&$this, 'my_custom_content'));
}
}
Now serve your desired content from my_custom_content
function
function my_custom_content($content){
$content = "<p>This is custom content</p>";
.....
return $content;
}
You can also set query_var
when rewriting URL to take different argument and sent different content checking that query_var
values.