PluginProbe
Unique Headers / 1.3.7
Unique Headers v1.3.7
2.1.3 2.1 2.1.1 2.0.1 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1 1.2 1.2.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.7 1.3.8 1.3.9 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 All 54 releases
unique-headers / index.php

index.php in Unique Headers 1.3.7, at index.php

107 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Unique Headers
4 Plugin URI: http://geek.ryanhellyer.net/products/unique-headers/
5 Description: Unique Headers
6 Version: 1.3.7
7 Author: Ryan Hellyer
8 Author URI: http://geek.ryanhellyer.net/
9
10 ------------------------------------------------------------------------
11 Copyright Ryan Hellyer
12
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
27 */
28
29
30
31 /**
32 * Do not continue processing since file was called directly
33 *
34 * @since 1.0
35 * @author Ryan Hellyer <ryanhellyer@gmail.com>
36 */
37 if ( ! defined( 'ABSPATH' ) ) {
38 die( 'Eh! What you doin in here?' );
39 }
40
41
42 /**
43 * Load classes
44 *
45 * @since 1.0
46 * @author Ryan Hellyer <ryanhellyer@gmail.com>
47 */
48 require( 'inc/class-unique-headers-taxonomy-header-images.php' );
49 require( 'inc/class-unique-headers-display.php' );
50 require( 'inc/class-custom-image-meta-box.php' );
51 require( 'inc/legacy.php' );
52
53
54 /**
55 * Instantiate classes
56 *
57 * @since 1.3
58 * @author Ryan Hellyer <ryanhellyer@gmail.com>
59 */
60 function unique_headers_instantiate_classes() {
61
62 $name = 'custom-header-image'; // This says "custom-header" instead of "unique-header" to ensure compatibilty with Justin Tadlock's Custom Header Extended plugin which originally used a different post meta key value than the Unique Headers plugin
63 $args = array(
64 'name' => $name,
65 'dir_uri' => plugin_dir_url( __FILE__ ) . 'assets',
66 'title' => __( 'Custom header', 'unique-headers' ),
67 'set_custom_image' => __( 'Set Custom Header Image', 'unique-headers' ),
68 'remove_custom_image' => __( 'Remove Custom Header Image', 'unique-headers' ),
69 'post_types' => apply_filters( 'unique_headers_post_types', array( 'post', 'page' ) ),
70 );
71
72 // Add support for post-types
73 if ( is_admin() ) {
74 new Custom_Image_Meta_Box( $args );
75 } else {
76 new Unique_Headers_Display( array( 'name' => $name ) );
77 }
78
79 // Add support for taxonomies
80 if ( function_exists( 'get_term_meta' ) ) {
81 $args['taxonomies'] = apply_filters( 'unique_headers_taxonomies', array( 'category', 'post_tag' ) );
82 $args['upload_header_image'] = __( 'Upload header image', 'unique-headers' );
83
84 new Unique_Header_Taxonomy_Header_Images( $args );
85 }
86
87 }
88 add_action( 'plugins_loaded', 'unique_headers_instantiate_classes' );
89
90 /*
91 * Setup localization for translations
92 *
93 * @since 1.3
94 * @author Ryan Hellyer <ryanhellyer@gmail.com>
95 */
96 function unique_headers_localization() {
97
98 // Localization
99 load_plugin_textdomain(
100 'unique-headers', // Unique identifier
101 false, // Deprecated abs path
102 dirname( plugin_basename( __FILE__ ) ) . '/languages/' // Languages folder
103 );
104
105 }
106 unique_headers_localization();
107