Skip to content

Commit

Permalink
Data: Adapt multi-line code comments to PHP standard
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored and aristath committed Jul 29, 2021
1 parent b029ff5 commit f0ca212
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,18 @@ function gutenberg_user_settings_data_persistence_inline_script() {

$persisted_value = get_user_meta( $user_id, $wpdb->get_blog_prefix() . 'data_persistence', true );
if ( empty( $persisted_value ) ) {
// If there's no explicit metadata assigned, fall back to a value which
// was persisted using browser storage, prior to user meta persistence.
/*
* If there's no explicit metadata assigned, fall back to a value which
* was persisted using browser storage, prior to user meta persistence.
*/
$persisted_value = sprintf( 'localStorage.getItem( "WP_DATA_USER_%s" );', $user_id );
} else {
// Otherwise, encode the string value for interpolation in the storage
// implementation script. The first `json_encode` will is responsible
// for producing a JSON encoding of the persisted meta object, and the
// second will apply quoting to that string result.
/*
* Otherwise, encode the string value for interpolation in the storage
* implementation script. The first `json_encode` will is responsible
* for producing a JSON encoding of the persisted meta object, and the
* second will apply quoting to that string result.
*/
$persisted_value = wp_json_encode( wp_json_encode( $persisted_value ) );
}

Expand Down

0 comments on commit f0ca212

Please sign in to comment.