diff --git a/ceo-config.php b/ceo-config.php index 3bc3867..6393ab1 100644 --- a/ceo-config.php +++ b/ceo-config.php @@ -69,7 +69,8 @@ if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-op 'enable_embed_nav', 'disable_default_nav', 'disable_mininav', - 'enable_chapter_only_random' + 'enable_chapter_only_random', + 'enable_prevnext_chapter_traversing' ) as $key) { if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0; $ceo_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false ); diff --git a/comiceasel.php b/comiceasel.php index 05ab68b..e813208 100644 --- a/comiceasel.php +++ b/comiceasel.php @@ -3,7 +3,7 @@ Plugin Name: Comic Easel Plugin URI: http://comiceasel.com Description: Comic Easel allows you to incorporate a WebComic using the WordPress Media Library functionality with Navigation into almost all WordPress themes. With just a few modifications of adding injection do_action locations into a theme, you can have the theme of your choice display and manage a webcomic. -Version: 1.5.2 +Version: 1.5.3 Author: Philip M. Hofer (Frumph) Author URI: http://frumph.net/ @@ -372,7 +372,8 @@ function ceo_load_options($reset = false) { 'buy_comic_print_amount' => '25.00', 'buy_comic_sell_original' => true, 'buy_comic_orig_amount' => '65.00', - 'buy_comic_text' => __('*Additional shipping charges will applied at time of purchase.','comiceasel') + 'buy_comic_text' => __('*Additional shipping charges will applied at time of purchase.','comiceasel'), + 'enable_prevnext_chapter_traversing' => false ) as $field => $value) { $ceo_config[$field] = $value; } @@ -417,13 +418,14 @@ function ceo_pluginfo($whichinfo = null) { // comic-easel plugin directory/url 'plugin_url' => plugin_dir_url(__FILE__), 'plugin_path' => plugin_dir_path(__FILE__), - 'version' => '1.5' + 'version' => '1.5.3' ); // Combine em. $ceo_pluginfo = array_merge($ceo_pluginfo, $ceo_addinfo); $ceo_pluginfo = array_merge($ceo_pluginfo, $ceo_options); if (!isset($ceo_pluginfo['disable_style_sheet'])) $ceo_pluginfo['disable_style_sheet'] = false; if (!isset($ceo_pluginfo['enable_transcripts_in_comic_posts'])) $ceo_pluginfo['enable_transcripts_in_comic_posts'] = false; + if (!isset($ceo_pluginfo['enable_prevnext_chapter_traversing'])) $ceo_pluginfo['enable_prevnext_chapter_traversing'] = false; } if ($whichinfo) { if (isset($ceo_pluginfo[$whichinfo])) { diff --git a/css/comiceasel.css b/css/comiceasel.css index 2c2d2d4..4ad7906 100644 --- a/css/comiceasel.css +++ b/css/comiceasel.css @@ -98,8 +98,6 @@ table#comic-nav-wrapper { color: #ffcf00; } - - #comic img { margin: 0; padding: 0; diff --git a/functions/admin-meta.php b/functions/admin-meta.php index 99c65b0..f95df74 100644 --- a/functions/admin-meta.php +++ b/functions/admin-meta.php @@ -20,6 +20,10 @@ function ceo_admin_init() { add_action('create_term', 'ceo_chapters_add_edit_menu_order'); // add_filter('get_terms_args', 'ceo_chapters_find_menu_orderby'); + + + add_action( 'restrict_manage_posts', 'ceo_filter_restrict_manage_posts' ); + add_filter( 'parse_query', 'ceo_taxonomy_filter_post_type_request' ); } function ceo_chapters_add_edit_menu_order($term_id) { @@ -157,6 +161,46 @@ function ceo_manage_comic_columns($column_name, $id) { } // end switch } +// Filter the request to just give posts for the given taxonomy, if applicable. +function ceo_filter_restrict_manage_posts() { + global $typenow; + if ('comic' == $typenow) { + $post_types = get_post_types( array( '_builtin' => false ) ); + if ( in_array( $typenow, $post_types ) ) { + $filters = get_object_taxonomies( $typenow ); + // remove post tag + $filters = array_diff($filters, array('post_tag')); + foreach ( $filters as $tax_slug ) { + $tax_obj = get_taxonomy( $tax_slug ); + wp_dropdown_categories( array( + 'show_option_all' => __('Show All '.$tax_obj->label ), + 'taxonomy' => $tax_slug, + 'name' => $tax_obj->name, + 'orderby' => 'name', + 'selected' => (isset($_GET[$tax_slug])) ? $_GET[$tax_slug] : '', + 'hierarchical' => $tax_obj->hierarchical, + 'show_count' => false, + 'hide_empty' => true + ) ); + } + } + } +} + +function ceo_taxonomy_filter_post_type_request( $query ) { + global $pagenow, $typenow; + if ( 'edit.php' == $pagenow ) { + $filters = get_object_taxonomies( $typenow ); + foreach ( $filters as $tax_slug ) { + $var = &$query->query_vars[$tax_slug]; + if ( isset( $var ) ) { + $term = get_term_by( 'id', $var, $tax_slug ); + if (!empty($term)) $var = $term->slug; + } + } + } +} + function ceo_edit_select_motion_artist_directory_in_post($post) { $current_directory = get_post_meta( $post->ID, 'ma-directory', true ); diff --git a/functions/displaycomic.php b/functions/displaycomic.php index 5f6518c..355c6c1 100644 --- a/functions/displaycomic.php +++ b/functions/displaycomic.php @@ -140,12 +140,13 @@ function ceo_display_comic_gallery($size = 'full') { if ($comic_lightbox) $output .= '