| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Custom Post Widget |
| 4 |
Plugin URI: http://www.vanderwijk.com/services/web-design/wordpress-custom-post-widget/ |
| 5 |
Description: Show the content of a custom post of the type 'content_block' in a widget. |
| 6 |
Version: 1.5 |
| 7 |
Author: Johan van der Wijk |
| 8 |
Author URI: http://www.vanderwijk.com |
| 9 |
License: GPL2 |
| 10 |
|
| 11 |
Release notes: 1.5 Thanks to Caspar from GlückPress (http://glueckpress.com) the plugin |
| 12 |
now has its own icon and as requested by Stephen James the author field has been added |
| 13 |
to the Content Block edit screen. |
| 14 |
|
| 15 |
Copyright 2011 Johan van der Wijk (email: info@vanderwijk.com) |
| 16 |
|
| 17 |
This program is free software; you can redistribute it and/or modify |
| 18 |
it under the terms of the GNU General Public License, version 2, as |
| 19 |
published by the Free Software Foundation. |
| 20 |
|
| 21 |
This program is distributed in the hope that it will be useful, |
| 22 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 |
GNU General Public License for more details. |
| 25 |
|
| 26 |
You should have received a copy of the GNU General Public License |
| 27 |
along with this program; if not, write to the Free Software |
| 28 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 |
*/ |
| 30 |
|
| 31 |
/* Set constant path to the custom-post-widget plugin directory. */ |
| 32 |
define( 'CUSTOM_POST_WIDGET_DIR', plugin_dir_path( __FILE__ ) ); |
| 33 |
define( 'CUSTOM_POST_WIDGET_URL', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),'',plugin_basename(__FILE__)) ); |
| 34 |
define( 'CUSTOM_POST_WIDGET_TEXTDOMAIN', 'custom-post-widget' ); |
| 35 |
|
| 36 |
/* Launch the plugin. */ |
| 37 |
add_action( 'plugins_loaded', 'custom_post_widget_plugin_init' ); |
| 38 |
|
| 39 |
/** |
| 40 |
Initialize the plugin. This function loads the required files needed for the plugin |
| 41 |
to run in the proper order and adds needed functions to the required hooks. |
| 42 |
*/ |
| 43 |
function custom_post_widget_plugin_init() { |
| 44 |
|
| 45 |
/* Load the translation of the plugin. */ |
| 46 |
load_plugin_textdomain( CUSTOM_POST_WIDGET_TEXTDOMAIN, false, 'custom-post-widget/languages' ); |
| 47 |
|
| 48 |
add_action( 'widgets_init', 'custom_post_widget_load_widgets' ); |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
Loads the widgets packaged with the plugin. |
| 53 |
*/ |
| 54 |
function custom_post_widget_load_widgets() { |
| 55 |
require_once( CUSTOM_POST_WIDGET_DIR . '/post-widget.php' ); |
| 56 |
register_widget( 'custom_post_widget' ); |
| 57 |
} |
| 58 |
|
| 59 |
?> |