Changeset 2030979
- Timestamp:
- 02/15/2019 02:00:00 AM (7 years ago)
- Location:
- sermon-manager-for-wordpress/trunk
- Files:
-
- 1 added
- 3 edited
-
assets/js/admin/settings/conditionals.js (added)
-
includes/admin/class-sm-admin-settings.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
sermons.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sermon-manager-for-wordpress/trunk/includes/admin/class-sm-admin-settings.php
r2030899 r2030979 204 204 */ 205 205 public static function output_fields( $options, $values = array() ) { 206 $display_conditions = array(); 207 206 208 foreach ( $options as $value ) { 207 209 if ( ! isset( $value['type'] ) ) { … … 221 223 'size' => '', 222 224 'disabled' => false, 225 'display_if' => array(), 223 226 ); 227 228 // Get conditional display. 229 if ( ! empty( $value['display_if'] ) ) { 230 $display_conditions[ $value['id'] ] = isset( $display_conditions[ $value['id'] ] ) ? $display_conditions[ $value['id'] ] : array(); 231 $display_conditions[ $value['id'] ][] = $value['display_if']; 232 } 224 233 225 234 // Custom attribute handling. … … 615 624 } 616 625 } 626 627 // Load conditionals script. 628 wp_register_script( 'sm_settings_conditionals', SM_URL . 'assets/js/admin/settings/conditionals' . ( ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) ? '' : '.min' ) . '.js', 'sm_settings', SM_VERSION, true ); 629 wp_localize_script( 'sm_settings_conditionals', 'sm_conditionals', $display_conditions ); 630 wp_enqueue_script( 'sm_settings_conditionals' ); 617 631 } 618 632 -
sermon-manager-for-wordpress/trunk/readme.txt
r2030899 r2030979 129 129 * Fix: Improve [latest_series] shortcode 130 130 * 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 131 * Dev: Add conditional fields in settings 132 * Dev: Add dynamic option retrieval in settings 133 * Dev: Fix select field in settings returning error when only one option is defined for it 132 134 133 135 ### 2.15.13 ### -
sermon-manager-for-wordpress/trunk/sermons.php
r2028461 r2030979 866 866 } 867 867 ); 868 869 add_action( 'wp_ajax_sm_settings_get_select_data', function () { 870 echo json_encode( apply_filters( 'sm_settings_get_select_data', array(), $_POST['id'] ) ); 871 872 wp_die(); 873 } ); 868 874 } 869 875 }
Note: See TracChangeset
for help on using the changeset viewer.