Gallery Pro Table进入wordpress的mysql

时间:2016-07-31 08:13:58

标签: php mysql wordpress

如何在sed -ne 's/.*\<\(2016[0-9]\{6\}\)\>.*Serial Number.*/\1/p' filename Gallery Promysql插件表转换为wordpress

我需要查找Gallery Pro插件查询以通过Rest API在App上显示图库图像

在管理员面板中,我使用短代码[WG id=1606]将新图像添加到图库中 它将行放入wp_posts

当我从PC添加图像时,使用post_parent = '1606'

添加新行

但是当我在服务器上添加图像时,它不会向wp_posts表添加任何行

1 个答案:

答案 0 :(得分:0)

我找到了解决方案:

    $lksg_Id = '1606';
    $TotalImg =  get_post_meta( $lksg_Id, 'lksg_total_images_count', true );
    $lksg_Gallery_Settings = "lksg_Gallery_Settings_".$lksg_Id;
    $lksg_AllPhotosDetails = unserialize(base64_decode(get_post_meta( $lksg_Id, 'lksg_all_photos_details', true)));
    // echo 'All Photos Details : <br /> ' . var_dump($lksg_AllPhotosDetails) . '<br /><br /><br />';
    if(count($lksg_Gallery_setting)) {
        $lk_gallery_title       =   $lksg_Gallery_setting['lk_gallery_title'];
        $lk_show_image_label        =   $lksg_Gallery_setting['lk_show_image_label'];
        $lk_Gallery_Layout      =   $lksg_Gallery_setting['lk_Gallery_Layout'];
        $wgp_Color          =   $lksg_Gallery_setting['wgp_Color'];
        $lk_label_Color             =       $lksg_Gallery_setting['lk_label_Color'];
        $lk_desc_font_Color         =       $lksg_Gallery_setting['lk_desc_font_Color'];
        $lk_btn_Color               =       $lksg_Gallery_setting['lk_btn_Color'];
        $lk_btn_font_Color      =       $lksg_Gallery_setting['lk_btn_font_Color'];
        $lk_font_style          =       $lksg_Gallery_setting['lk_font_style'];
        $lk_Custom_CSS          =       $lksg_Gallery_setting['lk_Custom_CSS'];
        $lk_show_img_desc       =       $lksg_Gallery_setting['lk_show_img_desc'];
        $lk_Light_Box           =       $lksg_Gallery_setting['lk_Light_Box'];
        $lk_open_link           =       $lksg_Gallery_setting['lk_open_link'];
        $lk_button_title        =       $lksg_Gallery_setting['lk_button_title'];
    }
    // echo 'Gallery setting : ' . var_dump($lksg_Gallery_setting) . '<br /><br /><br />';
    // echo 'Total Img : ' . var_dump($TotalImg) . '<br /><br /><br />';
    $results = array();
    if($TotalImg) {
        foreach($lksg_AllPhotosDetails as $data) {
            // echo 'data : <br /> '  . var_dump($data) . '<br /><br /><br />';
            $item = new stdclass();
            // $item->id = $data->ID;
            $item->title = $data['lksg_image_label'];
            $item->content = $data['img_desc'];
            $item->image = $data['lksg_image_url'];
            $item->tbn = $data['lksg_img_medium'];
            $results[] = $item;
        }
    }
    // Finally Return Array As Json String