function bcg_fix_category_permalink($catlink, $category_id) { if (!bcg_is_component() || !in_bcg_loop()) { return $catlink; } $permalink = trailingslashit(bcg_get_home_url()); //$cat = get_category( $category_id ); //think about the cat permalink, do we need it or not? return $permalink . bcg_get_taxonomy() . '/' . $category_id; //no need for category_name }
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 }
/** * This gets called when a post is saved/updated in the database * after create/edit action handled by BP simple front end post plugin * * @param int $post_id * @param boolean $is_new * @param type $form_object */ public function on_save($post_id, $is_new, $form_object) { $post_redirect = 'single'; $url = ''; if ($post_redirect == 'archive') { $url = bcg_get_home_url(); } elseif ($post_redirect == 'single' && get_post_status($post_id) == 'publish') { //go to single post $url = get_permalink($post_id); } if ($url) { bp_core_redirect($url); } }