Skip to content

Instantly share code, notes, and snippets.

@MarkKevin08
Created June 9, 2023 03:37
Show Gist options
  • Save MarkKevin08/2196c55c6f770a3a4aa90afa26d96922 to your computer and use it in GitHub Desktop.
Save MarkKevin08/2196c55c6f770a3a4aa90afa26d96922 to your computer and use it in GitHub Desktop.
Open booking resources editor in new tab
function wcv_add_target_blank_for_button() {
?>
<script>
jQuery(document).ready(function ($) {
let $manageResource = $('.button.button-primary.add_resource').next();
if ($manageResource.length) {
$manageResource.attr('target', '_blank');
}
});
</script>
<?php
}
add_action( 'wp_footer', 'wcv_add_target_blank_for_button' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment