PluginProbe
Content Blocks (Custom Post Widget) / 1.5
Content Blocks (Custom Post Widget) v1.5
3.4.3 trunk 1.0 1.1 1.1.1 1.2 1.2.1 1.4 1.5 1.6 1.7 1.8 1.8.1 1.8.3 1.8.4 1.8.5 1.8.6 1.9 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 All 88 releases
custom-post-widget / custom-post-widget.php

custom-post-widget.php in Content Blocks (Custom Post Widget) 1.5, at custom-post-widget.php

59 lines 2.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: 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 ?>