Changes to repeater ui, and completed MVP for custom image sizes

This commit is contained in:
Jeremy Rangel
2025-01-04 14:58:58 -08:00
parent 63e181109c
commit ceb37fc5af
8 changed files with 360 additions and 7 deletions

View File

@ -55,6 +55,31 @@ function lcp_backend_enqueue() {
'ajax_url' => admin_url('admin-ajax.php'), // This is the URL that well 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');