mirror of
https://github.com/10h30/full-screen-morphing-search.git
synced 2026-07-11 10:36:02 +09:00
Localize customize-preview.js
This commit is contained in:
@@ -13,6 +13,34 @@ function full_screen_morphing_search_thumb() {
|
||||
}
|
||||
add_action( 'init', 'full_screen_morphing_search_thumb' );
|
||||
|
||||
/**
|
||||
* This outputs the javascript needed to automate the live settings preview.
|
||||
* Also keep in mind that this function isn't necessary unless your settings
|
||||
* are using 'transport'=>'postMessage' instead of the default 'transport'
|
||||
* => 'refresh'.
|
||||
*
|
||||
* Used by hook: 'customize_preview_init'
|
||||
*/
|
||||
function fsmsp_customize_preview_js() {
|
||||
$handle = 'fsmsp-customize-preview';
|
||||
$src = plugins_url( 'assets/js/customize-preview.js', __FILE__ );
|
||||
$deps = array( 'customize-preview' );
|
||||
$ver = '0.1';
|
||||
$in_footer = true;
|
||||
wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
|
||||
wp_localize_script(
|
||||
'fsmsp-customize-preview',
|
||||
'fsmsp_cp',
|
||||
array(
|
||||
'fsmsp_article_icon' => '<img src="' . esc_url( plugins_url( 'assets/img/article.png', __FILE__ ) ) . '">',
|
||||
'fsmsp_category_icon' => '<img src="' . esc_url( plugins_url( 'assets/img/category.png', __FILE__ ) ) . '">',
|
||||
'fsmsp_tag_icon' => '<img src="' . esc_url( plugins_url( 'assets/img/tag.png', __FILE__ ) ) . '">',
|
||||
'fsmsp_placeholder_text' => esc_attr( 'Search …' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'customize_preview_init', 'fsmsp_customize_preview_js' );
|
||||
|
||||
/**
|
||||
* Require Kirki.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user