Changes to repeater ui, and completed MVP for custom image sizes
This commit is contained in:
@ -55,6 +55,31 @@ function lcp_backend_enqueue() {
|
||||
'ajax_url' => admin_url('admin-ajax.php'), // This is the URL that we’ll send the AJAX request to
|
||||
'nonce' => wp_create_nonce('lcp_import_demo_posts_nonce') // Security nonce for validation
|
||||
));
|
||||
|
||||
/* --- Image Sizes --- */
|
||||
// Enqueue the JavaScript file
|
||||
wp_enqueue_script('custom-image-sizes', get_template_directory_uri() . '/assets/js/custom-image-sizes.js', array(), null, true);
|
||||
|
||||
// Localize script to pass the nonce and ajaxurl to JavaScript
|
||||
wp_localize_script('custom-image-sizes', 'customImageSizeAjax', array(
|
||||
'ajax_url' => admin_url('admin-ajax.php'), // The URL to send the request to
|
||||
'nonce' => wp_create_nonce('custom_image_sizes_nonce') // Create the nonce and pass it
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
add_action('admin_enqueue_scripts', 'lcp_backend_enqueue');
|
||||
add_action('admin_enqueue_scripts', 'lcp_backend_enqueue');
|
||||
|
||||
|
||||
|
||||
function lcp_send_headers_hooks(){
|
||||
lcp_set_visited_posts_cookie();
|
||||
}
|
||||
add_action('send_headers','lcp_send_headers_hooks');
|
||||
|
||||
|
||||
function lcp_after_setup_theme() {
|
||||
lcp_register_custom_image_sizes();
|
||||
|
||||
}
|
||||
add_action('after_setup_theme', 'lcp_after_setup_theme');
|
||||
Reference in New Issue
Block a user