Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#657 closed defect (bug) (fixed)

bp-custom file not working after upgrade

Reported by: jag25's profile jag25 Owned by:
Milestone: Priority: major
Severity: Version:
Component: Keywords:
Cc: lance@…

Description

I have the following code in my bp-custom.php file to avoid displaying the admin bar...

<?php
remove_action( 'wp_footer', 'bp_core_admin_bar', 8 );
remove_action( 'wp_head', 'bp_core_admin_bar_css' );
?>

I have upgraded to the latest trunk (1324) and the latest branch of WPMU, and now the bar is shown all the time.

The bp-custom file is now in the wp-content/plugins/buddypress directory so I'm not sure if it needs to be moved somewhere else.

Change History (5)

#1 @lancewillett
15 years ago

  • Cc lance@… added

jag25, I know this might not entirely solve your issue, but as of [1270] you can now disable the admin bar like this (in your wp-config file:

define('BP_DISABLE_ADMIN_BAR', true);

That way you don't need any of those calls in your bp-custom file.

#2 @jag25
15 years ago

Thanks, lance. That did disable the admin bar.

However, I noticed that none of my remove actions are working, not just those two. It's as if the bp-custom file is being completely ignored.

#3 @jag25
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

I just wanted to point out that bp-custom file does work. The only problem is that the remove actions are getting ignored or not executed.

The solution was to move the bp-custom file to the plugins' directory and treat it as such.

#4 @burtadsit
15 years ago

Any remove_actions() will never work if they are just bare php code in bp-custom.php. The bp-custom.php file is loaded before *all* of bp. No bp actions are defined when it gets loaded. Can't remove what is not there yet. A solution would be to wrap any remove_action() calls in a function that gets triggered by 'wp' or 'init'. Anything that is certain to be triggered on each page load.

function my_remove_actions(){
remove_action('whateveractionhere');
}
add_action('wp','my_remove_actions');

#5 @nicolagreco
15 years ago

<?php
bp_custom_actions() {

remove_action( 'wp_footer', 'bp_core_admin_bar', 8 );
remove_action( 'wp_head', 'bp_core_admin_bar_css' );

}
add_action( 'plugins_loaded', 'bp_custom_actions', 1 );
?>

Note: See TracTickets for help on using tickets.