Skip to:
Content

BuddyPress.org

Changeset 9157


Ignore:
Timestamp:
11/21/2014 06:24:16 PM (10 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

Location:
trunk/src
Files:
3 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     *
  • trunk/src/bp-groups/bp-groups-screens.php

    r9027 r9157  
    11001100     */
    11011101    public function directory_dummy_post() {
    1102 
    1103         $title = apply_filters( 'bp_groups_directory_header', bp_get_directory_title( 'groups' ) );
     1102        bp_theme_compat_reset_post( array(
     1103            'ID'             => 0,
     1104            'post_title'     => bp_get_directory_title( 'groups' ),
     1105            'post_author'    => 0,
     1106            'post_date'      => 0,
     1107            'post_content'   => '',
     1108            'post_type'      => 'page',
     1109            'post_status'    => 'publish',
     1110            'is_page'        => true,
     1111            'comment_status' => 'closed'
     1112        ) );
     1113    }
     1114
     1115    /**
     1116     * Filter the_content with the groups index template part.
     1117     *
     1118     * @since BuddyPress (1.7.0)
     1119     */
     1120    public function directory_content() {
     1121        return bp_buffer_template_part( 'groups/index', null, false );
     1122    }
     1123
     1124    /** Create ************************************************************/
     1125
     1126    /**
     1127     * Add custom template hierarchy to theme compat for the group create page.
     1128     *
     1129     * This is to mirror how WordPress has
     1130     * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
     1131     *
     1132     * @since BuddyPress (1.8.0)
     1133     *
     1134     * @param string $templates The templates from bp_get_theme_compat_templates().
     1135     * @return array $templates Array of custom templates to look for.
     1136     */
     1137    public function create_template_hierarchy( $templates ) {
     1138        // Setup our templates based on priority
     1139        $new_templates = apply_filters( 'bp_template_hierarchy_groups_create', array(
     1140            'groups/index-create.php'
     1141        ) );
     1142
     1143        // Merge new templates with existing stack
     1144        // @see bp_get_theme_compat_templates()
     1145        $templates = array_merge( $new_templates, $templates );
     1146
     1147        return $templates;
     1148    }
     1149
     1150    /**
     1151     * Update the global $post with create screen data.
     1152     *
     1153     * @since BuddyPress (1.7.0)
     1154     */
     1155    public function create_dummy_post() {
     1156
     1157        $title = _x( 'Groups', 'Group creation page', 'buddypress' );
    11041158
    11051159        bp_theme_compat_reset_post( array(
     
    11171171
    11181172    /**
    1119      * Filter the_content with the groups index template part.
     1173     * Filter the_content with the create screen template part.
    11201174     *
    11211175     * @since BuddyPress (1.7.0)
    11221176     */
    1123     public function directory_content() {
    1124         return bp_buffer_template_part( 'groups/index', null, false );
    1125     }
    1126 
    1127     /** Create ************************************************************/
     1177    public function create_content() {
     1178        return bp_buffer_template_part( 'groups/create', null, false );
     1179    }
     1180
     1181    /** Single ************************************************************/
    11281182
    11291183    /**
    1130      * Add custom template hierarchy to theme compat for the group create page.
     1184     * Add custom template hierarchy to theme compat for group pages.
    11311185     *
    11321186     * This is to mirror how WordPress has
     
    11381192     * @return array $templates Array of custom templates to look for.
    11391193     */
    1140     public function create_template_hierarchy( $templates ) {
     1194    public function single_template_hierarchy( $templates ) {
     1195        // Setup some variables we're going to reference in our custom templates
     1196        $group = groups_get_current_group();
     1197
    11411198        // Setup our templates based on priority
    1142         $new_templates = apply_filters( 'bp_template_hierarchy_groups_create', array(
    1143             'groups/index-create.php'
     1199        $new_templates = apply_filters( 'bp_template_hierarchy_groups_single_item', array(
     1200            'groups/single/index-id-'     . sanitize_file_name( bp_get_current_group_id() )   . '.php',
     1201            'groups/single/index-slug-'   . sanitize_file_name( bp_get_current_group_slug() ) . '.php',
     1202            'groups/single/index-action-' . sanitize_file_name( bp_current_action() )         . '.php',
     1203            'groups/single/index-status-' . sanitize_file_name( $group->status )              . '.php',
     1204            'groups/single/index.php'
    11441205        ) );
    11451206
    11461207        // Merge new templates with existing stack
    11471208        // @see bp_get_theme_compat_templates()
    1148         $templates = array_merge( $new_templates, $templates );
     1209        $templates = array_merge( (array) $new_templates, $templates );
    11491210
    11501211        return $templates;
     
    11521213
    11531214    /**
    1154      * Update the global $post with create screen data.
     1215     * Update the global $post with single group data.
    11551216     *
    11561217     * @since BuddyPress (1.7.0)
    11571218     */
    1158     public function create_dummy_post() {
    1159 
    1160         $title = _x( 'Groups', 'Group creation page', 'buddypress' );
    1161 
     1219    public function single_dummy_post() {
    11621220        bp_theme_compat_reset_post( array(
    11631221            'ID'             => 0,
    1164             'post_title'     => $title,
     1222            'post_title'     => bp_get_current_group_name(),
    11651223            'post_author'    => 0,
    11661224            'post_date'      => 0,
     
    11741232
    11751233    /**
    1176      * Filter the_content with the create screen template part.
    1177      *
    1178      * @since BuddyPress (1.7.0)
    1179      */
    1180     public function create_content() {
    1181         return bp_buffer_template_part( 'groups/create', null, false );
    1182     }
    1183 
    1184     /** Single ************************************************************/
    1185 
    1186     /**
    1187      * Add custom template hierarchy to theme compat for group pages.
    1188      *
    1189      * This is to mirror how WordPress has
    1190      * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
    1191      *
    1192      * @since BuddyPress (1.8.0)
    1193      *
    1194      * @param string $templates The templates from bp_get_theme_compat_templates().
    1195      * @return array $templates Array of custom templates to look for.
    1196      */
    1197     public function single_template_hierarchy( $templates ) {
    1198         // Setup some variables we're going to reference in our custom templates
    1199         $group = groups_get_current_group();
    1200 
    1201         // Setup our templates based on priority
    1202         $new_templates = apply_filters( 'bp_template_hierarchy_groups_single_item', array(
    1203             'groups/single/index-id-'     . sanitize_file_name( bp_get_current_group_id() )   . '.php',
    1204             'groups/single/index-slug-'   . sanitize_file_name( bp_get_current_group_slug() ) . '.php',
    1205             'groups/single/index-action-' . sanitize_file_name( bp_current_action() )         . '.php',
    1206             'groups/single/index-status-' . sanitize_file_name( $group->status )              . '.php',
    1207             'groups/single/index.php'
    1208         ) );
    1209 
    1210         // Merge new templates with existing stack
    1211         // @see bp_get_theme_compat_templates()
    1212         $templates = array_merge( (array) $new_templates, $templates );
    1213 
    1214         return $templates;
    1215     }
    1216 
    1217     /**
    1218      * Update the global $post with single group data.
    1219      *
    1220      * @since BuddyPress (1.7.0)
    1221      */
    1222     public function single_dummy_post() {
    1223         bp_theme_compat_reset_post( array(
    1224             'ID'             => 0,
    1225             'post_title'     => '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . bp_get_current_group_name() . '</a>',
    1226             'post_author'    => 0,
    1227             'post_date'      => 0,
    1228             'post_content'   => '',
    1229             'post_type'      => 'page',
    1230             'post_status'    => 'publish',
    1231             'is_page'        => true,
    1232             'comment_status' => 'closed'
    1233         ) );
    1234     }
    1235 
    1236     /**
    12371234     * Filter the_content with the single group template part.
    12381235     *
  • trunk/src/bp-members/bp-members-screens.php

    r9109 r9157  
    236236    // grab the key (the old way)
    237237    $key = isset( $_GET['key'] ) ? $_GET['key'] : '';
    238  
     238
    239239    // grab the key (the new way)
    240240    if ( empty( $key ) ) {
     
    246246        return;
    247247    }
    248  
     248
    249249    // Activate the signup
    250250    $user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) );
     
    426426        bp_theme_compat_reset_post( array(
    427427            'ID'             => 0,
    428             'post_title'     => '<a href="' . bp_get_displayed_user_link() . '">' . bp_get_displayed_user_fullname() . '</a>',
     428            'post_title'     => bp_get_displayed_user_fullname(),
    429429            'post_author'    => 0,
    430430            'post_date'      => 0,
Note: See TracChangeset for help on using the changeset viewer.