Custom Post Template - Version 1.0

Version Description

Download this release

Release Info

Developer simonwheatley
Plugin Icon wp plugin Custom Post Template
Version 1.0
Comparing to
See all releases

Code changes from version 0.92b to 1.0

custom-post-templates.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Custom Post Templates
4
  Plugin URI: http://wordpress.org/extend/plugins/custom-post-template/
5
  Description: Provides a drop-down to select different templates for posts from the post edit screen. The templates are defined similarly to page templates, and will replace single.php for the specified post.
6
  Author: Simon Wheatley
7
- Version: 0.92b
8
  Author URI: http://simonwheatley.co.uk/wordpress/
9
  */
10
 
4
  Plugin URI: http://wordpress.org/extend/plugins/custom-post-template/
5
  Description: Provides a drop-down to select different templates for posts from the post edit screen. The templates are defined similarly to page templates, and will replace single.php for the specified post.
6
  Author: Simon Wheatley
7
+ Version: 1.0
8
  Author URI: http://simonwheatley.co.uk/wordpress/
9
  */
10
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: simonwheatley
3
  Donate link: http://www.simonwheatley.co.uk/wordpress/
4
  Tags: post, template, theme
5
- Requires at least: 2.6
6
- Tested up to: 2.7-beta3
7
- Stable tag: 0.92b
8
 
9
  Provides a drop-down to select different templates for posts from the post edit screen. The templates replace single.php for the specified post.
10
 
@@ -37,7 +37,7 @@ The plugin is simple to install:
37
 
38
  1. Download the plugin, it will arrive as a zip file
39
  1. Unzip it
40
- 1. Upload `custom-post-template.zip` directory to your WordPress Plugin directory
41
  1. Go to the plugin management page and enable the plugin
42
  1. Upload your post template files (see the Description for details on configuring these), and choose them through the new menu
43
  1. Give yourself a pat on the back
@@ -52,6 +52,11 @@ Right, that's it. Grump over. ;)
52
 
53
  == Change Log ==
54
 
 
 
 
 
 
55
  = v0.9b 2008/11/26 =
56
 
57
  * Plugin first released
@@ -68,7 +73,7 @@ Right, that's it. Grump over. ;)
68
 
69
  = v0.92b 2008/12/04 =
70
 
71
- * Code tweaks
72
  * Blocked direct access to templates
73
 
74
  == Frequently Asked Questions ==
2
  Contributors: simonwheatley
3
  Donate link: http://www.simonwheatley.co.uk/wordpress/
4
  Tags: post, template, theme
5
+ Requires at least: 2.9
6
+ Tested up to: 2.9.1
7
+ Stable tag: 1.0
8
 
9
  Provides a drop-down to select different templates for posts from the post edit screen. The templates replace single.php for the specified post.
10
 
37
 
38
  1. Download the plugin, it will arrive as a zip file
39
  1. Unzip it
40
+ 1. Upload `custom-post-template` directory to your WordPress Plugin directory
41
  1. Go to the plugin management page and enable the plugin
42
  1. Upload your post template files (see the Description for details on configuring these), and choose them through the new menu
43
  1. Give yourself a pat on the back
52
 
53
  == Change Log ==
54
 
55
+ = v1b 2010/01/15 =
56
+
57
+ * BUGFIX: Theme templates now come with a complete filepath, so no need to add WP_CONTENT_DIR constant to the beginning.
58
+ * ENHANCEMENT: Metabox now shows up on the side, under the publish box... where you'd expect.
59
+
60
  = v0.9b 2008/11/26 =
61
 
62
  * Plugin first released
73
 
74
  = v0.92b 2008/12/04 =
75
 
76
+ * Minor code tweaks
77
  * Blocked direct access to templates
78
 
79
  == Frequently Asked Questions ==
trunk/custom-post-templates.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Custom Post Templates
4
  Plugin URI: http://wordpress.org/extend/plugins/custom-post-template/
5
  Description: Provides a drop-down to select different templates for posts from the post edit screen. The templates are defined similarly to page templates, and will replace single.php for the specified post.
6
  Author: Simon Wheatley
7
- Version: 0.92b
8
  Author URI: http://simonwheatley.co.uk/wordpress/
9
  */
10
 
@@ -44,7 +44,7 @@ class CustomPostTemplates extends CustomPostTemplates_Plugin
44
  $this->tpl_meta_key = 'custom_post_template';
45
  // Init hooks and all that
46
  $this->register_plugin ( 'post-templates', __FILE__ );
47
- $this->add_meta_box( 'select_post_template', __('Post Template'), 'select_post_template', 'post', 'normal', 'core' );
48
  $this->add_action( 'save_post' );
49
  $this->add_filter( 'single_template', 'filter_single_template' );
50
  }
@@ -123,8 +123,7 @@ class CustomPostTemplates extends CustomPostTemplates_Plugin
123
 
124
  if ( is_array( $templates ) ) {
125
  foreach ( $templates as $template ) {
126
- $template_data = implode( '', file( WP_CONTENT_DIR . $template ) );
127
-
128
  preg_match( '|Template Name Posts:(.*)$|mi', $template_data, $name );
129
  if ( empty( $name ) ) continue;
130
 
4
  Plugin URI: http://wordpress.org/extend/plugins/custom-post-template/
5
  Description: Provides a drop-down to select different templates for posts from the post edit screen. The templates are defined similarly to page templates, and will replace single.php for the specified post.
6
  Author: Simon Wheatley
7
+ Version: 1.0
8
  Author URI: http://simonwheatley.co.uk/wordpress/
9
  */
10
 
44
  $this->tpl_meta_key = 'custom_post_template';
45
  // Init hooks and all that
46
  $this->register_plugin ( 'post-templates', __FILE__ );
47
+ $this->add_meta_box( 'select_post_template', __('Post Template'), 'select_post_template', 'post', 'side', 'default' );
48
  $this->add_action( 'save_post' );
49
  $this->add_filter( 'single_template', 'filter_single_template' );
50
  }
123
 
124
  if ( is_array( $templates ) ) {
125
  foreach ( $templates as $template ) {
126
+ $template_data = implode( '', file( $template ) );
 
127
  preg_match( '|Template Name Posts:(.*)$|mi', $template_data, $name );
128
  if ( empty( $name ) ) continue;
129
 
trunk/readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: simonwheatley
3
  Donate link: http://www.simonwheatley.co.uk/wordpress/
4
  Tags: post, template, theme
5
- Requires at least: 2.6
6
- Tested up to: 2.7-beta3
7
- Stable tag: 0.92b
8
 
9
  Provides a drop-down to select different templates for posts from the post edit screen. The templates replace single.php for the specified post.
10
 
@@ -52,6 +52,11 @@ Right, that's it. Grump over. ;)
52
 
53
  == Change Log ==
54
 
 
 
 
 
 
55
  = v0.9b 2008/11/26 =
56
 
57
  * Plugin first released
2
  Contributors: simonwheatley
3
  Donate link: http://www.simonwheatley.co.uk/wordpress/
4
  Tags: post, template, theme
5
+ Requires at least: 2.9
6
+ Tested up to: 2.9.1
7
+ Stable tag: 1.0
8
 
9
  Provides a drop-down to select different templates for posts from the post edit screen. The templates replace single.php for the specified post.
10
 
52
 
53
  == Change Log ==
54
 
55
+ = v1b 2010/01/15 =
56
+
57
+ * BUGFIX: Theme templates now come with a complete filepath, so no need to add WP_CONTENT_DIR constant to the beginning.
58
+ * ENHANCEMENT: Metabox now shows up on the side, under the publish box... where you'd expect.
59
+
60
  = v0.9b 2008/11/26 =
61
 
62
  * Plugin first released