diff --git a/classes/ComicPressFilters.inc b/classes/ComicPressFilters.inc deleted file mode 100644 index 5ae7be1..0000000 --- a/classes/ComicPressFilters.inc +++ /dev/null @@ -1,83 +0,0 @@ -comicpress =& ComicPress::get_instance(); - - foreach (array( - 'comicpress_display_attached_images' => 3, - 'the_content' => 1, - 'show_media' => 3 - ) as $filter => $param_count) { - add_filter($filter, array(&$this, $filter), 10, $param_count); - } - - } - - function comicpress_display_attached_images($images, $post_id, $content) { - return array($images, $post_id, implode("\n", $images)); - } - - /** - * Callback to send the reader to a random comic. - */ - function template_redirect() { - global $post; - if (get_query_var(apply_filters('comicpress_random_comic_string', 'randomcomic'))) { - $random_comic_query = new WP_Query(); - $random_comic_query->query('showposts=1&orderby=rand&cat=' . $this->comicpress->get_all_comic_categories_as_cat_string()); - while ($random_comic_query->have_posts()) { - $random_comic_query->the_post(); - break; - } - if (!empty($post)) { - wp_redirect(get_permalink($post->ID)); - } else { - wp_redirect(get_bloginfo('url')); - } - } - } - - /** - * Markup to insert a comic into the comic feed. - */ - function comic_feed() { ?> -

comic_feed() . $content; - } else { - return $content; - } - } - - /** - * Show comic media. - * @param object $override_post If not null, the post to use instead of the current Loop post. - * @param string $method The method to call on the comic post. - */ - function show_media($override_post, $method, $format) { - global $post; - $post_to_use = !empty($override_post) ? $override_post : $post; - - switch ($this->comicpress->comicpress_options['comic_space']) { - case "comic_only": - $comic_post = new ComicPressComicPost($post_to_use, &$this->comicpress); - $comic_post->{$method}($format); - break; - case "post_content": - $t = $post; - $post = $post_to_use; - include_partial('index-blog-post'); - $post = $t; - break; - } - } -} - -?> \ No newline at end of file diff --git a/comicpress-core.php b/comicpress-core.php index 56508b3..8ad96b6 100644 --- a/comicpress-core.php +++ b/comicpress-core.php @@ -44,10 +44,9 @@ function __comicpress_init() { $comicpress = ComicPress::get_instance(); $comicpress->init(); - $comicpress_admin = new ComicPressAdmin(); - $comicpress_admin->init(); - $comicpress_admin->handle_update(); - - $comicpress_filters = new ComicPressFilters(); - $comicpress_filters->init(); + if (is_admin()) { + $comicpress_admin = new ComicPressAdmin(); + $comicpress_admin->init(); + $comicpress_admin->handle_update(); + } }