Edit File by line
/home/barbar84/www/wp-conte.../plugins/wordpres.../src/config/migratio...
File: 20200702141921_CreateIndexableSubpagesIndex.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Config\Migrations;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\Lib\Migrations\Migration;
[4] Fix | Delete
use Yoast\WP\Lib\Model;
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* CreateIndexableSubpagesIndex class.
[8] Fix | Delete
*/
[9] Fix | Delete
class CreateIndexableSubpagesIndex extends Migration {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* The plugin this migration belongs to.
[13] Fix | Delete
*
[14] Fix | Delete
* @var string
[15] Fix | Delete
*/
[16] Fix | Delete
public static $plugin = 'free';
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Migration up.
[20] Fix | Delete
*
[21] Fix | Delete
* @return void
[22] Fix | Delete
*/
[23] Fix | Delete
public function up() {
[24] Fix | Delete
$this->change_column(
[25] Fix | Delete
$this->get_table_name(),
[26] Fix | Delete
'post_status',
[27] Fix | Delete
'string',
[28] Fix | Delete
[
[29] Fix | Delete
'null' => true,
[30] Fix | Delete
'limit' => 20,
[31] Fix | Delete
]
[32] Fix | Delete
);
[33] Fix | Delete
$this->add_index(
[34] Fix | Delete
$this->get_table_name(),
[35] Fix | Delete
[ 'post_parent', 'object_type', 'post_status', 'object_id' ],
[36] Fix | Delete
[ 'name' => 'subpages' ]
[37] Fix | Delete
);
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
/**
[41] Fix | Delete
* Migration down.
[42] Fix | Delete
*
[43] Fix | Delete
* @return void
[44] Fix | Delete
*/
[45] Fix | Delete
public function down() {
[46] Fix | Delete
$this->change_column(
[47] Fix | Delete
$this->get_table_name(),
[48] Fix | Delete
'post_status',
[49] Fix | Delete
'string',
[50] Fix | Delete
[
[51] Fix | Delete
'null' => true,
[52] Fix | Delete
'limit' => 191,
[53] Fix | Delete
]
[54] Fix | Delete
);
[55] Fix | Delete
$this->remove_index(
[56] Fix | Delete
$this->get_table_name(),
[57] Fix | Delete
[ 'post_parent', 'object_type', 'post_status', 'object_id' ],
[58] Fix | Delete
[ 'name' => 'subpages' ]
[59] Fix | Delete
);
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Retrieves the table name to use for storing indexables.
[64] Fix | Delete
*
[65] Fix | Delete
* @return string The table name to use.
[66] Fix | Delete
*/
[67] Fix | Delete
protected function get_table_name() {
[68] Fix | Delete
return Model::get_table_name( 'Indexable' );
[69] Fix | Delete
}
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function