Making WordPress.org


Ignore:
Timestamp:
03/03/2016 07:33:42 PM (9 years ago)
Author:
iandunn
Message:

WordCamp Budgets: Make Vendor Payment and Payment Method fields required.

File:
1 edited

Legend:

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

    r2676 r2682  
    180180            plugins_url( 'javascript/payment-requests.js', __DIR__ ),
    181181            array( 'wordcamp-budgets', 'wcb-attached-files', 'jquery' ),
    182             2,
     182            3,
    183183            true
    184184        );
     
    339339     * @param string $name
    340340     * @param string $description
    341      */
    342     protected function render_textarea_input( $post, $label, $name, $description = '' ) {
     341     * @param bool   $required
     342     */
     343    protected function render_textarea_input( $post, $label, $name, $description = '', $required = true ) {
    343344        $text = $this->get_field_value( $name, $post );
    344345
     
    352353     * @param string $label
    353354     * @param string $name
    354      */
    355     protected function render_select_input( $post, $label, $name ) {
     355     * @param bool   $required
     356     */
     357    protected function render_select_input( $post, $label, $name, $required = true ) {
    356358        $selected = get_post_meta( $post->ID, '_camppayments_' . $name, true );
    357359        $options  = $this->get_field_value( $name, $post );
     
    360362    }
    361363
    362     protected function render_country_input( $post, $label, $name ) {
     364    /**
     365     * Render a select dropdown for countries
     366     *
     367     * @param WP_Post $post
     368     * @param string  $label
     369     * @param string  $name
     370     * @param bool    $required
     371     */
     372    protected function render_country_input( $post, $label, $name, $required = true ) {
    363373        $selected = $this->get_field_value( $name, $post );
    364374        $options = WordCamp_Budgets::get_valid_countries_iso3166();
     
    373383     * @param string $label
    374384     * @param string $name
    375      */
    376     protected function render_radio_input( $post, $label, $name ) {
     385     * @param bool   $required
     386     */
     387    protected function render_radio_input( $post, $label, $name, $required = true ) {
    377388        $selected = get_post_meta( $post->ID, "_{$this->meta_key_prefix}_" . $name, true );
    378389        $options  = $this->get_field_value( $name, $post );
     
    387398     * @param string $label
    388399     * @param string $name
    389      */
    390     protected function render_checkbox_input( $post, $label, $name, $description = '' ) {
     400     * @param bool   $required
     401     */
     402    protected function render_checkbox_input( $post, $label, $name, $description = '', $required = true ) {
    391403        $value = $this->get_field_value( $name, $post );
    392404
     
    400412     * @param string $label
    401413     * @param string $name
    402      */
    403     protected function render_text_input( $post, $label, $name, $description = '', $variant = 'text', $row_classes = array(), $readonly = false ) {
     414     * @param string $description
     415     * @param string $variant
     416     * @param array  $row_classes
     417     * @param bool   $readonly
     418     * @param bool   $required
     419     */
     420    protected function render_text_input( $post, $label, $name, $description = '', $variant = 'text', $row_classes = array(), $readonly = false, $required = true ) {
    404421        $value = $this->get_field_value( $name, $post );
    405422        array_walk( $row_classes, 'sanitize_html_class' );
Note: See TracChangeset for help on using the changeset viewer.