Making WordPress.org


Ignore:
Timestamp:
01/25/2019 03:51:59 AM (5 years ago)
Author:
iandunn
Message:

WordCamp Payments: Prevent sending invoices before contract is signed.

File:
1 edited

Legend:

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

    r6067 r8141  
    66
    77namespace WordCamp\Budgets\Sponsor_Invoices;
     8use WP_Post;
     9use WordCamp_Loader;
    810
    911defined( 'WPINC' ) or die();
     
    244246 * Render the Status metabox
    245247 *
    246  * @param \WP_Post $post
     248 * @param WP_Post $post The invoice post
    247249 */
    248250function render_status_metabox( $post ) {
     251    require_once( WP_PLUGIN_DIR . '/wcpt/wcpt-event/class-event-loader.php' );
     252    require_once( WP_PLUGIN_DIR . '/wcpt/wcpt-wordcamp/wordcamp-loader.php' );
     253
    249254    wp_nonce_field( 'status', 'status_nonce' );
    250255
    251256    $delete_text = EMPTY_TRASH_DAYS ? esc_html__( 'Move to Trash' ) : esc_html__( 'Delete Permanently' );
     257    $wordcamp    = get_wordcamp_post();
    252258
    253259    /*
     
    269275    }
    270276
     277    $allowed_submit_statuses         = WordCamp_Loader::get_after_contract_statuses();
    271278    $current_user_can_edit_request = in_array( $post->post_status, $allowed_edit_statuses, true );
     279    $current_user_can_submit_request = $wordcamp && in_array( $wordcamp->post_status, $allowed_submit_statuses, true );
    272280
    273281    require_once( dirname( __DIR__ ) . '/views/sponsor-invoice/metabox-status.php' );
Note: See TracChangeset for help on using the changeset viewer.