Custom Post Template - Version 0.91b

Version Description

Download this release

Release Info

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

Code changes from version 0.9b to 0.91b

Files changed (2) hide show
  1. custom-post-templates.php +6 -3
  2. readme.txt +23 -2
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.9b
8
  Author URI: http://simonwheatley.co.uk/wordpress/
9
  */
10
 
@@ -80,8 +80,11 @@ class CustomPostTemplates extends CustomPostTemplates_Plugin
80
 
81
  $this->post_ID = $wp_query->post->ID;
82
 
83
- $custom_template = TEMPLATEPATH . "/" . $this->get_custom_post_template();
84
- if ( file_exists( $custom_template ) ) return $custom_template;
 
 
 
85
 
86
  return $template;
87
  }
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.91b
8
  Author URI: http://simonwheatley.co.uk/wordpress/
9
  */
10
 
80
 
81
  $this->post_ID = $wp_query->post->ID;
82
 
83
+ $template_file = $this->get_custom_post_template();
84
+ $custom_template = TEMPLATEPATH . "/" . $template_file;
85
+ // Check both the template file and the full path, otherwise you discover that the theme dir
86
+ // exists (which is not surprising)
87
+ if ( $template_file && file_exists( $custom_template ) ) return $custom_template;
88
 
89
  return $template;
90
  }
readme.txt CHANGED
@@ -3,13 +3,15 @@ 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.6.3
7
- Stable tag: 0.9b
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
 
11
  == Description ==
12
 
 
 
13
  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.
14
 
15
  Post templates, as far as this plugin is concerned, are configured similarly to [page templates](http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates) in that they have a particular style of PHP comment at the top of them. Each post template must contain the following, or similar, at the top:
@@ -40,8 +42,27 @@ The plugin is simple to install:
40
  1. Upload your post template files (see the Description for details on configuring these), and choose them through the new menu
41
  1. Give yourself a pat on the back
42
 
 
 
 
 
 
 
 
 
43
  == Change Log ==
44
 
45
  = v0.9b 2008/11/26 =
46
 
47
  * Plugin first released
 
 
 
 
 
 
 
 
 
 
 
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.91b
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
 
11
  == Description ==
12
 
13
+ **This plugin requires PHP5 (see Other Notes > PHP4 for more).**
14
+
15
  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.
16
 
17
  Post templates, as far as this plugin is concerned, are configured similarly to [page templates](http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates) in that they have a particular style of PHP comment at the top of them. Each post template must contain the following, or similar, at the top:
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
44
 
45
+ == PHP4 ==
46
+
47
+ Many of my plugin now require at least PHP5. I know that WordPress officially supports PHP4, but I don't. PHP4 is a mess and makes coding a lot less efficient, and when you're releasing stuff for free these things matter. PHP5 has been out for several years now and is fully production ready, as well as being naturally more secure and performant.
48
+
49
+ If you're still running PHP4, I strongly suggest you talk to your hosting company about upgrading your servers. All reputable hosting companies should offer PHP5 as well as PHP4.
50
+
51
+ Right, that's it. Grump over. ;)
52
+
53
  == Change Log ==
54
 
55
  = v0.9b 2008/11/26 =
56
 
57
  * Plugin first released
58
+
59
+ = v0.91b 2008/11/28 =
60
+
61
+ * BUGFIX: The plugin was breaking posts using the "default" template, this is now fixed. Apologies for the inconvenience.
62
+ * Tested up to WordPress 2.7-beta3-9922
63
+
64
+ == Frequently Asked Questions ==
65
+
66
+ = I get an error like this: <code>Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /web/wp-content/plugins/custom-post-template/custom-post-templates.php</code> =
67
+
68
+ This is because your server is running PHP4. Please see "Other Notes > PHP4" for more information.