Skip to:
Content

BuddyPress.org

Changeset 8994


Ignore:
Timestamp:
09/08/2014 06:47:36 PM (10 years ago)
Author:
r-a-y
Message:

Remove 'Edit' post link on BuddyPress pages.

Changes in bp_core_load_template() (r8932) to set the post to the current
BP directory page and #5418 to set the post type to 'page' resulted in
showing the "Edit" post link at the bottom of BuddyPress pages and in
the WP Toolbar for users with the 'edit_post' capability.

Since the "Edit" post link does not make sense on BuddyPress pages, this
commit manually removes the 'Edit' post link from rendering on BuddyPress
pages and in the WP Toolbar.

Fixes #5853.

Location:
trunk/src/bp-core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-adminbar.php

    r8764 r8994  
    4040            )
    4141        ) );
     42
     43        // Remove 'Edit' post link as it's not applicable to BP
     44        // Remove when https://core.trac.wordpress.org/ticket/29538 is addressed
     45        if ( is_buddypress() ) {
     46            $wp_admin_bar->remove_node( 'edit' );
     47        }
    4248    }
    4349}
  • trunk/src/bp-core/bp-core-theme-compatibility.php

    r7794 r8994  
    557557    // If we are resetting a post, we are in theme compat
    558558    bp_set_theme_compat_active( true );
     559
     560    // If we are in theme compat, we don't need the 'Edit' post link
     561    add_filter( 'get_edit_post_link', '__return_false' );
    559562}
    560563
Note: See TracChangeset for help on using the changeset viewer.