' . $paragraph . '
'; // Add help add_contextual_help( 'settings_page_bbpress', $contextual_help ); } /** * Output settings API option * * @since bbPress (r3203) * * @uses bbp_get_bbp_form_option() * * @param string $option * @param string $default * @param bool $slug */ function bbp_form_option( $option, $default = '' , $slug = false ) { echo bbp_get_form_option( $option, $default, $slug ); } /** * Return settings API option * * @since bbPress (r3203) * * @uses get_option() * @uses esc_attr() * @uses apply_filters() * * @param string $option * @param string $default * @param bool $slug */ function bbp_get_form_option( $option, $default = '', $slug = false ) { // Get the option and sanitize it $value = get_option( $option, $default ); // Slug? if ( true === $slug ) $value = esc_attr( apply_filters( 'editable_slug', $value ) ); // Not a slug else $value = esc_attr( $value ); // Fallback to default if ( empty( $value ) ) $value = $default; // Allow plugins to further filter the output return apply_filters( 'bbp_get_form_option', $value, $option ); } /** * Used to check if a bbPress slug conflicts with an existing known slug. * * @since bbPress (r3306) * * @param string $slug * @param string $default * * @uses bbp_get_form_option() To get a sanitized slug string */ function bbp_form_slug_conflict_check( $slug, $default ) { // Only set the slugs once ver page load static $the_core_slugs = array(); // Get the form value $this_slug = bbp_get_form_option( $slug, $default, true ); if ( empty( $the_core_slugs ) ) { // Slugs to check $core_slugs = apply_filters( 'bbp_slug_conflict_check', array( /** WordPress Core ****************************************************/ // Core Post Types 'post_base' => array( 'name' => __( 'Posts' ), 'default' => 'post', 'context' => 'WordPress' ), 'page_base' => array( 'name' => __( 'Pages' ), 'default' => 'page', 'context' => 'WordPress' ), 'revision_base' => array( 'name' => __( 'Revisions' ), 'default' => 'revision', 'context' => 'WordPress' ), 'attachment_base' => array( 'name' => __( 'Attachments' ), 'default' => 'attachment', 'context' => 'WordPress' ), 'nav_menu_base' => array( 'name' => __( 'Menus' ), 'default' => 'nav_menu_item', 'context' => 'WordPress' ), // Post Tags 'tag_base' => array( 'name' => __( 'Tag base' ), 'default' => 'tag', 'context' => 'WordPress' ), // Post Categories 'category_base' => array( 'name' => __( 'Category base' ), 'default' => 'category', 'context' => 'WordPress' ), /** bbPress Core ******************************************************/ // Forum archive slug '_bbp_root_slug' => array( 'name' => __( 'Forums base', 'bbpress' ), 'default' => 'forums', 'context' => 'bbPress' ), // Topic archive slug '_bbp_topic_archive_slug' => array( 'name' => __( 'Topics base', 'bbpress' ), 'default' => 'topics', 'context' => 'bbPress' ), // Forum slug '_bbp_forum_slug' => array( 'name' => __( 'Forum slug', 'bbpress' ), 'default' => 'forum', 'context' => 'bbPress' ), // Topic slug '_bbp_topic_slug' => array( 'name' => __( 'Topic slug', 'bbpress' ), 'default' => 'topic', 'context' => 'bbPress' ), // Reply slug '_bbp_reply_slug' => array( 'name' => __( 'Reply slug', 'bbpress' ), 'default' => 'reply', 'context' => 'bbPress' ), // User profile slug '_bbp_user_slug' => array( 'name' => __( 'User base', 'bbpress' ), 'default' => 'users', 'context' => 'bbPress' ), // View slug '_bbp_view_slug' => array( 'name' => __( 'View base', 'bbpress' ), 'default' => 'view', 'context' => 'bbPress' ), // Topic tag slug '_bbp_topic_tag_slug' => array( 'name' => __( 'Topic tag slug', 'bbpress' ), 'default' => 'topic-tag', 'context' => 'bbPress' ), ) ); /** BuddyPress Core *******************************************************/ if ( defined( 'BP_VERSION' ) ) { global $bp; // Loop through root slugs and check for conflict if ( !empty( $bp->pages ) ) { foreach ( $bp->pages as $page => $page_data ) { $page_base = $page . '_base'; $page_title = sprintf( __( '%s page', 'bbpress' ), $page_data->title ); $core_slugs[$page_base] = array( 'name' => $page_title, 'default' => $page_data->slug, 'context' => 'BuddyPress' ); } } } // Set the static $the_core_slugs = apply_filters( 'bbp_slug_conflict', $core_slugs ); } // Loop through slugs to check foreach( $the_core_slugs as $key => $value ) { // Get the slug $slug_check = bbp_get_form_option( $key, $value['default'], true ); // Compare if ( ( $slug != $key ) && ( $slug_check == $this_slug ) ) : ?> %2$s', 'bbpress' ), $value['context'], $value['name'] ); ?>