WC_Install::verify_base_tables()
Check if all the base tables are present.
Метод класса: WC_Install{}
Хуков нет.
Возвращает
Массив
. List of queries.
Использование
$result = WC_Install::verify_base_tables( $modify_notice, $execute );
- $modify_notice(true|false)
- Whether to modify notice based on if all tables are present.
По умолчанию: true - $execute(true|false)
- Whether to execute get_schema queries as well.
По умолчанию: false
Код WC_Install::verify_base_tables() WC Install::verify base tables WC 7.3.0
public static function verify_base_tables( $modify_notice = true, $execute = false ) { if ( $execute ) { self::create_tables(); } $missing_tables = wc_get_container() ->get( DatabaseUtil::class ) ->get_missing_tables( self::get_schema() ); if ( 0 < count( $missing_tables ) ) { if ( $modify_notice ) { WC_Admin_Notices::add_notice( 'base_tables_missing' ); } update_option( 'woocommerce_schema_missing_tables', $missing_tables ); } else { if ( $modify_notice ) { WC_Admin_Notices::remove_notice( 'base_tables_missing' ); } update_option( 'woocommerce_schema_version', WC()->db_version ); delete_option( 'woocommerce_schema_missing_tables' ); } return $missing_tables; }