class-metabox-section-readability.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin
  6. */
  7. /**
  8. * Generates and displays the React root element for a metabox section.
  9. */
  10. class WPSEO_Metabox_Section_Readability implements WPSEO_Metabox_Section {
  11. /**
  12. * Name of the section, used as an identifier in the HTML.
  13. *
  14. * @var string
  15. */
  16. public $name = 'readability';
  17. /**
  18. * Outputs the section link.
  19. */
  20. public function display_link() {
  21. printf(
  22. '<li role="presentation"><a role="tab" href="#wpseo-meta-section-%1$s" id="wpseo-meta-tab-%1$s" aria-controls="wpseo-meta-section-%1$s" class="wpseo-meta-section-link">
  23. <div class="wpseo-score-icon-container" id="wpseo-readability-score-icon"></div><span>%2$s</span></a></li>',
  24. esc_attr( $this->name ),
  25. esc_html__( 'Readability', 'wordpress-seo' )
  26. );
  27. }
  28. /**
  29. * Outputs the section content.
  30. */
  31. public function display_content() {
  32. printf(
  33. '<div role="tabpanel" id="wpseo-meta-section-%1$s" aria-labelledby="wpseo-meta-tab-%1$s" tabindex="0" class="wpseo-meta-section">',
  34. esc_attr( $this->name )
  35. );
  36. echo '<div id="wpseo-metabox-readability-root" class="wpseo-metabox-root"></div>', '</div>';
  37. }
  38. }