Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum ID in Topics URL


  • dbungard
    Participant

    @dbungard

    I am in includes/common/template-tags.php

    I see

    
    /** URLs **********************************************************************/
    
    /**
     * Ouput the forum URL
     *
     * @since bbPress (r3979)
     *
     * @uses bbp_get_forums_url() To get the forums URL
     * @param string $path Additional path with leading slash
     */
    function bbp_forums_url( $path = '/' ) {
    	echo bbp_get_forums_url( $path );
    }
    	/**
    	 * Return the forum URL
    	 *
    	 * @since bbPress (r3979)
    	 *
    	 * @uses home_url() To get the home URL
    	 * @uses bbp_get_root_slug() To get the forum root location
    	 * @param string $path Additional path with leading slash
    	 */
    	function bbp_get_forums_url( $path = '/' ) {
    		return home_url( bbp_get_root_slug() . $path );
    	}
    
    /**
     * Ouput the forum URL
     *
     * @since bbPress (r3979)
     *
     * @uses bbp_get_topics_url() To get the topics URL
     * @param string $path Additional path with leading slash
     */
    function bbp_topics_url( $path = '/' ) {
    	echo bbp_get_topics_url( $path );
    }
    	/**
    	 * Return the forum URL
    	 *
    	 * @since bbPress (r3979)
    	 *
    	 * @uses home_url() To get the home URL
    	 * @uses bbp_get_topic_archive_slug() To get the topics archive location
    	 * @param string $path Additional path with leading slash
    	 * @return The URL to the topics archive
    	 */
    	function bbp_get_topics_url( $path = '/' ) {
    		return home_url( bbp_get_topic_archive_slug() . $path );
    	}
    

    I figure there MUST be a way to add the forum to the topics URL. I’m doing this because I have a action based upon the URL string and need to have all things on that forum associated with that at a URL level. Any ideas?

Viewing 1 replies (of 1 total)

  • dbungard
    Participant

    @dbungard

    Or maybe it’s down here

    
    /**
     * Output the view url
     *
     * @since bbPress (r2789)
     *
     * @param string $view Optional. View id
     * @uses bbp_get_view_url() To get the view url
     */
    function bbp_view_url( $view = false ) {
    	echo bbp_get_view_url( $view );
    }
    	/**
    	 * Return the view url
    	 *
    	 * @since bbPress (r2789)
    	 *
    	 * @param string $view Optional. View id
    	 * @uses sanitize_title() To sanitize the view id
    	 * @uses home_url() To get blog home url
    	 * @uses add_query_arg() To add custom args to the url
    	 * @uses apply_filters() Calls 'bbp_get_view_url' with the view url,
    	 *                        used view id
    	 * @return string View url (or home url if the view was not found)
    	 */
    	function bbp_get_view_url( $view = false ) {
    		global $wp_rewrite;
    
    		$view = bbp_get_view_id( $view );
    		if ( empty( $view ) )
    			return home_url();
    
    		// Pretty permalinks
    		if ( $wp_rewrite->using_permalinks() ) {
    			$url = $wp_rewrite->root . bbp_get_view_slug() . '/' . $view;
    			$url = home_url( user_trailingslashit( $url ) );
    
    		// Unpretty permalinks
    		} else {
    			$url = add_query_arg( array( 'bbp_view' => $view ), home_url( '/' ) );
    		}
    
    		return apply_filters( 'bbp_get_view_link', $url, $view );
    	}
    

    Please someone help – I am a designer not a programer – honestly I hadn’t realized that bbpress WOULDN”T have the forum name associated with the topic…

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.