download svg to png size image

const w = parseInt(svg.getAttribute(‘width’)); const h = parseInt(svg.getAttribute(‘height’)); Change those 2 lines so that w and h have the desired values. E.g. const w = 101; Will make the result 101 pixels wide

I want to make a post api call once a post or page is published/updated and show a javascript alert box saying ‘Post has been published/updated’

If you only want an alert then why do you write it in a separate file and enqueue it? You can directly write it inside the invoke_save_post function using echo “<script>alert(‘Api called’);</script>”; or if you want to write it in a separate file then you have to write your alert inside the function and call … Read more

how to add a custom javascript file to our theme

Having this issue for months and I got it now running when I posted the question here. the issue is that the wp_enqueue_script needs to have the script file register first. So I have it working this way! if (! function_exists(‘custom_jsfiles’)) { add_action(‘wp_enqueue_scripts’, ‘custom_jsfiles’); function custom_jsfiles() { wp_register_script(‘custom_js’, get_theme_file_uri().’/mytheme/custom-js.js’); wp_enqueue_script(‘custom_js’); } } ######################## updating the … Read more