/**
 * Get rid of levels since these are mostly useless in newer versions of WordPress.  Devs should
 * add the `__return_false` filter to the `members_remove_old_levels` hook to utilize user levels.
 *
 * @since  0.1.0
 * @access public
 * @param  array  $caps
 * @return array
 */
function members_remove_old_levels($caps)
{
    return apply_filters('members_remove_old_levels', true) ? array_diff($caps, members_get_old_levels()) : $caps;
}
Exemplo n.º 2
0
/**
 * Get rid of levels since these are mostly useless in newer versions of NXTClass.
 *
 * To remove this filter:
 * remove_filter( 'members_get_capabilities', 'members_remove_old_levels' );
 *
 * @since 0.1.0
 * @param $capabilities array All of the combined capabilities.
 * @return $capabilities array Capabilities with old user levels removed.
 */
function members_remove_old_levels($capabilities)
{
    return array_diff($capabilities, members_get_old_levels());
}