/** * Loop temporary filter: set pagination base * * @package WP Idea Stream * @subpackage buddypress/groups * * @since 2.0.0 * * @param array $pagination_args the default paginate arguments * @uses bp_is_group() to check a group is displayed * @uses wp_idea_stream_tag_get_slug() to get the ideas tag taxonomy slug * @uses wp_idea_stream_category_get_slug() to get the ideas category taxonomy slug * @uses WP_Idea_Stream_Group->group_ideas_archive_url() to get the group's IdeaStream archive page * @return array the paginate arguments adapted to group's context */ public function set_pagination_base($pagination_args = '') { if (!bp_is_group()) { return $pagination_args; } // Initialize base $base = ''; switch ($this->group_ideastream->is_action) { case wp_idea_stream_category_slug(): case wp_idea_stream_tag_get_slug(): $base = trailingslashit($this->group_ideas_archive_url() . '/' . $this->group_ideastream->is_action . '/' . $this->group_ideastream->current_term->slug); break; default: $base = trailingslashit($this->group_ideas_archive_url()); break; } $pagination_args['base'] = $base . '%_%'; return $pagination_args; }
/** * Build the tag slug (root + tag ones) * * @package WP Idea Stream * @subpackage core/options * * @since 2.0.0 * * @uses apply_filters() call 'wp_idea_stream_tag_slug' to override value * @uses wp_idea_stream_root_slug() to get root slug * @uses wp_idea_stream_tag_get_slug() to get tag slug * @return string the tag slug (prefixed by the root one) */ function wp_idea_stream_tag_slug() { return apply_filters('wp_idea_stream_tag_slug', wp_idea_stream_root_slug() . '/' . wp_idea_stream_tag_get_slug()); }
/** * Tag slug of the plugin * * @package WP Idea Stream * @subpackage admin/settings * * @since 2.0.0 * * @uses esc_attr() to sanitize the attribute * @uses wp_idea_stream_tag_get_slug() to get the active slug * @return string HTML output */ function wp_idea_stream_tag_slug_setting_callback() { ?> <input name="_ideastream_tag_slug" id="_ideastream_tag_slug" type="text" class="regular-text code" value="<?php echo esc_attr(wp_idea_stream_tag_get_slug()); ?> " /> <?php }