Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 135 lines (119 sloc) 4.389 kb
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
1 <?php
2 /**
3 * Plugin Name: Quote This
4 * Plugin URI: http://justintadlock.com/archives/2009/03/26/quote-this-wordpress-plugin
5 * Description: A plugin for displaying quotes on your site with either the <code>quote_this()</code> function, <code>[quote-this]</code> shortcode, or <em>Quote This</em> widget.
ca8a560 @justintadlock Update version to 0.2.1.
authored
6 * Version: 0.2.1
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
7 * Author: Justin Tadlock
8 * Author URI: http://justintadlock.com
9 *
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
10 * Quote This is a plugin for outputting random quotes from various categories. The quotes are
11 * housed within the plugin so that there's no dependency on external services. Basically, it's just
12 * something I've always used on my blog, and I thought it would be fun to to release.
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
13 *
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
14 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
15 * General Public License as published by the Free Software Foundation; either version 2 of the License,
16 * or (at your option) any later version.
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
17 *
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
18 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
19 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
20 *
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
21 * You should have received a copy of the GNU General Public License along with this program; if not, write
22 * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
23 *
24 * @package QuoteThis
ca8a560 @justintadlock Update version to 0.2.1.
authored
25 * @version 0.2.1
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
26 * @author Justin Tadlock <justin@justintadlock.com>
3af7c1e @justintadlock Fix copyright date and version bump.
authored
27 * @copyright Copyright (c) 2006 - 2012, Justin Tadlock
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
28 * @link http://justintadlock.com/archives/2009/03/26/quote-this-wordpress-plugin
29 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
30 */
31
32 /**
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
33 * Class to launch the plugin. Just a simple wrapper to clean things up nicely. I've set it to 'final' for
34 * the moment because I have plans for major changes and don't want to mess up anyone's classes
35 * if they try to extend it.
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
36 *
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
37 * @since 0.2.0
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
38 */
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
39 final class Quote_This {
40
41 /**
42 * Constructor method. Sets up needed actions/filters for the plugin.
43 *
44 * @since 0.2.0
45 * @access public
46 * @return void
47 */
48 public function __construct() {
49
50 /* Set the constants needed by the plugin. */
51 add_action( 'plugins_loaded', array( &$this, 'constants' ), 1 );
52
53 /* Internationalize the text strings used. */
54 add_action( 'plugins_loaded', array( &$this, 'i18n' ), 2 );
55
56 /* Load the functions files. */
57 add_action( 'plugins_loaded', array( &$this, 'includes' ), 3 );
58
59 /* Load and register widgets. */
60 add_action( 'widgets_init', array( &$this, 'register_widgets' ) );
61
62 /* Register shortcodes. */
63 add_action( 'init', array( &$this, 'register_shortcodes' ) );
64 }
65
66 /**
67 * Defines constants used by the plugin.
68 *
69 * @since 0.2.0
70 * @access public
71 * @return void
72 */
73 public function constants() {
74
75 /* Set constant path to the members plugin directory. */
76 define( 'QUOTE_THIS_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
77 }
78
79 /**
80 * Loads the translation files.
81 *
82 * @since 0.2.0
83 * @access public
84 * @return void
85 */
86 public function i18n() {
87
88 /* Load the translation of the plugin. */
89 load_plugin_textdomain( 'quote-this', false, 'quote-this/languages' );
90 }
91
92 /**
93 * Loads the initial files needed by the plugin.
94 *
95 * @since 0.2.0
96 * @access public
97 * @return void
98 */
99 public function includes() {
100 require_once( trailingslashit( QUOTE_THIS_DIR ) . 'includes/functions.php' );
101 require_once( trailingslashit( QUOTE_THIS_DIR ) . 'includes/quotes-art.php' );
102 require_once( trailingslashit( QUOTE_THIS_DIR ) . 'includes/quotes-film.php' );
103 require_once( trailingslashit( QUOTE_THIS_DIR ) . 'includes/quotes-friendship.php' );
104 require_once( trailingslashit( QUOTE_THIS_DIR ) . 'includes/quotes-individual.php' );
105 require_once( trailingslashit( QUOTE_THIS_DIR ) . 'includes/quotes-life.php' );
106 require_once( trailingslashit( QUOTE_THIS_DIR ) . 'includes/quotes-literature.php' );
107 }
108
109 /**
110 * Loads and registers widgets.
111 *
112 * @since 0.2.0
113 * @access public
114 * @return void
115 */
116 public function register_widgets() {
117 require_once( trailingslashit( QUOTE_THIS_DIR ) . 'includes/widget-quote-this.php' );
118 register_widget( 'Quote_This_Widget' );
119 }
120
121 /**
122 * Registers shortcodes.
123 *
124 * @since 0.2.0
125 * @access public
126 * @return void
127 */
128 public function register_shortcodes() {
129 add_shortcode( 'quote-this', 'quote_this_shortcode' );
130 }
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
131 }
132
6bf99fe @justintadlock Recode the whole thing and forget about committing every little thing.
authored
133 new Quote_This();
6bf41ff @justintadlock Adding all of the plugin's version 0.1 files.
authored
134
135 ?>
Something went wrong with that request. Please try again.