Custom Field Template - Version 0.6.5

Version Description

Download this release

Release Info

Developer Hiroaki Miyashita
Plugin Icon 128x128 Custom Field Template
Version 0.6.5
Comparing to
See all releases

Code changes from version 0.6.4 to 0.6.5

Files changed (2) hide show
  1. custom-field-template.php +12 -2
  2. readme.txt +2 -1
custom-field-template.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Custom Field Template
4
  Plugin URI: http://wordpressgogo.com/development/custom-field-template.html
5
  Description: This plugin adds the default custom fields on the Write Post/Page.
6
  Author: Hiroaki Miyashita
7
- Version: 0.6.4
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
@@ -344,7 +344,10 @@ hideKey = true<br />
344
  <th>mediaButton</th><td></td><td></td><td></td><td></td><td>mediaButton = true</td>
345
  </tr>
346
  <tr>
347
- <th>code</th>><td></td><td></td><td>code = 0</td><td>code = 0</td><td></td>
 
 
 
348
  </tr>
349
  </tbody>
350
  </table>
@@ -657,6 +660,10 @@ EOF;
657
  }
658
 
659
  function load_custom_field( $id = 0 ) {
 
 
 
 
660
  $options = $this->get_custom_field_template_data();
661
 
662
  $fields = $this->get_custom_fields( $id );
@@ -667,6 +674,9 @@ EOF;
667
  $out .= '<input type="hidden" name="custom-field-template-id" id="custom-field-template-id" value="' . $id . '" />';
668
  foreach( $fields as $title => $data ) {
669
  for($i = 0; $i<count($data); $i++) {
 
 
 
670
  if( $data[$i]['type'] == 'textfield' || $data[$i]['type'] == 'text' ) {
671
  $out .= $this->make_textfield( $title, $i, $data[$i]['size'], $data[$i]['hideKey'], $data[$i]['label'] );
672
  }
4
  Plugin URI: http://wordpressgogo.com/development/custom-field-template.html
5
  Description: This plugin adds the default custom fields on the Write Post/Page.
6
  Author: Hiroaki Miyashita
7
+ Version: 0.6.5
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
344
  <th>mediaButton</th><td></td><td></td><td></td><td></td><td>mediaButton = true</td>
345
  </tr>
346
  <tr>
347
+ <th>code</th><td></td><td></td><td>code = 0</td><td>code = 0</td><td></td>
348
+ </tr>
349
+ <tr>
350
+ <th>level</th><td>level = 1</td><td>level = 3</td><td>level = 5</td><td>level = 7</td><td>level = 9</td>
351
  </tr>
352
  </tbody>
353
  </table>
660
  }
661
 
662
  function load_custom_field( $id = 0 ) {
663
+ global $userdata;
664
+ get_currentuserinfo();
665
+ $level = $userdata->user_level;
666
+
667
  $options = $this->get_custom_field_template_data();
668
 
669
  $fields = $this->get_custom_fields( $id );
674
  $out .= '<input type="hidden" name="custom-field-template-id" id="custom-field-template-id" value="' . $id . '" />';
675
  foreach( $fields as $title => $data ) {
676
  for($i = 0; $i<count($data); $i++) {
677
+ if ( is_numeric($data[$i]['level']) ) :
678
+ if ( $data[$i]['level'] > $level ) continue;
679
+ endif;
680
  if( $data[$i]['type'] == 'textfield' || $data[$i]['type'] == 'text' ) {
681
  $out .= $this->make_textfield( $title, $i, $data[$i]['size'], $data[$i]['hideKey'], $data[$i]['label'] );
682
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpressgogo.com/development/custom-field-template.html
4
  Tags: custom, fields, field, template, meta, custom field, custom fields, custom field template
5
  Requires at least: 2.1
6
  Tested up to: 2.7
7
- Stable tag: 0.6.4
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
@@ -23,6 +23,7 @@ The Custom Field Template plugin adds the default custom fields on the Write Pos
23
  * You can replace custom keys by labels.
24
  * You can use wpautop function.
25
  * You can use PHP codes in order to set values. (experimental)
 
26
 
27
  == Installation ==
28
 
4
  Tags: custom, fields, field, template, meta, custom field, custom fields, custom field template
5
  Requires at least: 2.1
6
  Tested up to: 2.7
7
+ Stable tag: 0.6.5
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
23
  * You can replace custom keys by labels.
24
  * You can use wpautop function.
25
  * You can use PHP codes in order to set values. (experimental)
26
+ * You can set an access user level in each field.
27
 
28
  == Installation ==
29