PluginPanel.php 980 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. $requestInfoButton = '';
  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' => $this->updateChecker->getUniqueName('request-info-button'))
  23. );
  24. }
  25. return $requestInfoButton;
  26. }
  27. protected function getUpdateFields() {
  28. return array_merge(
  29. parent::getUpdateFields(),
  30. array('homepage', 'upgrade_notice', 'tested',)
  31. );
  32. }
  33. }
  34. endif;