From 07366fff492e1cba86d42cfc015ab95fa4a68a16 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 14 Jan 2015 12:51:12 +0100 Subject: [PATCH] Prevent some html errors for duplicate ids --- debug-bar-panel.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/debug-bar-panel.php b/debug-bar-panel.php index 477fa84..818cfa0 100644 --- a/debug-bar-panel.php +++ b/debug-bar-panel.php @@ -34,7 +34,10 @@ class PluginUpdateCheckerPanel extends Debug_Bar_Panel { $this->row('Slug', htmlentities($this->updateChecker->slug)); $this->row('DB option', htmlentities($this->updateChecker->optionName)); - $requestInfoButton = function_exists('get_submit_button') ? get_submit_button('Request Info', 'secondary', 'puc-request-info-button', false) : ''; + $requestInfoButton = ''; + if ( function_exists('get_submit_button') ) { + $requestInfoButton = get_submit_button('Request Info', 'secondary', 'puc-request-info-button', false, array('id' => 'puc-request-info-button-'.$this->updateChecker->slug)); + } $this->row('Metadata URL', htmlentities($this->updateChecker->metadataUrl) . ' ' . $requestInfoButton . $responseBox); if ( $this->updateChecker->checkPeriod > 0 ) { @@ -62,7 +65,10 @@ class PluginUpdateCheckerPanel extends Debug_Bar_Panel { echo '

Status

'; echo ''; $state = $this->updateChecker->getUpdateState(); - $checkNowButton = function_exists('get_submit_button') ? get_submit_button('Check Now', 'secondary', 'puc-check-now-button', false) : ''; + $checkNowButton = ''; + if ( function_exists('get_submit_button') ) { + $checkNowButton = get_submit_button('Check Now', 'secondary', 'puc-check-now-button', false, array('id' => 'puc-check-now-button'.$this->updateChecker->slug)); + } if ( isset($state, $state->lastCheck) ) { $this->row('Last check', $this->formatTimeWithDelta($state->lastCheck) . ' ' . $checkNowButton . $responseBox);