Automattic\WooCommerce\Blocks
Installer::add_create_table_notice()
Add a notice if table creation fails.
Метод класса: Installer{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->add_create_table_notice( $table_name );
- $table_name(строка) (обязательный)
- Name of the missing table.
Код Installer::add_create_table_notice() Installer::add create table notice WC 7.5.0
protected function add_create_table_notice( $table_name ) { add_action( 'admin_notices', function() use ( $table_name ) { echo '<div class="error"><p>'; printf( /* translators: %1$s table name, %2$s database user, %3$s database name. */ esc_html__( 'WooCommerce %1$s table creation failed. Does the %2$s user have CREATE privileges on the %3$s database?', 'woocommerce' ), '<code>' . esc_html( $table_name ) . '</code>', '<code>' . esc_html( DB_USER ) . '</code>', '<code>' . esc_html( DB_NAME ) . '</code>' ); echo '</p></div>'; } ); }