我无法将下面函数中的最后一个数组插入表中。我猜是语法问题,但我没有找到它,需要帮助。该函数在 Wordpress 安装上激活插件时插入数据库值:
function my_plugin_install_function() {
global $wpdb;
$table_name = $wpdb->prefix . "revslider_sliders";
$wpdb->insert( $table_name, array(
'title' => 'test',
'alias' => 'test2',
'params' => array (
'title' => 'Homepage Slider',
'alias' => 'homepage-slider',
'shortcode' => '[rev_slider homepage-slider]',
'slider_type' => 'fixed',
'width' => 875,
'height' => 350,
'responsitive_w1' => 'NULL',
'responsitive_sw1' => 'NULL',
'responsitive_w2' => 'NULL',
'responsitive_sw2' => 'NULL',
'responsitive_w3' => 'NULL',
'responsitive_sw3' => 'NULL',
'responsitive_w4' => 'NULL',
'responsitive_sw4' => 'NULL',
'responsitive_w5' => 'NULL',
'responsitive_sw5' => 'NULL',
'responsitive_w6' => 'NULL',
'responsitive_sw6' => 'NULL',
'delay' => 8000,
'touchenabled' => 'on',
'stop_on_hover' => 'on',
'shuffle' => 'off',
'load_googlefont' => 'true',
'google_font' => 'PT+Sans',
'stop_slider' => 'off',
'stop_after_loops' => 0,
'stop_at_slide' => 2,
'position' => 'center',
'margin_top' => 0,
'margin_bottom' => 0,
'margin_left' => 0,
'margin_right' => 0,
'shadow_type' => 3,
'show_timerbar' => 'false',
'timebar_position' => 'top',
'background_color' => '#fff',
'padding' => 5,
'show_background_image' => 'true',
'background_image' => 'NULL',
'navigation_type' => 'bullet',
'navigation_arrows' => 'verticalcentered',
'navigation_style' => 'navbar-old',
'nav_offset_hor' => 0,
'nav_offset_vert' => 20,
'navigaion_always_on' => 'false',
'hide_thumbs' => 200,
'thumb_width' => 100,
'thumb_height' => 50,
'thumb_amount' => 5,
'hide_slider_under' => 0,
'hide_defined_layers_under' => 0,
'hide_all_layers_under' => 0,
'jquery_noconflict' => 'on',
'js_to_body' => 'false',
'output_type' => 'none',
)
), array('%s', '%s', '')
);