Plugin: Fix all phpcs errors

This includes autofixes, along with some manual fixes; mostly syntax-related. Some `phpcs:ignore` comments were added for overzealous rules that don't apply.
This commit is contained in:
Kelly Dwan 2019-11-14 13:48:17 -05:00
parent e1909dfccf
commit 42d44f7dc9
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D
10 changed files with 65 additions and 69 deletions

View file

@ -76,7 +76,7 @@ function get_pledge_meta_config( $context = 'all' ) {
'sanitize_callback' => 'absint',
'show_in_rest' => false,
),
'pledge-total-hours' => array(
'pledge-total-hours' => array(
'single' => true,
'sanitize_callback' => 'absint',
'show_in_rest' => false,
@ -259,10 +259,7 @@ function save_pledge( $pledge_id, $pledge ) {
return;
}
if ( ! current_user_can( 'edit_pledge', $pledge_id ) ) {
// todo re-enable once setup cap mapping or whatever.
//return;
}
// if ( ! current_user_can( 'edit_pledge', $pledge_id ) ) {} -- todo re-enable once setup cap mapping or whatever.
if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || 'auto-draft' === $pledge->post_status ) {
return;
@ -388,7 +385,7 @@ function maybe_update_single_cached_pledge_data( $new_status, $old_status, WP_Po
*
* This is saved so that it can be easily queried against, and also to make stats calculations easier.
*
* @param $pledge_id
* @param int $pledge_id
*/
function update_single_cached_pledge_data( $pledge_id ) {
$pledge_data = XProfile\get_aggregate_contributor_data_for_pledge( $pledge_id );