fix: defer log viewer JS until DOM ready to resolve peptideNewsAdmin reference
The inline log viewer script was executing before wp_localize_script had defined peptideNewsAdmin. Switching from an IIFE to jQuery document.ready ensures the localized object is available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -753,7 +753,7 @@ class Peptide_News_Admin {
|
||||
|
||||
?>
|
||||
<script>
|
||||
(function($) {
|
||||
jQuery(document).ready(function($) {
|
||||
var currentPage = 1;
|
||||
|
||||
function levelBadge(level) {
|
||||
@@ -830,7 +830,7 @@ class Peptide_News_Admin {
|
||||
|
||||
// Initial load.
|
||||
loadLogs(1);
|
||||
})(jQuery);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -753,7 +753,7 @@ class Peptide_News_Admin {
|
||||
|
||||
?>
|
||||
<script>
|
||||
(function($) {
|
||||
jQuery(document).ready(function($) {
|
||||
var currentPage = 1;
|
||||
|
||||
function levelBadge(level) {
|
||||
@@ -830,7 +830,7 @@ class Peptide_News_Admin {
|
||||
|
||||
// Initial load.
|
||||
loadLogs(1);
|
||||
})(jQuery);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
|
||||
Reference in New Issue
Block a user