PluginPanel.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace YahnisElsts\PluginUpdateChecker\v5p1\DebugBar;
  3. use YahnisElsts\PluginUpdateChecker\v5p1\Plugin\UpdateChecker;
  4. if ( !class_exists(PluginPanel::class, false) ):
  5. class PluginPanel extends Panel {
  6. /**
  7. * @var UpdateChecker
  8. */
  9. protected $updateChecker;
  10. protected function displayConfigHeader() {
  11. $this->row('Plugin file', htmlentities($this->updateChecker->pluginFile));
  12. parent::displayConfigHeader();
  13. }
  14. protected function getMetadataButton() {
  15. $buttonId = $this->updateChecker->getUniqueName('request-info-button');
  16. if ( function_exists('get_submit_button') ) {
  17. $requestInfoButton = get_submit_button(
  18. 'Request Info',
  19. 'secondary',
  20. 'puc-request-info-button',
  21. false,
  22. array('id' => $buttonId)
  23. );
  24. } else {
  25. $requestInfoButton = sprintf(
  26. '<input type="button" name="puc-request-info-button" id="%1$s" value="%2$s" class="button button-secondary" />',
  27. esc_attr($buttonId),
  28. esc_attr('Request Info')
  29. );
  30. }
  31. return $requestInfoButton;
  32. }
  33. protected function getUpdateFields() {
  34. return array_merge(
  35. parent::getUpdateFields(),
  36. array('homepage', 'upgrade_notice', 'tested',)
  37. );
  38. }
  39. }
  40. endif;