diff --git a/plugins/wporg-5ftf/includes/pledge.php b/plugins/wporg-5ftf/includes/pledge.php index 70b3061..40c5f4d 100755 --- a/plugins/wporg-5ftf/includes/pledge.php +++ b/plugins/wporg-5ftf/includes/pledge.php @@ -182,7 +182,7 @@ function add_row_action( $actions, $post ) { */ function handle_activation_action( $post_id ) { $action = $_REQUEST['action']; - if ( ! in_array( $action, array( 'deactivate', 'reactivate' ) ) ) { + if ( ! in_array( $action, array( 'deactivate', 'reactivate' ), true ) ) { return; } @@ -206,14 +206,14 @@ function handle_activation_action( $post_id ) { if ( 'deactivate' === $action ) { deactivate( $post_id, false, 'Site admin deactivated via wp-admin list table.' ); - wp_redirect( add_query_arg( 'deactivated', 1, $sendback ) ); + wp_safe_redirect( add_query_arg( 'deactivated', 1, $sendback ) ); exit(); } else { wp_update_post( array( 'ID' => $post_id, 'post_status' => 'publish', ) ); - wp_redirect( add_query_arg( 'reactivated', 1, $sendback ) ); + wp_safe_redirect( add_query_arg( 'reactivated', 1, $sendback ) ); exit(); } } @@ -366,8 +366,8 @@ function create_new_pledge( $name ) { /** * Remove a pledge from view by setting its status to "deactivated". * - * @param int $pledge_id The pledge to deactivate. - * @param bool $notify Whether the pledge admin should be notified of the deactivation. + * @param int $pledge_id The pledge to deactivate. + * @param bool $notify Whether the pledge admin should be notified of the deactivation. * @param string $reason The reason why the pledge is being deactivated. * * @return int|WP_Error Post ID on success. Otherwise WP_Error. diff --git a/plugins/wporg-5ftf/includes/xprofile.php b/plugins/wporg-5ftf/includes/xprofile.php index af3abd6..f904329 100644 --- a/plugins/wporg-5ftf/includes/xprofile.php +++ b/plugins/wporg-5ftf/includes/xprofile.php @@ -53,7 +53,7 @@ function get_xprofile_contribution_data( array $user_ids ) { * @return array */ function prepare_xprofile_contribution_data( array $raw_data ) { - $prepared_data = array(); + $prepared_data = array(); $field_keys_by_id = array_flip( FIELD_IDS ); foreach ( $raw_data as $datum ) { diff --git a/plugins/wporg-5ftf/views/manage-contributors.php b/plugins/wporg-5ftf/views/manage-contributors.php index fb79c16..8bf3619 100644 --- a/plugins/wporg-5ftf/views/manage-contributors.php +++ b/plugins/wporg-5ftf/views/manage-contributors.php @@ -95,7 +95,7 @@ use function WordPressDotOrg\FiveForTheFuture\get_views_path; '' ]; + $data = array( 'pledge-contributors' => '' ); require get_views_path() . 'inputs-pledge-contributors.php'; ?> diff --git a/plugins/wporg-5ftf/views/partial-request-manage-link.php b/plugins/wporg-5ftf/views/partial-request-manage-link.php index 6d60b04..3b86ed0 100644 --- a/plugins/wporg-5ftf/views/partial-request-manage-link.php +++ b/plugins/wporg-5ftf/views/partial-request-manage-link.php @@ -6,7 +6,7 @@ use function WordPressDotOrg\FiveForTheFuture\get_views_path; defined( 'WPINC' ) || die(); -$pledge_id = ( CPT_ID === get_post_type() ) ? get_post()->ID : absint( $_REQUEST['pledge_id'] ?? 0 ); +$pledge_id = ( CPT_ID === get_post_type() ) ? get_post()->ID : absint( $_REQUEST['pledge_id'] ?? 0 ); $pledge_name = get_the_title( $pledge_id ); ?>