Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Merge e853ab6 into 7d1e373
Browse files Browse the repository at this point in the history
  • Loading branch information
lgedeon committed Aug 28, 2016
2 parents 7d1e373 + e853ab6 commit b964aaa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/customize-snapshots.js
Expand Up @@ -557,7 +557,7 @@
}
} );

request.done( function() {
request.done( function( response ) {
var url = api.previewer.previewUrl(),
regex = new RegExp( '([?&])customize_snapshot_uuid=.*?(&|$)', 'i' ),
notFound = -1,
Expand Down Expand Up @@ -590,7 +590,8 @@
api.trigger( 'customize-snapshots-update', {
previewUrl: url,
customizeUrl: customizeUrl,
uuid: component.data.uuid
uuid: component.data.uuid,
response: response
} );
} );

Expand Down
7 changes: 7 additions & 0 deletions php/class-customize-snapshot-manager.php
Expand Up @@ -1125,6 +1125,11 @@ public function handle_update_snapshot_request() {
) );
}

/**
* Add any additional checks before saving snapshot.
*/
do_action( 'customize_snapshot_save_before', $this->snapshot, $this->customize_manager );

// Set the snapshot UUID.
$post_type = get_post_type_object( Post_Type::SLUG );
$authorized = ( $post ?
Expand Down Expand Up @@ -1181,6 +1186,8 @@ function( $value ) {
wp_send_json_error( $data );
}

/** This filter is documented in wp-includes/class-wp-customize-manager.php */
$data = apply_filters( 'customize_save_response', $data, $this );
wp_send_json_success( $data );
}

Expand Down

0 comments on commit b964aaa

Please sign in to comment.