Skip to content
Brandon Allen edited this page Apr 12, 2017 · 2 revisions

This page only applies if you've written custom code using a function, filter, or action from version 0.1.0. If this doesn't apply to you, you don't need to read on. A bajillion Internet bonus points will be awarded to those that read on anyway 😄!

The below lists each function as it was in version 0.1.0, followed by it's replacement in 1.0.0. For most functions/filters/actions, only the name changed, and it's usage remains the same. If this is not the case, further notes will be provided.

This fuction list is by no means exhaustive. The functions list only covers the main business logic of the plugin. If you were diving deeper than that, it's assumed you can search the codebase to find the replacement you need. All of the filters and actions should be covered. If nothing else, you can just turn on WP_DEBUG and let it tell you what to do.

NOTE: All deprecated functions, filters, and actions are targeted for removal in version 1.3.0. See Issue #7

Deprecated Functions

tba_bp_block_user( $user_id = 0, $length = 0, $unit = 'indefintely' )

BPBU_User::block( $user_id = 0, $length = 0, $unit = 'indefintely' )

tba_bp_unblock_user( $user_id = 0 )

BPBU_User::unblock( $user_id = 0 )

tba_bp_update_blocked_user_expiration( $user_id = 0, $length = 0, $unit = 'indefinitely' )

BPBU_User::update_expiration( $user_id = 0, $length = 0, $unit = 'indefinitely' )

tba_bp_get_blocked_user_expiration( $user_id = 0, $int = false )

BPBU_User::get_expiration( $user_id = 0 )

The $int parameter is no longer used. If you need an integer representation of the expiration time, just pass it through strtotime.

tba_bp_is_user_blocked( $user_id = 0 )

BPBU_User::is_blocked( $user_id = 0 )

tba_bp_get_blocked_user_ids()

BPBU_User::get_blocked_user_ids()

Deprecated Filters

apply_filters( 'tba_bp_block_users_expiration_units', $units )

apply_filters( 'bpbu_expiration_units', $units )

apply_filters( 'tba_bp_block_user_expiration_time', $expiration, $user_id, $length, $unit )

apply_filters( 'bpbu_update_user_blocked_expiration', $expiration, $user_id, $length, $unit )

apply_filters( 'tba_bp_get_blocked_user_expiration', $expiration, $user_id )

apply_filters( 'bpbu_get_user_blocked_expiration', $expiration, $user_id )

apply_filters( 'tba_bp_is_user_blocked', $blocked, $user_id )

apply_filters( 'bpbu_is_user_blocked', $blocked, $user_id )

apply_filters( 'tba_bp_get_blocked_user_ids', $user_ids )

apply_filters( 'bpbu_get_blocked_user_ids', $user_ids )

apply_filters( 'tba_bp_block_users_block_notifications_meta_keys', $meta_keys )

apply_filters( 'bpbu_block_notifications_meta_keys', $meta_keys )

apply_filters( 'tba_bp_block_users_block_notifications_value', $retval, $user_id, $meta_key, $single )

apply_filters( 'bpbu_block_notifications_value', $retval, $user_id, $meta_key, $single )

apply_filters( 'tba_bp_get_block_user_settings_message', $message, $user_id )

apply_filters( 'bpbu_get_block_user_settings_message', $message, $user_id )

Deprecated Actions

do_action( 'tba_bp_blocked_user', $user_id )

do_action( 'bpbu_user_blocked', $user_id )

do_action( 'tba_bp_unblocked_user', $user_id )

do_action( 'bpbu_user_unblocked', $user_id )

do_action_ref_array( 'tba_bp_prevent_blocked_user_login', array( $user_id, &$user ) )

This is now a filter, instead of an action. Pay close attention, as the parameters are reversed on the filter.

apply_filters( 'bpbu_prevent_blocked_user_login', $user, $user_id )

do_action( 'tba_bp_settings_block_user_before_save' )

do_action( 'bpbu_settings_block_user_before_save' )

do_action( 'tba_bp_settings_block_user_after_save' )

do_action( 'bpbu_settings_block_user_after_save' )

do_action( 'tba_bp_settings_screen_block_user' )

do_action( 'bpbu_settings_screen_block_user' )