PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
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 / config / migrations / 20230417083836_AddInclusiveLanguageScore.php

20230417083836_AddInclusiveLanguageScore.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at src/config/migrations/20230417083836_AddInclusiveLanguageScore.php

59 lines 947 B
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\Config\Migrations;
4
5 use Yoast\WP\Lib\Migrations\Migration;
6 use Yoast\WP\Lib\Model;
7
8 /**
9 * AddInclusiveLanguageScore class.
10 */
11 class AddInclusiveLanguageScore extends Migration {
12
13 /**
14 * The plugin this migration belongs to.
15 *
16 * @var string
17 */
18 public static $plugin = 'free';
19
20 /**
21 * Migration up.
22 *
23 * @return void
24 */
25 public function up() {
26 $table_name = $this->get_table_name();
27
28 $this->add_column(
29 $table_name,
30 'inclusive_language_score',
31 'integer',
32 [
33 'null' => true,
34 'limit' => 3,
35 ],
36 );
37 }
38
39 /**
40 * Migration down.
41 *
42 * @return void
43 */
44 public function down() {
45 $table_name = $this->get_table_name();
46
47 $this->remove_column( $table_name, 'inclusive_language_score' );
48 }
49
50 /**
51 * Retrieves the table name to use.
52 *
53 * @return string The table name to use.
54 */
55 protected function get_table_name() {
56 return Model::get_table_name( 'Indexable' );
57 }
58 }
59