Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/21/2014 06:24:16 PM (7 years ago)
Author:
imath
Message:

Remove all links in titles of directory and single item pages

Since BuddyPress 1.7, to display the "Create" buttons (Blogs & Groups component) and links to the single item landing pages at a similar place to BP-Default, BP Theme Compat was adding links into the title of the WordPress post object. For 2.2, team has decided to remove all these links and find a better placement for them before the end of the dev-cycle.

See #6008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-screens.php

    r8682 r9157  
    142142    public function directory_dummy_post() {
    143143
    144         $title = apply_filters( 'bp_blogs_directory_header', __( 'Sites', 'buddypress' ) );
     144        bp_theme_compat_reset_post( array(
     145            'ID'             => 0,
     146            'post_title'     => __( 'Sites', 'buddypress' ),
     147            'post_author'    => 0,
     148            'post_date'      => 0,
     149            'post_content'   => '',
     150            'post_type'      => 'page',
     151            'post_status'    => 'publish',
     152            'is_page'        => true,
     153            'comment_status' => 'closed'
     154        ) );
     155    }
     156
     157    /**
     158     * Filter the_content with the groups index template part.
     159     *
     160     * @since BuddyPress (1.7.0)
     161     */
     162    public function directory_content() {
     163        return bp_buffer_template_part( 'blogs/index', null, false );
     164    }
     165
     166    /** Create ****************************************************************/
     167
     168    /**
     169     * Add custom template hierarchy to theme compat for the blog create page.
     170     *
     171     * This is to mirror how WordPress has
     172     * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
     173     *
     174     * @since BuddyPress (1.8.0)
     175     *
     176     * @param string $templates The templates from
     177     *        bp_get_theme_compat_templates().
     178     * @return array $templates Array of custom templates to look for.
     179     */
     180    public function create_template_hierarchy( $templates ) {
     181        // Setup our templates based on priority
     182        $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array(
     183            'blogs/index-create.php'
     184        ) );
     185
     186        // Merge new templates with existing stack
     187        // @see bp_get_theme_compat_templates()
     188        $templates = array_merge( (array) $new_templates, $templates );
     189
     190        return $templates;
     191    }
     192
     193    /**
     194     * Update the global $post with create screen data.
     195     *
     196     * @since BuddyPress (1.7.0)
     197     */
     198    public function create_dummy_post() {
     199
     200        // Title based on ability to create blogs
     201        if ( is_user_logged_in() && bp_blog_signup_enabled() ) {
     202            $title = __( 'Create a Site', 'buddypress' );
     203        } else {
     204            $title = __( 'Sites', 'buddypress' );
     205        }
    145206
    146207        bp_theme_compat_reset_post( array(
     
    158219
    159220    /**
    160      * Filter the_content with the groups index template part.
    161      *
    162      * @since BuddyPress (1.7.0)
    163      */
    164     public function directory_content() {
    165         return bp_buffer_template_part( 'blogs/index', null, false );
    166     }
    167 
    168     /** Create ****************************************************************/
    169 
    170     /**
    171      * Add custom template hierarchy to theme compat for the blog create page.
    172      *
    173      * This is to mirror how WordPress has
    174      * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
    175      *
    176      * @since BuddyPress (1.8.0)
    177      *
    178      * @param string $templates The templates from
    179      *        bp_get_theme_compat_templates().
    180      * @return array $templates Array of custom templates to look for.
    181      */
    182     public function create_template_hierarchy( $templates ) {
    183         // Setup our templates based on priority
    184         $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array(
    185             'blogs/index-create.php'
    186         ) );
    187 
    188         // Merge new templates with existing stack
    189         // @see bp_get_theme_compat_templates()
    190         $templates = array_merge( (array) $new_templates, $templates );
    191 
    192         return $templates;
    193     }
    194 
    195     /**
    196      * Update the global $post with create screen data.
    197      *
    198      * @since BuddyPress (1.7.0)
    199      */
    200     public function create_dummy_post() {
    201 
    202         // Title based on ability to create blogs
    203         if ( is_user_logged_in() && bp_blog_signup_enabled() ) {
    204             $title = '<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '">' . __( 'Sites', 'buddypress' ) . '</a>&nbsp;' . __( 'Create a Site', 'buddypress' );
    205         } else {
    206             $title = __( 'Sites', 'buddypress' );
    207         }
    208 
    209         bp_theme_compat_reset_post( array(
    210             'ID'             => 0,
    211             'post_title'     => $title,
    212             'post_author'    => 0,
    213             'post_date'      => 0,
    214             'post_content'   => '',
    215             'post_type'      => 'page',
    216             'post_status'    => 'publish',
    217             'is_page'        => true,
    218             'comment_status' => 'closed'
    219         ) );
    220     }
    221 
    222     /**
    223221     * Filter the_content with the create screen template part.
    224222     *
Note: See TracChangeset for help on using the changeset viewer.