' . $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 ) { // Get the form value $this_slug = bbp_get_form_option( $slug, $default, true ); // Slugs to check $core_slugs = apply_filters( 'bbp_slug_conflict_check', array( /** WordPress Core ****************************************************/ // Core Post Types 'post_base' => array( 'name' => __( 'Posts' ), 'default' => 'post' ), 'page_base' => array( 'name' => __( 'Pages' ), 'default' => 'page' ), 'revision_base' => array( 'name' => __( 'Revisions' ), 'default' => 'revision' ), 'attachment_base' => array( 'name' => __( 'Attachments' ), 'default' => 'attachment' ), 'nav_menu_base' => array( 'name' => __( 'Menus' ), 'default' => 'nav_menu_item' ), // Post Tags 'tag_base' => array( 'name' => __( 'Tag base' ), 'default' => 'tag' ), // Post Categories 'category_base' => array( 'name' => __( 'Category base' ), 'default' => 'category' ), /** bbPress Core ******************************************************/ // Forum archive slug '_bbp_root_slug' => array( 'name' => __( 'Forums base', 'bbpress' ), 'default' => 'forums' ), // Topic archive slug '_bbp_topic_archive_slug' => array( 'name' => __( 'Topics base', 'bbpress' ), 'default' => 'topics' ), // Forum slug '_bbp_forum_slug' => array( 'name' => __( 'Forum slug', 'bbpress' ), 'default' => 'forum' ), // Topic slug '_bbp_topic_slug' => array( 'name' => __( 'Topic slug', 'bbpress' ), 'default' => 'topic' ), // Reply slug '_bbp_reply_slug' => array( 'name' => __( 'Reply slug', 'bbpress' ), 'default' => 'reply' ), // User profile slug '_bbp_user_slug' => array( 'name' => __( 'User base', 'bbpress' ), 'default' => 'users' ), // View slug '_bbp_view_slug' => array( 'name' => __( 'View base', 'bbpress' ), 'default' => 'view' ), // Topic tag slug '_bbp_topic_tag_slug' => array( 'name' => __( 'Topic tag slug', 'bbpress' ), 'default' => 'topic-tag' ), ) ); // Loop through slugs to check foreach( $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 ) ) : ?>