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