Custom Field Template - Version 2.4

Version Description

  • Bugfix: cftsearch.
Download this release

Release Info

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

Code changes from version 2.3.9 to 2.4

Files changed (2) hide show
  1. custom-field-template.php +11 -5
  2. readme.txt +5 -2
custom-field-template.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wpgogo.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
  Author URI: http://wpgogo.com/
8
- Version: 2.3.9
9
  Text Domain: custom-field-template
10
  Domain Path: /
11
  */
@@ -34,6 +34,7 @@ I appreciate your efforts, Joshua.
34
 
35
  class custom_field_template {
36
  var $is_excerpt, $format_post_id;
 
37
 
38
  function __construct() {
39
  add_action( 'plugins_loaded', array(&$this, 'custom_field_template_plugins_loaded') );
@@ -3631,7 +3632,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
3631
  else
3632
  $values = explode( '#', $rval['originalValue'] );
3633
  $valueLabel = isset($rval['valueLabel']) ? explode( '#', $rval['valueLabel'] ) : array();
3634
- $default = explode( '#', $rval['default'] );
3635
  if ( isset($rval['searchCode']) && is_numeric($rval['searchCode']) ) :
3636
  eval(stripcslashes($options['php'][$rval['searchCode']]));
3637
  endif;
@@ -3670,7 +3671,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
3670
  if ( !empty($rval['class']) ) $class = ' class="' . $rval['class'] . '"';
3671
  $values = explode( '#', $rval['value'] );
3672
  $valueLabel = isset($rval['valueLabel']) ? explode( '#', $rval['valueLabel'] ) : array();
3673
- $default = explode( '#', $rval['default'] );
3674
  if ( isset($rval['searchCode']) && is_numeric($rval['searchCode']) ) :
3675
  eval(stripcslashes($options['php'][$rval['searchCode']]));
3676
  endif;
@@ -3740,8 +3741,9 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
3740
  if ( isset($options['shortcode_format_use_php'][$format]) )
3741
  $output = $this->EvalBuffer($output);
3742
  $key = preg_quote($key, '/');
3743
- $output = preg_replace('/\['.$key.'\](?!\[[0-9]+\])/', $replace_val[0], $output);
3744
- $output = preg_replace_callback('/\['.$key.'\]\[([0-9]+)\](?!\[\])/', function ($m) { return $replace_val[$m[1]]; }, $output);
 
3745
  endforeach;
3746
  endforeach;
3747
  endfor;
@@ -3844,6 +3846,10 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
3844
  return do_shortcode(stripcslashes($output));
3845
  }
3846
 
 
 
 
 
3847
  function custom_field_template_posts_where($where) {
3848
  global $wp_query, $wp_version, $wpdb;
3849
  $options = $this->get_custom_field_template_data();
5
  Description: This plugin adds the default custom fields on the Write Post/Page.
6
  Author: Hiroaki Miyashita
7
  Author URI: http://wpgogo.com/
8
+ Version: 2.4
9
  Text Domain: custom-field-template
10
  Domain Path: /
11
  */
34
 
35
  class custom_field_template {
36
  var $is_excerpt, $format_post_id;
37
+ private $replace_val;
38
 
39
  function __construct() {
40
  add_action( 'plugins_loaded', array(&$this, 'custom_field_template_plugins_loaded') );
3632
  else
3633
  $values = explode( '#', $rval['originalValue'] );
3634
  $valueLabel = isset($rval['valueLabel']) ? explode( '#', $rval['valueLabel'] ) : array();
3635
+ $default = isset($rval['default']) ? explode( '#', $rval['default'] ) : array();
3636
  if ( isset($rval['searchCode']) && is_numeric($rval['searchCode']) ) :
3637
  eval(stripcslashes($options['php'][$rval['searchCode']]));
3638
  endif;
3671
  if ( !empty($rval['class']) ) $class = ' class="' . $rval['class'] . '"';
3672
  $values = explode( '#', $rval['value'] );
3673
  $valueLabel = isset($rval['valueLabel']) ? explode( '#', $rval['valueLabel'] ) : array();
3674
+ $default = isset($rval['default']) ? explode( '#', $rval['default'] ) : array();
3675
  if ( isset($rval['searchCode']) && is_numeric($rval['searchCode']) ) :
3676
  eval(stripcslashes($options['php'][$rval['searchCode']]));
3677
  endif;
3741
  if ( isset($options['shortcode_format_use_php'][$format]) )
3742
  $output = $this->EvalBuffer($output);
3743
  $key = preg_quote($key, '/');
3744
+ $output = preg_replace('/\['.$key.'\](?!\[[0-9]+\])/', $replace_val[0], $output);
3745
+ $this->replace_val = $replace_val;
3746
+ $output = preg_replace_callback('/\['.$key.'\]\[([0-9]+)\](?!\[\])/', array($this, 'search_custom_field_values_callback'), $output);
3747
  endforeach;
3748
  endforeach;
3749
  endfor;
3846
  return do_shortcode(stripcslashes($output));
3847
  }
3848
 
3849
+ function search_custom_field_values_callback ( $m ) {
3850
+ return $this->replace_val[$m[1]];
3851
+ }
3852
+
3853
  function custom_field_template_posts_where($where) {
3854
  global $wp_query, $wp_version, $wpdb;
3855
  $options = $this->get_custom_field_template_data();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpgogo.com/development/custom-field-template.html
4
  Tags: custom field, custom fields, custom, fields, field, template, meta, custom field template, custom post type
5
  Requires at least: 2.1
6
  Tested up to: 4.9.6
7
- Stable tag: 2.3.9
8
  License: GPLv2 or later
9
 
10
  The Custom Field Template plugin extends the functionality of custom fields.
@@ -114,7 +114,10 @@ See the default template and modify it.
114
 
115
  == Changelog ==
116
 
117
- = 2.3.8 =
 
 
 
118
  * Code cleaning.
119
  * Bugfix: cftsearch.
120
 
4
  Tags: custom field, custom fields, custom, fields, field, template, meta, custom field template, custom post type
5
  Requires at least: 2.1
6
  Tested up to: 4.9.6
7
+ Stable tag: 2.4
8
  License: GPLv2 or later
9
 
10
  The Custom Field Template plugin extends the functionality of custom fields.
114
 
115
  == Changelog ==
116
 
117
+ = 2.4 =
118
+ * Bugfix: cftsearch.
119
+
120
+ = 2.3.9 =
121
  * Code cleaning.
122
  * Bugfix: cftsearch.
123