function bcg_get_options_menu() { ?> <li <?php if (bcg_is_home()) { ?> class="current"<?php } ?> ><a href="<?php echo bcg_get_home_url(); ?> "><?php _e("Posts", "bcg"); ?> </a></li> <?php if (bcg_current_user_can_post()) { ?> <li <?php if (bcg_is_post_create()) { ?> class="current"<?php } ?> ><a href="<?php echo bcg_get_home_url(); ?> /create"><?php _e("Create New Post", "bcg"); ?> </a></li> <?php } ?> <?php }
/** * register post form for Posting/editing * @return type */ public function register_form() { //make sure the Front end simple post plugin is active if (!function_exists('bp_new_simple_blog_post_form')) { return; } $post_status = 'draft'; $user_id = get_current_user_id(); $group_id = bp_get_current_group_id(); $settings = array('post_type' => bcg_get_post_type(), 'post_author' => $user_id, 'post_status' => $post_status, 'comment_status' => 'open', 'show_comment_option' => false, 'custom_field_title' => '', 'custom_fields' => array('_is_bcg_post' => array('type' => 'hidden', 'label' => '', 'default' => 1)), 'tax' => array(bcg_get_taxonomy() => array('include' => bcg_get_categories($group_id))), 'upload_count' => 3, 'has_post_thumbnail' => 1, 'current_user_can_post' => bcg_current_user_can_post(), 'update_callback' => array($this, 'on_save')); //use it to add extra fields or filter the post type etc $settings = apply_filters('bcg_form_args', $settings); $form = bp_new_simple_blog_post_form('bcg_form', $settings); }