Помочь с базой данных Wordpress

Иван8 років у сервісі
Дані замовника будуть вам доступні після подання заявки
01.06.2017

На сайте на Wordpress стоит плагин WP All Import, который осуществляет импорт разных данных на сайт. У плагина есть сохраняемые шаблоны импорта

(pmxi_templates). Есть необходимость постоянно вносить большие пакетные

изменения в такие шаблоны, однако плагин в настоящем виде позволяет это

делать только вручную через админку по одной записи за раз. Изменения в

бд, сделанные просто вручную, не работают.

Вот что говорит по этому поводу саппорт плагина:

"The template mapping rules are in a serialized array inside the 'options'

column in the 'pmxi_templates' and 'pmxi_imports' tables. In order to do

this, you'll need to query the database with the WPDB class to grab the

'options', unserialize and edit it, then serialize and re-insert it

into the database.

Here's some really basic example code to show how you can get the mapping rules:

global $wpdb;

$table = $wpdb->prefix . 'pmxi_templates';

$template = $wpdb->get_row( "SELECT * FROM `" . $table . "` WHERE `name` = 'Variable Products Import'" );

if ( !empty( $template ) ) {

$options = $template->options;

$options = maybe_unserialize( $options );

// Update the mapping rules in the $options array

// serialize() and update the options in the database

}

You would need to repeat the same steps to update the 'options' in the 'pmxi_imports' table for the import."

В общем, нужно реализовать вышенаписанное и объяснить мне как этим пользоваться.