I see that under Collections & Keywords the folder is set to ID:2. However in RML the RML folder is 46. Although, folder 2 does also exist but does not contain the images either.
-
This reply was modified 8 years ago by
opicron.
Please update to the latest version of WP/LR Sync, it should be available at any minute now 🙂
I tried the new version but the images are not yet added to the folder. They remain in uncategorized.
As an extra also now with the new version deleted files from LR are not removed in WP media.
We’ll have to wait for Matthias for that, unfortunately 🙁 I am actually not using RML myself at this moment, and only provided the extension created by Matthias, but it seems he will fix it.
I added the following code to manually set the correct rml folder on upload. This works for me while an solution is made.
// define the wp_generate_attachment_metadata callback
function my_set_rml_category( $metadata, $attachment_id ) {
if ( current_user_can('importer') )
{
$parentcatid = wp_rml_create_or_return_existing_id("Products", _wp_rml_root(), 0, array(), false, true);
if (!is_array($parentcatid))
{
$categoryid = wp_rml_create_or_return_existing_id("Lightroom", $parentcatid, 0, array(), false, true);
}
//$shortcut = true;
}
if (!is_array($categoryid))
{
$ids = array();
$ids[] = $attachment_id;
//var_dump($parentcatid);
//var_dump($categoryid);
wp_rml_structure_reset();
wp_rml_move( $categoryid, $ids, false, false );
}
// make filter magic happen here...
return $metadata;
};
// add the filter
add_filter( 'wp_generate_attachment_metadata', 'my_set_rml_category', 10, 2 );
I have sent a message to Matthias, he will probably come here and comment 🙂