Version Description
Added a checkbox in the widget to make it possible to show the custom post title in the widget area
Download this release
Release Info
Developer | vanderwijk |
Plugin | Content Blocks (Custom Post Widget) |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2
- custom-post-widget.php +9 -4
- readme.txt +7 -4
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
custom-post-widget.php
CHANGED
@@ -3,11 +3,11 @@
|
|
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.
|
7 |
Author: Johan van der Wijk
|
8 |
Author URI: http://www.vanderwijk.com
|
9 |
|
10 |
-
Release notes: 1.
|
11 |
|
12 |
*/
|
13 |
|
@@ -33,17 +33,22 @@ class custom_post_widget extends WP_Widget
|
|
33 |
if ( have_posts() ) : while ( have_posts() ) : the_post();
|
34 |
$currentID = get_the_ID();
|
35 |
if($currentID == $custom_post_id)
|
36 |
-
$extra = 'selected'
|
|
|
37 |
else
|
38 |
$extra = '';
|
39 |
echo '<option value="'.$currentID.'" '.$extra.'>'.get_the_title().'</option>';
|
40 |
endwhile; else:
|
41 |
echo '<option value="empty">No content blocks available</option>';
|
42 |
endif;
|
43 |
-
|
44 |
</select>
|
45 |
</label>
|
46 |
</p>
|
|
|
|
|
|
|
|
|
47 |
<p>
|
48 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['show_custom_post_title'], true ); ?> id="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>" name="<?php echo $this->get_field_name( 'show_custom_post_title' ); ?>" />
|
49 |
<label for="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>"><?php echo __('Show Post Title') ?></label>
|
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.3
|
7 |
Author: Johan van der Wijk
|
8 |
Author URI: http://www.vanderwijk.com
|
9 |
|
10 |
+
Release notes: 1.3 Now the title of the content block is displayed in the admin widget
|
11 |
|
12 |
*/
|
13 |
|
33 |
if ( have_posts() ) : while ( have_posts() ) : the_post();
|
34 |
$currentID = get_the_ID();
|
35 |
if($currentID == $custom_post_id)
|
36 |
+
$extra = 'selected' and
|
37 |
+
$widgetExtraTitle = get_the_title();
|
38 |
else
|
39 |
$extra = '';
|
40 |
echo '<option value="'.$currentID.'" '.$extra.'>'.get_the_title().'</option>';
|
41 |
endwhile; else:
|
42 |
echo '<option value="empty">No content blocks available</option>';
|
43 |
endif;
|
44 |
+
?>
|
45 |
</select>
|
46 |
</label>
|
47 |
</p>
|
48 |
+
<?php ?>
|
49 |
+
<input type="hidden" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $widgetExtraTitle; ?>" />
|
50 |
+
<?php wp_reset_query(); ?>
|
51 |
+
|
52 |
<p>
|
53 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $instance['show_custom_post_title'], true ); ?> id="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>" name="<?php echo $this->get_field_name( 'show_custom_post_title' ); ?>" />
|
54 |
<label for="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>"><?php echo __('Show Post Title') ?></label>
|
readme.txt
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
Contributors: vanderwijk
|
3 |
Author URI: http://www.vanderwijk.com/
|
4 |
Donate link: http://www.vanderwijk.com/wordpress/support/
|
5 |
-
Tags: custom
|
6 |
Requires at least: 2.9.2
|
7 |
-
Tested up to: 3.0.
|
8 |
-
Stable tag: 1.
|
9 |
|
10 |
This plugin enables you to display the content of a custom post type called Content Block in a sidebar widget.
|
11 |
|
@@ -22,7 +22,7 @@ This plugin creates a 'content_block' custom post type. The title is never displ
|
|
22 |
|
23 |
To add content to a widget, drag it to the required position in the sidebar and select the title of the custom post in the widget configuration.
|
24 |
|
25 |
-
You can find more information about this plugin and a screencast video which shows the plugin in action on the [plugin homepage](http://www.vanderwijk.com/
|
26 |
|
27 |
== Screenshots ==
|
28 |
|
@@ -66,6 +66,9 @@ Added a checkbox in the widget to make it possible to show the custom post title
|
|
66 |
= 1.2.1 =
|
67 |
The widget title now uses $before_title and $after_title to generate the appropriate tags to display it on the page. Hat tip: Etienne Proust.
|
68 |
|
|
|
|
|
|
|
69 |
== Upgrade Notice ==
|
70 |
|
71 |
= 1.1.1 =
|
2 |
Contributors: vanderwijk
|
3 |
Author URI: http://www.vanderwijk.com/
|
4 |
Donate link: http://www.vanderwijk.com/wordpress/support/
|
5 |
+
Tags: custom-post, widget, sidebar
|
6 |
Requires at least: 2.9.2
|
7 |
+
Tested up to: 3.0.4
|
8 |
+
Stable tag: 1.3
|
9 |
|
10 |
This plugin enables you to display the content of a custom post type called Content Block in a sidebar widget.
|
11 |
|
22 |
|
23 |
To add content to a widget, drag it to the required position in the sidebar and select the title of the custom post in the widget configuration.
|
24 |
|
25 |
+
You can find more information about this plugin and a screencast video which shows the plugin in action on the [plugin homepage](http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/).
|
26 |
|
27 |
== Screenshots ==
|
28 |
|
66 |
= 1.2.1 =
|
67 |
The widget title now uses $before_title and $after_title to generate the appropriate tags to display it on the page. Hat tip: Etienne Proust.
|
68 |
|
69 |
+
= 1.3 =
|
70 |
+
Now the title of the content block is displayed in the admin interface to make it easy to manage the widgets.
|
71 |
+
|
72 |
== Upgrade Notice ==
|
73 |
|
74 |
= 1.1.1 =
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|