From 1cb662d6e68b680bbdfeafc99b09a19e8ba15424 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 4 Dec 2009 21:53:38 -0500 Subject: [PATCH] starting metabox --- .../ComicPressPostMediaHandlingMetabox.inc | 18 +++++++++++++ .../partials/post-media-handling/metabox.inc | 25 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 classes/partials/post-media-handling/metabox.inc diff --git a/classes/ComicPressPostMediaHandlingMetabox.inc b/classes/ComicPressPostMediaHandlingMetabox.inc index 9bf1afa..6302321 100644 --- a/classes/ComicPressPostMediaHandlingMetabox.inc +++ b/classes/ComicPressPostMediaHandlingMetabox.inc @@ -3,7 +3,25 @@ class ComicPressPostMediaHandlingMetabox { function __comicpress_init() { $n = new ComicPressPostMediaHandlingMetabox(); + add_action('admin_menu', array(&$n, 'admin_menu')); } function handle_update() {} + + function admin_menu() { + add_meta_box('comicpress-post-media-handling', __('ComicPress Post Media', 'comicpress'), array(&$this, 'metabox'), 'post', 'normal', 'low'); + } + + function metabox() { + global $post; + $media_info = get_post_meta($post->ID, 'backend_url_images', true); + if (!is_array($media_info)) { + $media_info = array(); + } + + $nonce = wp_create_nonce('comicpress'); + $action_nonce = wp_create_nonce('comicpress-post-media-update'); + + include('partials/post-media-handling/metabox.inc'); + } } diff --git a/classes/partials/post-media-handling/metabox.inc b/classes/partials/post-media-handling/metabox.inc new file mode 100644 index 0000000..04e5c77 --- /dev/null +++ b/classes/partials/post-media-handling/metabox.inc @@ -0,0 +1,25 @@ + + + +

+ Enter in relative or absolute URLs to the images you want to use for this post. This will override file system searches. +

+ + __('Comic', 'comicpress'), + 'rss' => __('RSS', 'comicpress'), + 'archive' => __('Archive', 'comicpress'), + 'mini' => __('Mini', 'comicpress') + ) as $field => $label) { + $value = isset($media_info[$field]) ? $media_info[$field] : ''; + ?> + + + + + +
URL + +