Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • drax

    (@dracula385)

    same issue here…i get

    Uncaught TypeError: Cannot read properties of undefined (reading 'startsWith')
        at HTMLAnchorElement.<anonymous> (misc.js?ver=5.9.1:431:27)
        at HTMLBodyElement.dispatch (jquery.min.js?ver=3.6.0:2:43064)
        at HTMLBodyElement.v.handle (jquery.min.js?ver=3.6.0:2:41048)

    i’ve managed to get it working….

    function create_custom_fields($post_id, $data) {
        global $wpdb;
        foreach ($data as $k => $v) {
            // anything that doesn't start with csv_ is a custom field
            if (!preg_match('/^csv_/', $k) && $v != '') {
              if ($k=='_wp_attached_file') {
                $imageID = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '$k' AND meta_value LIKE '%$v%'");
                $wpdb->query( "UPDATE $wpdb->posts SET post_parent = '$post_id' WHERE ID = $imageID" );
                add_post_meta($imageID, '_wp_attachment_image_alt', trim($data['csv_post_title']).' '.trim($data['csv_post_excerpt']));
                add_post_meta($post_id, '_thumbnail_id', $imageID);
              }
              else
                add_post_meta($post_id, $k, $v);
            }
        }
    }

    Problem was that the when i upload images trough Import Legacy Media images went to some folder so query didn’t find any image id.

    Note that this version is just when you upload one image to set it featured..

    CSV looks like this:

    csv_post_title,csv_post_categories,_wp_attached_file,_wp_attachment_image_alt
    Specijalni program radne i za?titne uniforme 2,Specijalno,specijalno2.jpg,specijalno2
    Specijalni program radne i za?itne uniforme 3,Specijalno,specijalno3.jpg,specijalno3
    Specijalni program radne i za?itne uniforme 4,Specijalno,specijalno4.jpg,specijalno4
    drax

    (@dracula385)

    is there enybody that resolved that issue with blank spaces

    drax

    (@dracula385)

    i also experience this problem with blank spaces (nextgen 1.3.6)…alex the link you’ve gave on google code, i can’t manage to figure what exacly to change to prevent blank spaces to build.. So please can u post here what should exaclty to be modified. I use default nextgen gallery.php template. Tnx alex again for making our gallery’s powerfull.

Viewing 4 replies - 1 through 4 (of 4 total)