mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-20 10:03:43 +03:00
phpcs fixes
issues introduced in this PR
This commit is contained in:
parent
a53b074314
commit
f7a253027c
|
@ -252,21 +252,21 @@ function get_pledge_contributors_data( $pledge_id ) {
|
|||
foreach ( $contributors as $contributor_status => $group ) {
|
||||
$contrib_data[ $contributor_status ] = array_map(
|
||||
function( $contributor_post ) use ( $contributor_status, $pledge_id ) {
|
||||
$name = $contributor_post->post_title;
|
||||
$name = $contributor_post->post_title;
|
||||
$contributor = get_user_by( 'login', $name );
|
||||
|
||||
return [
|
||||
'pledgeId' => $pledge_id,
|
||||
'pledgeId' => $pledge_id,
|
||||
'contributorId' => $contributor_post->ID,
|
||||
'status' => $contributor_status,
|
||||
'avatar' => get_avatar( $contributor, 32 ),
|
||||
'status' => $contributor_status,
|
||||
'avatar' => get_avatar( $contributor, 32 ),
|
||||
// @todo Add full name, from `$contributor`?
|
||||
'name' => $name,
|
||||
'displayName' => $contributor->display_name,
|
||||
'publishDate' => get_the_date( '', $contributor_post ),
|
||||
'resendLabel' => __( 'Resend Confirmation', 'wporg' ),
|
||||
'name' => $name,
|
||||
'displayName' => $contributor->display_name,
|
||||
'publishDate' => get_the_date( '', $contributor_post ),
|
||||
'resendLabel' => __( 'Resend Confirmation', 'wporg' ),
|
||||
'removeConfirm' => sprintf( __( 'Remove %s from this pledge?', 'wporg-5ftf' ), $name ),
|
||||
'removeLabel' => sprintf( __( 'Remove %s', 'wporg' ), $name ),
|
||||
'removeLabel' => sprintf( __( 'Remove %s', 'wporg' ), $name ),
|
||||
];
|
||||
},
|
||||
$group
|
||||
|
|
|
@ -15,8 +15,8 @@ add_action( 'wp_ajax_manage_contributors', __NAMESPACE__ . '\handler' );
|
|||
function handler() {
|
||||
check_ajax_referer( 'manage-pledge', '_ajax_nonce' );
|
||||
|
||||
$action = filter_input( INPUT_POST, 'manage_action' );
|
||||
$pledge_id = filter_input( INPUT_POST, 'pledge_id', FILTER_VALIDATE_INT );
|
||||
$action = filter_input( INPUT_POST, 'manage_action' );
|
||||
$pledge_id = filter_input( INPUT_POST, 'pledge_id', FILTER_VALIDATE_INT );
|
||||
$contributor_id = filter_input( INPUT_POST, 'contributor_id', FILTER_VALIDATE_INT );
|
||||
|
||||
switch ( $action ) {
|
||||
|
@ -33,7 +33,7 @@ function handler() {
|
|||
// Trash contributor.
|
||||
Contributor\remove_contributor( $contributor_id );
|
||||
wp_die( wp_json_encode( [
|
||||
'success' => true,
|
||||
'success' => true,
|
||||
'contributors' => Contributor\get_pledge_contributors_data( $pledge_id ),
|
||||
] ) );
|
||||
break;
|
||||
|
@ -52,7 +52,7 @@ function handler() {
|
|||
$contributors = Contributor\get_pledge_contributors_data( $pledge_id );
|
||||
|
||||
wp_die( wp_json_encode( [
|
||||
'success' => true,
|
||||
'success' => true,
|
||||
'contributors' => $contributors,
|
||||
] ) );
|
||||
break;
|
||||
|
|
|
@ -202,7 +202,7 @@ function add_meta_boxes() {
|
|||
* @param array $box
|
||||
*/
|
||||
function render_meta_boxes( $pledge, $box ) {
|
||||
$readonly = ! current_user_can( 'edit_page', $pledge->ID );
|
||||
$readonly = ! current_user_can( 'edit_page', $pledge->ID );
|
||||
$is_manage = true;
|
||||
|
||||
$data = array();
|
||||
|
|
Loading…
Reference in a new issue