Plugin Directory

Changeset 2030899


Ignore:
Timestamp:
02/14/2019 10:52:33 PM (7 years ago)
Author:
nikolam
Message:

Fix select field in settings, edge case

Location:
sermon-manager-for-wordpress/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sermon-manager-for-wordpress/trunk/includes/admin/class-sm-admin-settings.php

    r1987696 r2030899  
    676676        } elseif ( is_array( $options ) ) {
    677677            if ( count( $options ) === 1 ) {
    678                 foreach ( $options as $function => $args ) {
    679                     // Let's assume that it's a function with arguments.
    680                     if ( is_array( $args ) ) {
    681                         break;
    682                     }
     678                $function = key( $options );
     679                $args     = $options[ $function ];
     680
     681                if ( ! function_exists( $function ) ) {
     682                    return $options;
    683683                }
    684684            } else {
     
    699699
    700700            if ( count( $options ) === 0 ) {
    701                 $options = array( 0 => '-- ' . __( 'None' ) . ' --' );
     701                $options = array( 0 => '-- ' . __( 'None' ) . ' --' ); // phpcs:ignore
    702702            }
    703703        } else {
    704704            $options = array(
    705                 0 => __( 'Error.' ),
     705                0 => __( 'Error in populating field options.', 'sermon-manager-for-wordpress' ),
    706706            );
    707707        }
  • sermon-manager-for-wordpress/trunk/readme.txt

    r2028748 r2030899  
    129129* Fix: Improve [latest_series] shortcode
    130130* Fix: Service Type filter in backend not working when slug is different from default
     131* Dev: Fix select field returning error when only one option is defined for it
    131132
    132133### 2.15.13 ###
Note: See TracChangeset for help on using the changeset viewer.