• The plugin works in my test environment, authorization was a bit tricky, but now it posts to Mastodon.

    Featured images are posted to Mastodon, but not images included from the media library via the Image block in the editor. Any idea, what’s the problem or how to change that? I don’t quite understand the “attached image” relationship in this context.

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Jan Boddez

    (@janboddez)

    That’s right, only featured and attached images are included by default.

    That said, it would be possible to use the plugin’s existing filters to come up with some add-on code to also include “other” pictures (but it’s not going to be very straightforward).

    Re: attached images:

    If a media file is uploaded within the edit screen, it will automatically be attached to the current post being edited. If it is uploaded via the
    Media Add New Screen or Media Library Screen it will be unattached, but may become attached to a post when it is inserted into post[.]

    Using Image and File Attachments

    In my experience, images uploaded through another post (and perhaps even the Media Library) will not suddenly become attached to the post currently being edited when they are inserted into it.

    Thread Starter Martin Junius

    (@n0ll)

    Thanks for the quick response. Indeed it seems that my images as in the example post are not attached. Is there any way to mark images as attached to a post? I’m uploading all my images via WP/LR into the media lib and corresponding pages. Then I insert them into new posts.

    Plugin Author Jan Boddez

    (@janboddez)

    There seems to be one way: visit the Media Library, and then select, on the top left, the list view (rather than the grid view).

    In the “Uploaded To” column, you should see attached posts (and a “detach” link). For unattached images, there’s an “attach” link.

    Thread Starter Martin Junius

    (@n0ll)

    Ok, had a look. All the images are already attached to the corresponding pages for the albums uploaded by WP/LR. So this isn’t the way to go for my setup.

    Thread Starter Martin Junius

    (@n0ll)

    Would something like that

    $attachments = get_children(array('post_parent' => $post->ID,
                            'post_status' => 'inherit',
                            'post_type' => 'any',
                            'post_mime_type' => 'image'));

    instead of get_attached_media() work in class Post_Handler?

    Plugin Author Jan Boddez

    (@janboddez)

    Hi, if the images are already attached to a different page, no, get_children() will not likely not return them (they would be “children” of the _other_ page).

    I may add some code that covers your use case in a next version.

    Plugin Author Jan Boddez

    (@janboddez)

    The current version of the plugin comes with a way to also include “in-content” images (even if they’re not “attached” to the current post).

    It does, however, require you to add a bit of code to your WP install:

    add_filter( 'share_on_mastodon_referenced_images', '__return_true' );

    In the next version, which I hope to release this week or so, this will be a “proper” UI setting. The filter will keep working, though (and even accepts a second $post parameter so that you could fine-tune this behavior, like only do this for posts in a certain category or something).

    • This reply was modified 1 year, 7 months ago by Jan Boddez.
    Thread Starter Martin Junius

    (@n0ll)

    That‘s great news. Thanks a lot! I will try this out asap.

    Thread Starter Martin Junius

    (@n0ll)

    Just added the line above to my theme’s functions.php and it works as advertised. 🙂 Test posting see here https://mastodon.social/@phtnnz/109938637878329502

    Thanks a lot!

    Is there any way to force (re-)sharing of existing posts on my WP?

    Plugin Author Jan Boddez

    (@janboddez)

    Sorry for the late answer, I kinda looked over that last question 🙂

    Is there any way to force (re-)sharing of existing posts on my WP?

    It depends. It used to actually do this, if you had the “Share Always” option enabled and then mass-updated through WP Admin’s “Quick Edit” menu, for instance. It would then share a whole bunch of posts at once (but not anymore, as a few people [rightfully] complained about this behavior).

    But you can go in and edit the post, and check the Share on Mastodon checkbox and hit “Update.” And for posts that were previously shared, you can “unlink” the existing Mastodon post, recheck the box, and “Update” your post. That should be enough to (re)share older posts.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Inserted image blocks not posted to Mastodon’ is closed to new replies.