Hi there, for some reason the tag
bp_is_profile_edit()
is breaking my site, while the rest of the tags likebp_is_user_profile()
listed here are fine. https://codex.buddypress.org/developer/template-tag-reference/#is_-functions
According to the documentation it should still work. Conditional template tags allow you to show specific content on specific pages. The following tags are available in BuddyPress (1.2+):Any idea why this specific template tag does not work?
Regards
CarstenHello Carsten,
Thank you for posting. Both function does the same thing. ‘bp_is_profile_edit’ is the older version of ‘bp_is_user_profile_edit’ which was deprecated since BuddyPress 1.5. You can use ‘bp_is_user_profile_edit’ in place of ‘bp_is_profile_edit’.
Regards
RaviHi Ravi, thanks again, you have been most helpful. For some reason it has no effect in this function, where this element should be hided on the /members/profilename/settings/ but I must look for a solution elsewhere.
add_filter( 'generate_hook_element_display', function( $display, $element_id ) { if ( 45256 === $element_id && bp_is_current_component( "bp-messages" ) || bp_is_settings_component() ) { $display = false; } return $display; }, 10, 2 );
Regards
CarstenHello Carsten,
Try the following code.
add_filter( 'generate_hook_element_display', function( $display, $element_id ) { // If element id is 45256 and current component is message. Not display. if ( 45256 == $element_id && bp_is_current_component( 'messages' ) ) { $display = false; } elseif ( bp_is_settings_component() ) { // If is settings component set display to false. $display = false; } return $display; }, 10, 2 );
Regards
RaviHello Carsten,
Try the follwing code.
add_filter( 'generate_hook_element_display', function ( $display, $element_id ) { if ( 45256 != $element_id ) { return $display; } // If message component or setting set display to false. if ( bp_is_messages_component() || bp_is_settings_component() ) { $display = false; } return $display; }, 10, 2 );
Regards
Ravi
You must be logged in to reply to this topic.