How to get custom page template being edited in gutenberg editor

You can use this code once set page template for specific post. If the template isn’t set, you cant enqueue your script. if ( $post->_wp_page_template === ‘sky-template.php’ ) { wp_enqueue_script(); } Remember to replace sky-template.php with your template file name. Edit: You can get some help from this question. _wp_page_template to dynamically use template

One button on admin page works but not two

I think I’ve solved the problem, there are 2 issues: You have 1 form for both buttons, submitting means submitting the entire form, so both buttons are submitted Your nonce/referrer checks appear to be incomplete The second item is why you’re having issues, although server time issues could also factor in. If we inspect your … Read more