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