Skip to:

Opened 13 years ago

Closed 13 years ago

Last modified 8 years ago

#3314 closed enhancement (fixed)

Global constant reduction initiative

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by:
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Core Keywords:


This should be mostly find/replace - let's get the global constants under control and inside wrapper functions for 1.3.

Change History (13)

#1 @johnjamesjacoby
13 years ago

(In [4602]) * Swap BP_ROOT_BLOG const usage for new bp_get_root_blog_id() function

  • Use bp_get_root_blog_id() place of bp_get_option_blog_id()
  • Check for BP_ENABLE_MULTIBLOG when assigning root blog ID

See #3313, #3314.

#2 @boonebgorges
13 years ago

(In [4628]) Introduces wrapper function bp_is_username_compatibility_mode() and refactors to avoid direct constant checks throughout BP. See #3314

#3 @boonebgorges
13 years ago

(In [4629]) One more bp_is_username_compatibility_mode() fix. See #3314

#4 @boonebgorges
13 years ago

(In [4630]) Introduces bp_is_multiblog_mode() to reduce BP_ENABLE_MULTIBLOG checks throughout. See #3314

#5 @boonebgorges
13 years ago

(In [4631]) Introduces bp_use_wp_admin_bar() to reduce BP_USE_WP_ADMIN_BAR checks throughout BP. See #3314

#6 @boonebgorges
13 years ago

(In [4632]) Introduces wrapper functions for avatar-related constants. Also moves avatar settings into bp global so that they are more easily configurable. See #3314

#7 @boonebgorges
13 years ago

(In [4634]) Introduces bp_xprofile_fullname_field_name() to avoid referencing BP_XPROFILE_FULLNAME_FIELD_NAME throughout BuddyPress. See #3314

#8 @boonebgorges
13 years ago

(In [4635]) Introduces bp_forums_parent_forum_id() to avoid constant referencing throughout. See #3314

#9 @boonebgorges
13 years ago

(In [4636]) Cleanup of avatar constant references. See #3314

#10 @boonebgorges
13 years ago

(In [4637]) Removes bare reference to BP_REGISTER_SLUG. See #3314

#11 @boonebgorges
13 years ago

Forgot to mention this ticket in r4638, which cleans up references to BP_X_SLUG throughout.

#12 @boonebgorges
13 years ago

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

I believe I've cleaned up the egregious instances of the problem in question.

The only large class of constants remaining is BP_PLUGIN_URL and BP_PLUGIN_DIR. I haven't changed those, because it seems common enough practice in WP to use constants for this kind of thing. See ABSPATH, etc.

The remaining references to constants are generally singletons, and not really worth patching.

Marking this ticket as resolved, to clear the milestone a bit. If you have more specific instances you want to take care of, please reopen.

#13 @DJPaul
8 years ago

  • Type changed from task to enhancement
Note: See TracTickets for help on using tickets.