Making WordPress.org


Ignore:
Timestamp:
01/24/2019 02:31:10 PM (6 years ago)
Author:
coreymckrill
Message:

WordCamp Payments: Prevent submission of requests that have no documentation

For both Payment Requests and Reimbursement Requests:

  • Add a method to check and see if the request post can be submitted. Currently this just checks to see if the post has one or more files attached to it.
  • When the post fails the check, show a note in the Status metabox that documentation must be attached first, and don't render the Submit for Review button.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/wordcamp-budgets.php

    r8106 r8136  
    26692669
    26702670    /**
     2671     * Check if a request post meets the requirements to be submitted for review.
     2672     *
     2673     * @param WP_Post $post
     2674     */
     2675    public static function can_submit_request( $post ) {
     2676        // A request must have documentation attached before it can be submitted.
     2677        $files = self::get_attached_files( $post );
     2678        if ( empty( $files ) ) {
     2679            return false;
     2680        }
     2681
     2682        return true;
     2683    }
     2684
     2685    /**
    26712686     * Get the files attached to a post
    26722687     *
Note: See TracChangeset for help on using the changeset viewer.