AnsPress_Upgrader::__construct()
Description #
Private ctor so nobody else can instance it
Source #
File: lib/class-anspress-upgrader.php
private function __construct() {
$this->check_tables();
// Enable required addons.
ap_activate_addon( 'tag.php' );
ap_activate_addon( 'category.php' );
ap_activate_addon( 'reputation.php' );
// Disable sending email while upgrading.
define( 'AP_DISABLE_EMAIL', true );
// Also disable inserting of reputations and notifications.
define( 'AP_DISABLE_INSERT_NOTI', true );
$this->check_old_meta_table_exists();
$this->get_question_ids();
foreach ( (array) $this->question_ids as $id ) {
// translators: %s is question ID.
echo esc_attr( "\n\r" . sprintf( __( 'Migrating question: %d', 'anspress-question-answer' ), $id ) . "\n\r" );
$this->question_tasks( $id );
}
$this->migrate_reputations();
$this->migrate_category_data();
}
Expand full source code Collapse full source code View on GitHub: lib/class-anspress-upgrader.php:54
Add your comment