[buddypress-trac] [BuddyPress] #2945: Don't hard-code the 'buddypress' plugin folder
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Wed Jun 13 07:52:36 UTC 2012
#2945: Don't hard-code the 'buddypress' plugin folder
--------------------------+------------------
Reporter: cnorris23 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 1.6
Component: Core | Version: 1.5
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+------------------
Comment (by cnorris23):
New patch should fix admin/bp-core-update.php. Two things
1) I'd still like to see BP use
{{{
define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}}}
instead of
{{{
define( 'BP_PLUGIN_DIR', trailingslashit( WP_PLUGIN_DIR . '/buddypress' )
);
}}}
This way, a folder name change can be made, and BP will adjust
automagically ;) The global can still be defined for more fine-grained
control/trickery.
2) The only other thing I can see that will keep this ticket from being
fixed is
{{{
add_action( 'in_plugin_update_message-buddypress/bp-loader.php',
'bp_core_update_message' );
}}}
Until BP gets that fancy singleton that johnjamesjacoby added to bbPress,
it might be good to add something like
{{{
function bp_get_global_property( $prop = '' ) {
if ( empty( $prop ) )
return false;
global $bp;
if ( !isset( $bp->{$prop} ) )
return false;
return $bp->{$prop};
}
}}}
This could mitigate the add_action issue and would even be helpful in
cases like those in the patch where I had to add the $bp global just to
get $bp->file for plugins_url(). Of course, we can always more constants
;)
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/2945#comment:13>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list