mirror of
https://ghproxy.net/https://github.com/AlxMedia/curver.git
synced 2025-08-28 11:50:25 +08:00
24 lines
543 B
JavaScript
24 lines
543 B
JavaScript
|
jQuery( document ).ready( function() {
|
||
|
|
||
|
var self;
|
||
|
|
||
|
self = {
|
||
|
queriedPost: new wp.customize.Value()
|
||
|
};
|
||
|
|
||
|
// Listen for queried-post messages from the preview.
|
||
|
wp.customize.bind( 'ready', function() {
|
||
|
wp.customize.previewer.bind( 'queried-post', function( queriedPost ) {
|
||
|
self.queriedPost.set( queriedPost || false );
|
||
|
} );
|
||
|
} );
|
||
|
|
||
|
// Listen for post
|
||
|
self.queriedPost.bind( function( newPost, oldPost ) {
|
||
|
window.kirkiPost = false;
|
||
|
if ( newPost || oldPost ) {
|
||
|
window.kirkiPost = ( newPost ) ? newPost : oldPost;
|
||
|
}
|
||
|
} );
|
||
|
} );
|