bp_core_filter_edit_post_link

Filter the edit post link to avoid its display in BuddyPress pages.

Description

(bool|string) bp_core_filter_edit_post_link( (string) $edit_link = '', (int) $post_id = 0 ); 

Returns (bool|string)

Will be a boolean (false) if $post_id is 0. Will be a string (the unchanged edit link) otherwise

Parameters (2)

0. $edit_link — Optional. (string) => ''
The edit link.
1. $post_id — Optional. (int)
The post id.

Usage

  1. if ( !function_exists( 'bp_core_filter_edit_post_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-filters.php'; 
  3.  
  4. // The edit link. 
  5. $edit_link = ''; 
  6.  
  7. // The post id. 
  8. $post_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_core_filter_edit_post_link($edit_link, $post_id); 
  12.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-filters.php  
  1. function bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 ) { 
  2. if ( 0 === $post_id ) { 
  3. $edit_link = false; 
  4.  
  5. return $edit_link;