ThreeWP Broadcast not broadcasting attachment image caption and description

ThreeWP Broadcast: v1.12 doesn’t broadcast the caption and description of attached images. The fix is simple, though it requires editing the plugin files. However, I think the developer is currently not actively working on the plugin, so this is necessary evil.

AttachmentData.php
After line 24, add this:

$attached_obj = get_post($attachment_id);
$returnValue->post_content = $attached_obj->post_content;
$returnValue->post_excerpt = $attached_obj->post_excerpt;

WordPress uses $post->post_content as the description field and $post->post_excerpt as the caption field.

ThreeWP_Broadcast.php
Around line 1833, edit the $attachment array to look like this:

$attachment = array(
 'post_mime_type' => $wp_filetype['type'],
 'post_title' => preg_replace( '/\.[^.]+$/', '', $attachment_data->filename_base() ),
 'post_status' => 'inherit',
 'post_content' => $attachment_data->post_content,
 'post_excerpt' => $attachment_data->post_excerpt
);

The $attachment array will later be used in wp_insert_attachment() so this simply inserts the data into the right place.

And that’s all there is to do!

One thought on “ThreeWP Broadcast not broadcasting attachment image caption and description

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>