| @@ -433,9 +433,9 @@ | ||
| 433 | 433 | $step_type = wcf()->utils->get_step_type( $step_id ); |
| 434 | 434 | |
| 435 | 435 | $post_meta = AdminHelper::get_step_default_meta( $step_type, $step_id ); |
| 436 | 436 | |
| 437 | - MetaOps::save_meta_fields( $step_id, $post_meta, 'cartflows_save_meta_settings' ); | |
| 437 | + $skipped_fields = MetaOps::save_meta_fields( $step_id, $post_meta, 'cartflows_save_meta_settings' ); | |
| 438 | 438 | |
| 439 | 439 | // We are storing the step dynamic css in the post meta and deleting when any setting changes. Once deleted it will be regenerated with first page load. |
| 440 | 440 | delete_post_meta( $step_id, 'wcf-dynamic-css' ); |
| 441 | 441 | |
| @@ -453,8 +453,14 @@ | ||
| 453 | 453 | 'step_view_url' => get_the_permalink( $step_id ), |
| 454 | 454 | /* translators: %s flow id */ |
| 455 | 455 | 'text' => sprintf( __( 'Data saved successfully for step id %s', 'cartflows' ), $step_id ), |
| 456 | 456 | ); |
| 457 | + | |
| 458 | + // Name anything the save dropped rather than reporting a clean save the user did not get. | |
| 459 | + if ( ! empty( $skipped_fields ) ) { | |
| 460 | + $result['skipped_fields'] = $skipped_fields; | |
| 461 | + $result['text'] = __( 'Saved, but the custom script fields were not updated because your account cannot edit scripts.', 'cartflows' ); | |
| 462 | + } | |
| 457 | 463 | |
| 458 | 464 | wp_send_json( $result ); |
| 459 | 465 | } |
| 460 | 466 | |