Version Description
Various bugfixes and improvements.
Download this release
Release Info
Developer | vanderwijk |
Plugin | Content Blocks (Custom Post Widget) |
Version | 2.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.3
- custom-post-widget.php +7 -12
- post-widget.php +52 -52
- readme.txt +17 -5
custom-post-widget.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Custom Post Widget
|
4 |
-
Plugin URI: http://www.vanderwijk.com/
|
5 |
-
Description: Show the content of a custom post of the type 'content_block' in a widget.
|
6 |
-
Version: 2.
|
7 |
Author: Johan van der Wijk
|
8 |
Author URI: http://www.vanderwijk.com
|
9 |
License: GPL2
|
10 |
|
11 |
-
Release notes: Version 2.
|
12 |
|
13 |
-
Copyright
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License, version 2, as
|
@@ -26,10 +26,6 @@
|
|
26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
29 |
-
// Set constant path to the custom-post-widget plugin directory.
|
30 |
-
define( 'CUSTOM_POST_WIDGET_DIR', plugin_dir_path( __FILE__ ) );
|
31 |
-
define( 'CUSTOM_POST_WIDGET_URL', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),'',plugin_basename(__FILE__)) );
|
32 |
-
|
33 |
// Launch the plugin.
|
34 |
add_action( 'plugins_loaded', 'custom_post_widget_plugin_init' );
|
35 |
|
@@ -42,7 +38,6 @@ function custom_post_widget_plugin_init() {
|
|
42 |
|
43 |
// Loads the widgets packaged with the plugin.
|
44 |
function custom_post_widget_load_widgets() {
|
45 |
-
|
46 |
register_widget( 'custom_post_widget' );
|
47 |
-
}
|
48 |
-
?>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Custom Post Widget
|
4 |
+
Plugin URI: http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/
|
5 |
+
Description: Show the content of a custom post of the type 'content_block' in a widget or with a shortcode.
|
6 |
+
Version: 2.3
|
7 |
Author: Johan van der Wijk
|
8 |
Author URI: http://www.vanderwijk.com
|
9 |
License: GPL2
|
10 |
|
11 |
+
Release notes: Version 2.3 Various bugfixes and improvements
|
12 |
|
13 |
+
Copyright 2013 Johan van der Wijk (email: info@vanderwijk.com)
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License, version 2, as
|
26 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
|
|
|
|
|
|
|
|
29 |
// Launch the plugin.
|
30 |
add_action( 'plugins_loaded', 'custom_post_widget_plugin_init' );
|
31 |
|
38 |
|
39 |
// Loads the widgets packaged with the plugin.
|
40 |
function custom_post_widget_load_widgets() {
|
41 |
+
require( 'post-widget.php' );
|
42 |
register_widget( 'custom_post_widget' );
|
43 |
+
}
|
|
post-widget.php
CHANGED
@@ -26,7 +26,7 @@ class custom_post_widget extends WP_Widget {
|
|
26 |
<label for="<?php echo $this->get_field_id( 'custom_post_id' ); ?>"> <?php echo __( 'Content Block to Display:', 'custom-post-widget' ) ?>
|
27 |
<select class="widefat" id="<?php echo $this->get_field_id( 'custom_post_id' ); ?>" name="<?php echo $this->get_field_name( 'custom_post_id' ); ?>">
|
28 |
<?php
|
29 |
-
$args = array('post_type' => 'content_block', 'suppress_filters' => 0, 'numberposts' => -1, 'order' => 'ASC');
|
30 |
$content_block = get_posts( $args );
|
31 |
if ($content_block) {
|
32 |
foreach( $content_block as $content_block ) : setup_postdata( $content_block );
|
@@ -81,7 +81,7 @@ class custom_post_widget extends WP_Widget {
|
|
81 |
// Display the content block content in the widget area
|
82 |
function widget($args, $instance) {
|
83 |
extract($args);
|
84 |
-
$custom_post_id = ( $instance['custom_post_id'] != '' ) ? esc_attr($instance['custom_post_id']) : __('Find', 'custom-post-widget');
|
85 |
// Add support for WPML Plugin.
|
86 |
if ( function_exists( 'icl_object_id' ) ){
|
87 |
$custom_post_id = icl_object_id( $custom_post_id, 'content_block', true );
|
@@ -93,36 +93,36 @@ class custom_post_widget extends WP_Widget {
|
|
93 |
$content_post = get_post($custom_post_id);
|
94 |
$content = $content_post->post_content;
|
95 |
if ( !$apply_content_filters ) { // Don't apply the content filter if checkbox selected
|
96 |
-
$content = apply_filters('the_content', $content);
|
97 |
}
|
98 |
echo $before_widget;
|
99 |
if ( $show_custom_post_title ) {
|
100 |
-
echo $before_title . apply_filters('widget_title',$content_post->post_title) . $after_title; // This is the line that displays the title (only if show title is set)
|
101 |
}
|
102 |
if ( $show_featured_image ) {
|
103 |
-
echo get_the_post_thumbnail($content_post->ID);
|
104 |
-
}
|
105 |
-
echo do_shortcode($content); // This is where the actual content of the custom post is being displayed
|
106 |
echo $after_widget;
|
107 |
}
|
108 |
}
|
109 |
|
110 |
// Create the Content Block custom post type
|
111 |
-
add_action('init', 'my_content_block_post_type_init');
|
112 |
|
113 |
function my_content_block_post_type_init() {
|
114 |
$labels = array(
|
115 |
-
'name' => _x('Content Blocks', 'post type general name', 'custom-post-widget'),
|
116 |
-
'singular_name' => _x('Content Block', 'post type singular name', 'custom-post-widget'),
|
117 |
-
'plural_name' => _x('Content Blocks', 'post type plural name', 'custom-post-widget'),
|
118 |
-
'add_new' => _x('Add Content Block', 'block', 'custom-post-widget'),
|
119 |
-
'add_new_item' => __('Add New Content Block', 'custom-post-widget'),
|
120 |
-
'edit_item' => __('Edit Content Block', 'custom-post-widget'),
|
121 |
-
'new_item' => __('New Content Block', 'custom-post-widget'),
|
122 |
-
'view_item' => __('View Content Block', 'custom-post-widget'),
|
123 |
-
'search_items' => __('Search Content Blocks', 'custom-post-widget'),
|
124 |
-
'not_found' => __('No Content Blocks Found', 'custom-post-widget'),
|
125 |
-
'not_found_in_trash' => __('No Content Blocks found in Trash', 'custom-post-widget'),
|
126 |
'parent_item_colon' => ''
|
127 |
);
|
128 |
$options = array(
|
@@ -136,75 +136,75 @@ function my_content_block_post_type_init() {
|
|
136 |
'capability_type' => 'post',
|
137 |
'hierarchical' => false,
|
138 |
'menu_position' => null,
|
139 |
-
'supports' => array('title','editor','revisions','thumbnail','author')
|
140 |
);
|
141 |
-
register_post_type('content_block',$options);
|
142 |
}
|
143 |
|
144 |
// Add custom styles to admin screen and menu
|
145 |
-
add_action('admin_head', 'content_block_header');
|
146 |
|
147 |
function content_block_header() {
|
148 |
global $post_type; ?>
|
149 |
<style type="text/css">
|
150 |
<!--
|
151 |
-
<?php if (($post_type == 'content_block')) : ?>
|
152 |
-
#icon-edit { background:transparent url('<?php echo
|
153 |
#minor-publishing-actions { display:none; /* Hide the Save Draft and Preview buttons */}
|
154 |
<?php endif; ?>
|
155 |
-
#adminmenu #menu-posts-content_block div.wp-menu-image{background:transparent url('<?php echo
|
156 |
-
#adminmenu #menu-posts-content_block:hover div.wp-menu-image,#adminmenu #menu-posts-content_block.wp-has-current-submenu div.wp-menu-image{background:transparent url('<?php echo
|
157 |
-->
|
158 |
</style>
|
159 |
<?php
|
160 |
}
|
161 |
|
162 |
-
add_filter('post_updated_messages', 'content_block_messages');
|
163 |
|
164 |
function content_block_messages( $messages ) {
|
165 |
$messages['content_block'] = array(
|
166 |
0 => '',
|
167 |
-
1 => current_user_can( 'edit_theme_options' ) ? sprintf( __('Content Block updated. <a href="%s">Manage Widgets</a>', 'custom-post-widget'), esc_url( 'widgets.php' ) ) : sprintf( __('Content Block updated.', 'custom-post-widget'), esc_url( 'widgets.php' ) ),
|
168 |
-
2 => __('Custom field updated.', 'custom-post-widget'),
|
169 |
-
3 => __('Custom field deleted.', 'custom-post-widget'),
|
170 |
-
4 => __('Content Block updated.', 'custom-post-widget'),
|
171 |
-
5 => isset($_GET['revision']) ? sprintf( __('Content Block restored to revision from %s', 'custom-post-widget'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
172 |
-
6 => current_user_can( 'edit_theme_options' ) ? sprintf( __('Content Block published. <a href="%s">Manage Widgets</a>', 'custom-post-widget'), esc_url( 'widgets.php' ) ) : sprintf( __('Content Block published.', 'custom-post-widget'), esc_url( 'widgets.php' ) ),
|
173 |
-
7 => __('Block saved.', 'custom-post-widget'),
|
174 |
-
8 => current_user_can( 'edit_theme_options' ) ? sprintf( __('Content Block submitted. <a href="%s">Manage Widgets</a>', 'custom-post-widget'), esc_url( 'widgets.php' ) ) : sprintf( __('Content Block submitted.', 'custom-post-widget'), esc_url( 'widgets.php' ) ),
|
175 |
-
9 => sprintf( __('Content Block scheduled for: <strong>%1$s</strong>.', 'custom-post-widget'), date_i18n( __( 'M j, Y @ G:i' , 'custom-post-widget'), strtotime(isset($post->post_date) ? $post->post_date : null) ), esc_url( 'widgets.php' ) ),
|
176 |
-
10 => current_user_can( 'edit_theme_options' ) ? sprintf( __('Content Block draft updated. <a href="%s">Manage Widgets</a>', 'custom-post-widget'), esc_url( 'widgets.php' ) ) : sprintf( __('Content Block draft updated.', 'custom-post-widget'), esc_url( 'widgets.php' ) ),
|
177 |
);
|
178 |
return $messages;
|
179 |
}
|
180 |
|
181 |
// Add the ability to display the content block in a reqular post using a shortcode
|
182 |
-
function custom_post_widget_shortcode($atts) {
|
183 |
-
extract(shortcode_atts(array(
|
184 |
'id' => '',
|
185 |
'class' => 'content_block'
|
186 |
-
), $atts));
|
187 |
|
188 |
$content = "";
|
189 |
|
190 |
-
if($id != "") {
|
191 |
$args = array(
|
192 |
-
'post__in' => array($id),
|
193 |
'post_type' => 'content_block',
|
194 |
);
|
195 |
|
196 |
-
$content_post = get_posts($args);
|
197 |
|
198 |
foreach( $content_post as $post ) :
|
199 |
$content .= '<div class="'. esc_attr($class) .'">';
|
200 |
-
$content .= apply_filters('the_content', $post->post_content);
|
201 |
$content .= '</div>';
|
202 |
endforeach;
|
203 |
}
|
204 |
|
205 |
return $content;
|
206 |
}
|
207 |
-
add_shortcode('content_block', 'custom_post_widget_shortcode');
|
208 |
|
209 |
// Add button above editor if not editing content_block
|
210 |
function add_content_block_icon() {
|
@@ -220,22 +220,22 @@ function add_content_block_icon() {
|
|
220 |
padding-left: 0.4em;
|
221 |
}
|
222 |
</style>
|
223 |
-
<a id="add-content-block" class="button thickbox" title="' . __("Add Content Block", 'custom-post-widget') . '" href="' .
|
224 |
<span class="wp-media-buttons-icon"></span>' . __("Add Content Block", "custom-post-widget") . '</a>';
|
225 |
}
|
226 |
|
227 |
// Only add content_block icon above posts and pages
|
228 |
function check_post_type_and_remove_media_buttons() {
|
229 |
global $current_screen;
|
230 |
-
if( 'content_block' != $current_screen->post_type ) add_filter('
|
231 |
}
|
232 |
-
add_action('admin_head','check_post_type_and_remove_media_buttons');
|
233 |
|
234 |
require_once( CUSTOM_POST_WIDGET_DIR . '/popup.php' );
|
235 |
|
236 |
// Only add content block popup action on page and post edit
|
237 |
-
if(!defined( 'CUSTOM_POST_WIDGET_CURRENT_PAGE' ))
|
238 |
-
define( 'CUSTOM_POST_WIDGET_CURRENT_PAGE', basename($_SERVER['PHP_SELF']) );
|
239 |
-
if(in_array(CUSTOM_POST_WIDGET_CURRENT_PAGE, array('post.php', 'page.php', 'page-new.php', 'post-new.php'))) {
|
240 |
-
add_action('admin_footer', 'add_content_block_popup');
|
241 |
}
|
26 |
<label for="<?php echo $this->get_field_id( 'custom_post_id' ); ?>"> <?php echo __( 'Content Block to Display:', 'custom-post-widget' ) ?>
|
27 |
<select class="widefat" id="<?php echo $this->get_field_id( 'custom_post_id' ); ?>" name="<?php echo $this->get_field_name( 'custom_post_id' ); ?>">
|
28 |
<?php
|
29 |
+
$args = array( 'post_type' => 'content_block', 'suppress_filters' => 0, 'numberposts' => -1, 'order' => 'ASC' );
|
30 |
$content_block = get_posts( $args );
|
31 |
if ($content_block) {
|
32 |
foreach( $content_block as $content_block ) : setup_postdata( $content_block );
|
81 |
// Display the content block content in the widget area
|
82 |
function widget($args, $instance) {
|
83 |
extract($args);
|
84 |
+
$custom_post_id = ( $instance['custom_post_id'] != '' ) ? esc_attr($instance['custom_post_id']) : __( 'Find', 'custom-post-widget' );
|
85 |
// Add support for WPML Plugin.
|
86 |
if ( function_exists( 'icl_object_id' ) ){
|
87 |
$custom_post_id = icl_object_id( $custom_post_id, 'content_block', true );
|
93 |
$content_post = get_post($custom_post_id);
|
94 |
$content = $content_post->post_content;
|
95 |
if ( !$apply_content_filters ) { // Don't apply the content filter if checkbox selected
|
96 |
+
$content = apply_filters( 'the_content', $content);
|
97 |
}
|
98 |
echo $before_widget;
|
99 |
if ( $show_custom_post_title ) {
|
100 |
+
echo $before_title . apply_filters( 'widget_title',$content_post->post_title) . $after_title; // This is the line that displays the title (only if show title is set)
|
101 |
}
|
102 |
if ( $show_featured_image ) {
|
103 |
+
echo get_the_post_thumbnail( $content_post -> ID );
|
104 |
+
}
|
105 |
+
echo do_shortcode( $content ); // This is where the actual content of the custom post is being displayed
|
106 |
echo $after_widget;
|
107 |
}
|
108 |
}
|
109 |
|
110 |
// Create the Content Block custom post type
|
111 |
+
add_action( 'init', 'my_content_block_post_type_init' );
|
112 |
|
113 |
function my_content_block_post_type_init() {
|
114 |
$labels = array(
|
115 |
+
'name' => _x( 'Content Blocks', 'post type general name', 'custom-post-widget' ),
|
116 |
+
'singular_name' => _x( 'Content Block', 'post type singular name', 'custom-post-widget' ),
|
117 |
+
'plural_name' => _x( 'Content Blocks', 'post type plural name', 'custom-post-widget' ),
|
118 |
+
'add_new' => _x( 'Add Content Block', 'block', 'custom-post-widget' ),
|
119 |
+
'add_new_item' => __( 'Add New Content Block', 'custom-post-widget' ),
|
120 |
+
'edit_item' => __( 'Edit Content Block', 'custom-post-widget' ),
|
121 |
+
'new_item' => __( 'New Content Block', 'custom-post-widget' ),
|
122 |
+
'view_item' => __( 'View Content Block', 'custom-post-widget' ),
|
123 |
+
'search_items' => __( 'Search Content Blocks', 'custom-post-widget' ),
|
124 |
+
'not_found' => __( 'No Content Blocks Found', 'custom-post-widget' ),
|
125 |
+
'not_found_in_trash' => __( 'No Content Blocks found in Trash', 'custom-post-widget' ),
|
126 |
'parent_item_colon' => ''
|
127 |
);
|
128 |
$options = array(
|
136 |
'capability_type' => 'post',
|
137 |
'hierarchical' => false,
|
138 |
'menu_position' => null,
|
139 |
+
'supports' => array( 'title','editor','revisions','thumbnail','author' )
|
140 |
);
|
141 |
+
register_post_type( 'content_block',$options );
|
142 |
}
|
143 |
|
144 |
// Add custom styles to admin screen and menu
|
145 |
+
add_action( 'admin_head', 'content_block_header' );
|
146 |
|
147 |
function content_block_header() {
|
148 |
global $post_type; ?>
|
149 |
<style type="text/css">
|
150 |
<!--
|
151 |
+
<?php if (($post_type == 'content_block' )) : ?>
|
152 |
+
#icon-edit { background:transparent url( '<?php echo plugins_url( 'images/contentblock-32.png', __FILE__ ); ?>' ) no-repeat 0 0 !important;}
|
153 |
#minor-publishing-actions { display:none; /* Hide the Save Draft and Preview buttons */}
|
154 |
<?php endif; ?>
|
155 |
+
#adminmenu #menu-posts-content_block div.wp-menu-image{background:transparent url( '<?php echo plugins_url( 'images/contentblock.png', __FILE__ ); ?>' ) no-repeat center -32px;}
|
156 |
+
#adminmenu #menu-posts-content_block:hover div.wp-menu-image,#adminmenu #menu-posts-content_block.wp-has-current-submenu div.wp-menu-image{background:transparent url( '<?php echo plugins_url( 'images/contentblock.png', __FILE__ ); ?>' ) no-repeat center 0px;}
|
157 |
-->
|
158 |
</style>
|
159 |
<?php
|
160 |
}
|
161 |
|
162 |
+
add_filter( 'post_updated_messages', 'content_block_messages' );
|
163 |
|
164 |
function content_block_messages( $messages ) {
|
165 |
$messages['content_block'] = array(
|
166 |
0 => '',
|
167 |
+
1 => current_user_can( 'edit_theme_options' ) ? sprintf( __( 'Content Block updated. <a href="%s">Manage Widgets</a>', 'custom-post-widget' ), esc_url( 'widgets.php' ) ) : sprintf( __( 'Content Block updated.', 'custom-post-widget' ), esc_url( 'widgets.php' ) ),
|
168 |
+
2 => __( 'Custom field updated.', 'custom-post-widget' ),
|
169 |
+
3 => __( 'Custom field deleted.', 'custom-post-widget' ),
|
170 |
+
4 => __( 'Content Block updated.', 'custom-post-widget' ),
|
171 |
+
5 => isset($_GET['revision']) ? sprintf( __( 'Content Block restored to revision from %s', 'custom-post-widget' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
172 |
+
6 => current_user_can( 'edit_theme_options' ) ? sprintf( __( 'Content Block published. <a href="%s">Manage Widgets</a>', 'custom-post-widget' ), esc_url( 'widgets.php' ) ) : sprintf( __( 'Content Block published.', 'custom-post-widget' ), esc_url( 'widgets.php' ) ),
|
173 |
+
7 => __( 'Block saved.', 'custom-post-widget' ),
|
174 |
+
8 => current_user_can( 'edit_theme_options' ) ? sprintf( __( 'Content Block submitted. <a href="%s">Manage Widgets</a>', 'custom-post-widget' ), esc_url( 'widgets.php' ) ) : sprintf( __( 'Content Block submitted.', 'custom-post-widget' ), esc_url( 'widgets.php' ) ),
|
175 |
+
9 => sprintf( __( 'Content Block scheduled for: <strong>%1$s</strong>.', 'custom-post-widget' ), date_i18n( __( 'M j, Y @ G:i' , 'custom-post-widget' ), strtotime(isset($post->post_date) ? $post->post_date : null) ), esc_url( 'widgets.php' ) ),
|
176 |
+
10 => current_user_can( 'edit_theme_options' ) ? sprintf( __( 'Content Block draft updated. <a href="%s">Manage Widgets</a>', 'custom-post-widget' ), esc_url( 'widgets.php' ) ) : sprintf( __( 'Content Block draft updated.', 'custom-post-widget' ), esc_url( 'widgets.php' ) ),
|
177 |
);
|
178 |
return $messages;
|
179 |
}
|
180 |
|
181 |
// Add the ability to display the content block in a reqular post using a shortcode
|
182 |
+
function custom_post_widget_shortcode( $atts ) {
|
183 |
+
extract( shortcode_atts( array(
|
184 |
'id' => '',
|
185 |
'class' => 'content_block'
|
186 |
+
), $atts ) );
|
187 |
|
188 |
$content = "";
|
189 |
|
190 |
+
if( $id != "" ) {
|
191 |
$args = array(
|
192 |
+
'post__in' => array( $id ),
|
193 |
'post_type' => 'content_block',
|
194 |
);
|
195 |
|
196 |
+
$content_post = get_posts( $args );
|
197 |
|
198 |
foreach( $content_post as $post ) :
|
199 |
$content .= '<div class="'. esc_attr($class) .'">';
|
200 |
+
$content .= apply_filters( 'the_content', $post->post_content);
|
201 |
$content .= '</div>';
|
202 |
endforeach;
|
203 |
}
|
204 |
|
205 |
return $content;
|
206 |
}
|
207 |
+
add_shortcode( 'content_block', 'custom_post_widget_shortcode' );
|
208 |
|
209 |
// Add button above editor if not editing content_block
|
210 |
function add_content_block_icon() {
|
220 |
padding-left: 0.4em;
|
221 |
}
|
222 |
</style>
|
223 |
+
<a id="add-content-block" class="button thickbox" title="' . __("Add Content Block", 'custom-post-widget' ) . '" href="' . plugins_url() . 'popup.php?type=add_content_block_popup&TB_inline=true&inlineId=content-block-form">
|
224 |
<span class="wp-media-buttons-icon"></span>' . __("Add Content Block", "custom-post-widget") . '</a>';
|
225 |
}
|
226 |
|
227 |
// Only add content_block icon above posts and pages
|
228 |
function check_post_type_and_remove_media_buttons() {
|
229 |
global $current_screen;
|
230 |
+
if( 'content_block' != $current_screen -> post_type ) add_filter( 'media_buttons', 'add_content_block_icon' );
|
231 |
}
|
232 |
+
add_action( 'admin_head', 'check_post_type_and_remove_media_buttons' );
|
233 |
|
234 |
require_once( CUSTOM_POST_WIDGET_DIR . '/popup.php' );
|
235 |
|
236 |
// Only add content block popup action on page and post edit
|
237 |
+
if( !defined( 'CUSTOM_POST_WIDGET_CURRENT_PAGE' ) )
|
238 |
+
define( 'CUSTOM_POST_WIDGET_CURRENT_PAGE', basename( $_SERVER['PHP_SELF'] ) );
|
239 |
+
if( in_array( CUSTOM_POST_WIDGET_CURRENT_PAGE, array( 'post.php', 'page.php', 'page-new.php', 'post-new.php' ) ) ) {
|
240 |
+
add_action( 'admin_footer', 'add_content_block_popup' );
|
241 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Author URI: http://www.vanderwijk.com/
|
|
4 |
Donate link: http://www.vanderwijk.com/wordpress/support/
|
5 |
Tags: widget, sidebar, content block, block, custom, post, shortcode, wysiwyg, wpml, featured image
|
6 |
Requires at least: 2.9.2
|
7 |
-
Tested up to: 3.5
|
8 |
Stable tag: 2.0.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -13,11 +13,11 @@ This plugin enables you to display the content of a custom post type called Cont
|
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
The Custom Post Widget allows you to display the contents of a specific custom post in a widget.
|
17 |
|
18 |
Even though you could use the text widget that comes with the default WordPress install, this plugin has some major benefits:
|
19 |
|
20 |
-
* If you are using the standard WordPress text widgets to display content on various areas of your template, this content can only be edited by users with administrator access. If you would like editors to modify the widget content, you can use this plugin to provide them access to the
|
21 |
* The Custom Post Widget plugin enables users to use the WYSIWYG editor for editing the content and adding images.
|
22 |
* You can even use the featured image functionality to display them in a widget.
|
23 |
* The Custom Post Widget is compatible with the WPML Multi-Language plugin and automatically shows the correct language in the widget area.
|
@@ -70,17 +70,29 @@ If your social media sharing plugin adds buttons to the widget areas you could c
|
|
70 |
|
71 |
Currently the shortcode function only outputs the post content of the content block, future support for displaying the title and/or the attached featured image is being considered.
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
= The plugin is not working for me =
|
74 |
|
75 |
Please create a support topic in the forum: http://wordpress.org/support/plugin/custom-post-widget
|
76 |
-
DO NOT click the 'Broken' button in the compatibility area of the plugin directory before creating a support ticket. It is
|
77 |
|
78 |
= I love your plugin! What can I do to help? =
|
79 |
|
80 |
-
Creating and supporting this plugin takes up a lot of my free time, therefore I would highly appreciate it if you could take a couple of minutes to [write a review](http://wordpress.org/support/view/plugin-reviews/custom-post-widget). This will help other WordPress users to start using this plugin and keep me motivated to maintain and support it.
|
81 |
|
82 |
== Changelog ==
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
= 2.0.2 =
|
85 |
Small fix for issue with the css filepath of the editor icon. Thanks to user zudobug for reporting this issue.
|
86 |
|
4 |
Donate link: http://www.vanderwijk.com/wordpress/support/
|
5 |
Tags: widget, sidebar, content block, block, custom, post, shortcode, wysiwyg, wpml, featured image
|
6 |
Requires at least: 2.9.2
|
7 |
+
Tested up to: 3.5.1
|
8 |
Stable tag: 2.0.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
The Custom Post Widget allows you to display the contents of a specific custom post in a widget.
|
17 |
|
18 |
Even though you could use the text widget that comes with the default WordPress install, this plugin has some major benefits:
|
19 |
|
20 |
+
* If you are using the standard WordPress text widgets to display content on various areas of your template, this content can only be edited by users with administrator access. If you would like editors to modify the widget content, you can use this plugin to provide them access to the custom posts that provide the content for the widget areas.
|
21 |
* The Custom Post Widget plugin enables users to use the WYSIWYG editor for editing the content and adding images.
|
22 |
* You can even use the featured image functionality to display them in a widget.
|
23 |
* The Custom Post Widget is compatible with the WPML Multi-Language plugin and automatically shows the correct language in the widget area.
|
70 |
|
71 |
Currently the shortcode function only outputs the post content of the content block, future support for displaying the title and/or the attached featured image is being considered.
|
72 |
|
73 |
+
= How can I embed a content block in my template file using php code? =
|
74 |
+
|
75 |
+
You can use the do_shortcode function for this: `echo do_shortcode('[content_block id= ]');`
|
76 |
+
|
77 |
+
See http://codex.wordpress.org/Function_Reference/do_shortcode for more information on this function.
|
78 |
+
|
79 |
= The plugin is not working for me =
|
80 |
|
81 |
Please create a support topic in the forum: http://wordpress.org/support/plugin/custom-post-widget
|
82 |
+
DO NOT click the 'Broken' button in the compatibility area of the plugin directory before creating a support ticket. It is very demotivating for me to see the plugin downloads drop dramatically without being given the chance to help you!
|
83 |
|
84 |
= I love your plugin! What can I do to help? =
|
85 |
|
86 |
+
Creating and supporting this plugin takes up a lot of my free time, therefore I would highly appreciate it if you could take a couple of minutes to [write a review](http://wordpress.org/support/view/plugin-reviews/custom-post-widget). This will help other WordPress users to start using this plugin and keep me motivated to maintain and support it. Also, if you have a twitter, Facebook or Google+ account, it would be fantastic if you share the link to this plugin!
|
87 |
|
88 |
== Changelog ==
|
89 |
|
90 |
+
= 2.3 =
|
91 |
+
Various bugfixes and improvements.
|
92 |
+
|
93 |
+
= 2.0.3 =
|
94 |
+
Replaced the deprecated `media_buttons_context` filter with `media_buttons`. Thanks to Baptiste Gaillard for letting me know about this.
|
95 |
+
|
96 |
= 2.0.2 =
|
97 |
Small fix for issue with the css filepath of the editor icon. Thanks to user zudobug for reporting this issue.
|
98 |
|