Re: Plugin Hall of Shame! :) Plugin Devs Please Read
@Andy Peatling – Very sad to be in hall of shame
1) Version 0.1.6 of BP Album+ that is posted on the WordPress plugin repository checks that BP is installed exactly as you have specified. Can you be a bit more specific about the defect?
2) I completely agree that current_user_can() is a better way to check for permissions in various plugin operations; and we will switch to the new function at the next BP Album+ release as per your request. In the meantime, why is using is_site_admin() so bad? Doesn’t current_user_can() just pass the call to is_site_admin() ?
/**
* Whether current user has capability or role.
*
* @since 2.0.0
*
* @param string $capability Capability or role name.
* @return bool
*/
function current_user_can( $capability ) {
$current_user = wp_get_current_user();
if( is_site_admin() ) <—- *NOTE*
return true;
if ( empty( $current_user ) )
return false;
$args = array_slice( func_get_args(), 1 );
$args = array_merge( array( $capability ), $args );
return call_user_func_array( array( &$current_user, ‘has_cap’ ), $args );
}
^F^