Created
November 20, 2023 14:56
-
-
Save mdibrahimk48/8b0492ee95e2dbf72a27bce4924dd6fd to your computer and use it in GitHub Desktop.
If you created a custom taxonomy and it is showing in the table and you want to remove the link, then use the code below.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add the following code in your functions.php or any plugin. | |
*/ | |
if (!function_exists('wpt_remove_taxonomy_link')) { | |
function wpt_remove_taxonomy_link() | |
{ | |
?> | |
<script> | |
jQuery(document).ready(function ($) { | |
// Updated by Ibrahim Khalil | |
$('[data-keyword="pa_brand"] a').contents().unwrap(); | |
$(document).on('your_custom_event', '[data-keyword="pa_brand"]', function () { | |
$('[data-keyword="pa_brand"] a').contents().unwrap(); | |
}); | |
$(document).on('change', 'table', function () { | |
$('[data-keyword="pa_brand"]').trigger('your_custom_event'); | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action('wp_footer', 'wpt_remove_taxonomy_link'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment