PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.3
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / integrations / estimated-reading-time.php

estimated-reading-time.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.3, at src/integrations/estimated-reading-time.php

50 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Integrations;
4
5 use Yoast\WP\SEO\Conditionals\Admin\Estimated_Reading_Time_Conditional;
6
7 /**
8 * Estimated reading time class.
9 */
10 class Estimated_Reading_Time implements Integration_Interface {
11
12 /**
13 * Returns the conditionals based in which this loadable should be active.
14 *
15 * @return array
16 */
17 public static function get_conditionals() {
18 return [ Estimated_Reading_Time_Conditional::class ];
19 }
20
21 /**
22 * Initializes the integration.
23 *
24 * This is the place to register hooks and filters.
25 *
26 * @return void
27 */
28 public function register_hooks() {
29 \add_filter( 'wpseo_metabox_entries_general', [ $this, 'add_estimated_reading_time_hidden_fields' ] );
30 }
31
32 /**
33 * Adds an estimated-reading-time hidden field.
34 *
35 * @param array $field_defs The $fields_defs.
36 *
37 * @return array
38 */
39 public function add_estimated_reading_time_hidden_fields( $field_defs ) {
40 if ( \is_array( $field_defs ) ) {
41 $field_defs['estimated-reading-time-minutes'] = [
42 'type' => 'hidden',
43 'title' => 'estimated-reading-time-minutes',
44 ];
45 }
46
47 return $field_defs;
48 }
49 }
50