diff --git a/addons/Core/Core.inc b/addons/Core/Core.inc
index 07cf40e..0f6e6ea 100644
--- a/addons/Core/Core.inc
+++ b/addons/Core/Core.inc
@@ -56,6 +56,14 @@ class ComicPressAddonCore extends ComicPressAddon {
'html' => '
' . implode("\n", $field_html_lines) . ''
);
+ $form_fields['auto_attach'] = array(
+ 'label' => __("Auto-attach?", 'comicpress'),
+ 'input' => 'html',
+ 'html' => ' '
+ . __('Attach to this post w/o needing to insert into post', 'comicpress')
+ . ''
+ );
+
return $form_fields;
}
@@ -128,6 +136,13 @@ class ComicPressAddonCore extends ComicPressAddon {
if (isset($settings['comic_image_type'])) {
update_post_meta($post_id, 'comic_image_type', $settings['comic_image_type']);
}
+ if (isset($settings['auto_attach'])) {
+ if (isset($settings['post_parent'])) {
+ $media_post = get_post($post_id);
+ $media_post->post_parent = $settings['post_parent'];
+ wp_update_post($media_post);
+ }
+ }
}
} else {
//coming from us