From 844fc66babb9da2d5b0c8fa6265be2a0d4a3f9ca Mon Sep 17 00:00:00 2001 From: Frumph Date: Tue, 21 Oct 2014 14:48:47 -0700 Subject: [PATCH] 1.8 Rev. * added two input boxes to the archive tab to allow changing the name and slug references for 'chapter' --- ceo-config.php | 7 ++-- comiceasel.php | 49 ++++++++++++++++++--------- functions/injections.php | 2 +- options/archive.php | 71 ++++++++++++++++++++++++++++++++++++++++ options/general.php | 38 --------------------- options/main.php | 2 +- readme.txt | 8 ++++- 7 files changed, 118 insertions(+), 59 deletions(-) diff --git a/ceo-config.php b/ceo-config.php index 23bd9af..eb3af9a 100644 --- a/ceo-config.php +++ b/ceo-config.php @@ -87,11 +87,14 @@ if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-op if ($_REQUEST['action'] == 'ceo_save_archive') { -/* foreach (array( + foreach (array( + 'custom_post_type_slug_name', + 'chapter_type_slug_name', + 'chapter_type_name_plural' ) as $key) { if (isset($_REQUEST[$key])) $ceo_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]); - } */ + } foreach (array( 'include_comics_in_blog_archive' diff --git a/comiceasel.php b/comiceasel.php index 4c59a41..76cb541 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.7.7.1 +Version: 1.8 Author: Philip M. Hofer (Frumph) Author URI: http://frumph.net/ @@ -78,18 +78,25 @@ function ceo_initialize_post_types() { 'description' => 'Post type for Comics' )); + $chapter_slug = ceo_pluginfo('chapter_type_slug_name'); + $chapter_slug_plural = ucwords(ceo_pluginfo('chapter_type_name_plural')); + + if (empty($chapter_slug) || is_array($chapter_slug)) $chapter_slug = 'chapter'; + if (empty($chapter_slug_plural) || is_array($chapter_slug_plural)) $chapter_slug_plural = 'Chapters'; + $labels = array( - 'name' => __( 'Chapters', 'comiceasel' ), - 'singular_name' => __( 'Chapter', 'comiceasel' ), - 'search_items' => __( 'Search Chapters', 'comiceasel' ), - 'popular_items' => __( 'Popular Chapters', 'comiceasel' ), - 'all_items' => __( 'All Chapters', 'comiceasel' ), - 'parent_item' => __( 'Parent Chapter', 'comiceasel' ), - 'parent_item_colon' => __( 'Parent Chapter:', 'comiceasel' ), - 'edit_item' => __( 'Edit Chapters', 'comiceasel' ), - 'update_item' => __( 'Update Chapters', 'comiceasel' ), - 'add_new_item' => __( 'Add New Chapter', 'comiceasel' ), - 'new_item_name' => __( 'New Chapter Name', 'comiceasel' ), + 'name' => $chapter_slug_plural, + 'menu_name' => $chapter_slug_plural, + 'singular_name' => ucwords($chapter_slug), + 'search_items' => __( 'Search', 'comiceasel' ).' '.$chapter_slug_plural, + 'popular_items' => __( 'Popular', 'comiceasel' ).' '.$chapter_slug_plural, + 'all_items' => __( 'All', 'comiceasel' ).' '.$chapter_slug_plural, + 'parent_item' => __( 'Parent', 'comiceasel' ).' '.ucwords($chapter_slug), + 'parent_item_colon' => __( 'Parent', 'comiceasel' ).' '.ucwords($chapter_slug).':', + 'edit_item' => __( 'Edit', 'comiceasel' ).' '.$chapter_slug_plural, + 'update_item' => __( 'Update', 'comiceasel' ).' '.$chapter_slug_plural, + 'add_new_item' => __( 'Add New', 'comiceasel' ).' '.ucwords($chapter_slug), + 'new_item_name' => __( 'New', 'comiceasel' ).' '.ucwords($chapter_slug).__('Name') ); register_taxonomy('chapters', 'comic', array( @@ -100,7 +107,7 @@ function ceo_initialize_post_types() { 'query_var' => true, 'show_tagcloud' => false, 'has_archive' => true, - 'rewrite' => array( 'slug' => 'chapter', 'with_front' => true, 'feeds' => true ), + 'rewrite' => array( 'slug' => $chapter_slug, 'with_front' => true, 'feeds' => false ), )); $labels = array( @@ -149,9 +156,11 @@ function ceo_initialize_post_types() { 'query_var' => true, 'show_tagcloud' => false, 'rewrite' => array( 'slug' => 'location', 'with_front' => true, 'feeds' => false ), - )); + )); + if (ceo_pluginfo('allow_comics_to_have_categories')) register_taxonomy_for_object_type('category', 'comic'); + register_taxonomy_for_object_type('post_tag', 'comic'); register_taxonomy_for_object_type('chapters', 'comic'); register_taxonomy_for_object_type('characters', 'comic'); @@ -379,6 +388,8 @@ function ceo_load_options($reset = false) { 'include_comics_in_blog_archive' => false, 'disable_related_comics' => true, 'custom_post_type_slug_name' => __('comic','comiceasel'), + 'chapter_type_slug_name' => __('chapter', 'comiceasel'), + 'chapter_type_name_plural' => __('chapters', 'comiceasel'), 'display_first_comic_on_home_page' => false, 'disable_style_sheet' => false, 'enable_transcripts_in_comic_posts' => false, @@ -445,7 +456,13 @@ function ceo_pluginfo($whichinfo = null) { $ceo_options['db_version'] = '1.6'; $ceo_options['thumbnail_size_for_facebook'] = 'large'; update_option('comiceasel-config', $ceo_options); - } + } + if (version_compare($ceo_options['db_version'], '1.7', '<')) { + $ceo_options['db_version'] = '1.7'; + $ceo_options['chapter_type_slug_name'] = 'chapter'; + $ceo_options['chapter_type_name_plural'] = 'chapters'; + update_option('comiceasel-config', $ceo_options); + } $ceo_coreinfo = wp_upload_dir(); $ceo_addinfo = array( // if wp_upload_dir reports an error, capture it @@ -462,7 +479,7 @@ function ceo_pluginfo($whichinfo = null) { // comic-easel plugin directory/url 'plugin_url' => plugin_dir_url(__FILE__), 'plugin_path' => plugin_dir_path(__FILE__), - 'version' => '1.7.7.1' + 'version' => '1.8' ); // Combine em. $ceo_pluginfo = array_merge($ceo_pluginfo, $ceo_addinfo); diff --git a/functions/injections.php b/functions/injections.php index d7c88ec..9d56322 100644 --- a/functions/injections.php +++ b/functions/injections.php @@ -36,7 +36,7 @@ function ceo_display_comic_post_info() { function ceo_display_comic_chapters() { global $post; if ($post->post_type == 'comic') { - $before = '
'.__('Chapter','comiceasel').': '; + $before = '
'.ucwords(ceo_pluginfo('chapter_type_slug_name')).': '; $sep = ', '; $after = '
'; echo apply_filters('ceo_display_comic_chapters', get_the_term_list( $post->ID, 'chapters', $before, $sep, $after )); diff --git a/options/archive.php b/options/archive.php index db7fb40..da45c16 100644 --- a/options/archive.php +++ b/options/archive.php @@ -20,8 +20,79 @@ + + + + + /> + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+
+ permalink and click SAVE so that the permalink structure can be recognized by WordPress','comiceasel'); ?> +
+
+ + + +
+ +
+
+
+ permalink and click SAVE so that the permalink structure can be recognized by WordPress','comiceasel'); ?> +
+
+
+
+
+

diff --git a/options/general.php b/options/general.php index 8c841a0..a38d9a3 100644 --- a/options/general.php +++ b/options/general.php @@ -240,44 +240,6 @@ foreach ($thumbnail_sizes as $size) { ?>
- - - - - - - - - - - - - - - - - - -
-
- - - -
- -
-
-
- permalink and click SAVE so that the permalink structure can be recognized by WordPress','comiceasel'); ?> -
- /> - - -

diff --git a/options/main.php b/options/main.php index 587094e..5b6565c 100644 --- a/options/main.php +++ b/options/main.php @@ -30,7 +30,7 @@ -
+
diff --git a/readme.txt b/readme.txt index faf2ead..98bc182 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: Frumph Tags: comiceasel, easel, webcomic, comic, webcomic Requires at least: 3.2 Tested up to: 4.0 -Stable tag: 1.7.7.1 +Stable tag: 1.8 Donate link: http://frumph.net License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -127,6 +127,12 @@ The comic navigation widget is only seen if you have the comic sidebar's enabled == Changelog == += 1.8 = +* Added some tabs in the comic - config +* Moved the post type name options to the 'archive' tab +* Added a couple of new options that allow you to change the word usage for "chapter" to something else + + = 1.7.7.1 = * fixed bug where you couldn't save the facebook image size