| @@ 18-20 (lines=3) @@ | ||
| 15 | ||
| 16 | // convert list of modules in comma-delimited format into an array |
|
| 17 | // of "$modulename => true" |
|
| 18 | if ( isset( $args['modules'] ) && ! empty( $args['modules'] ) ) { |
|
| 19 | $modules = array_map( '__return_true', array_flip( array_map( 'trim', explode( ',', $args['modules'] ) ) ) ); |
|
| 20 | } |
|
| 21 | ||
| 22 | foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) { |
|
| 23 | if ( 'users' === $module_name && isset( $args[ $module_name ] ) && 'initial' === $args[ $module_name ] ) { |
|
| @@ 2414-2416 (lines=3) @@ | ||
| 2411 | if ( ! empty( $attributes['options'] ) && is_string( $attributes['options'] ) ) { |
|
| 2412 | $attributes['options'] = array_map( 'trim', explode( ',', $attributes['options'] ) ); |
|
| 2413 | ||
| 2414 | if ( ! empty( $attributes['values'] ) && is_string( $attributes['values'] ) ) { |
|
| 2415 | $attributes['values'] = array_map( 'trim', explode( ',', $attributes['values'] ) ); |
|
| 2416 | } |
|
| 2417 | } |
|
| 2418 | ||
| 2419 | if ( $form ) { |
|
| @@ 681-687 (lines=7) @@ | ||
| 678 | Jetpack_Sync_Settings::update_settings( $sync_settings ); |
|
| 679 | ||
| 680 | // Convert comma-delimited string of modules to an array |
|
| 681 | if ( ! empty( $assoc_args['modules'] ) ) { |
|
| 682 | $modules = array_map( 'trim', explode( ',', $assoc_args['modules'] ) ); |
|
| 683 | ||
| 684 | // Convert the array so that the keys are the module name and the value is true to indicate |
|
| 685 | // that we want to sync the module |
|
| 686 | $modules = array_map( '__return_true', array_flip( $modules ) ); |
|
| 687 | } |
|
| 688 | ||
| 689 | foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) { |
|
| 690 | if ( |
|