Version Description
- Bugfix: WordPress 4.4.
Download this release
Release Info
Developer | Hiroaki Miyashita |
Plugin | Custom Field Template |
Version | 2.3.5 |
Comparing to | |
See all releases |
Code changes from version 2.3.4 to 2.3.5
- custom-field-template.php +62 -61
- 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 |
Text Domain: custom-field-template
|
10 |
Domain Path: /
|
11 |
*/
|
@@ -41,6 +41,7 @@ class custom_field_template {
|
|
41 |
add_action( 'admin_print_scripts', array(&$this, 'custom_field_template_admin_scripts') );
|
42 |
add_action( 'admin_head', array(&$this, 'custom_field_template_admin_head'), 100 );
|
43 |
add_action( 'dbx_post_sidebar', array(&$this, 'custom_field_template_dbx_post_sidebar') );
|
|
|
44 |
|
45 |
//add_action( 'edit_post', array(&$this, 'edit_meta_value'), 100 );
|
46 |
add_action( 'save_post', array(&$this, 'edit_meta_value'), 100, 2 );
|
@@ -153,76 +154,75 @@ class custom_field_template {
|
|
153 |
add_action( 'simple_edit_form', array(&$this, 'insert_custom_field'), 1 );
|
154 |
add_action( 'edit_form_advanced', array(&$this, 'insert_custom_field'), 1 );
|
155 |
add_action( 'edit_page_form', array(&$this, 'insert_custom_field'), 1 );
|
156 |
-
}
|
157 |
-
if ( substr($wp_version, 0, 3) >= '3.3' && file_exists(ABSPATH . 'wp-admin/includes/screen.php') ) :
|
158 |
-
require_once(ABSPATH . 'wp-admin/includes/screen.php');
|
159 |
-
endif;
|
160 |
-
require_once(ABSPATH . 'wp-admin/includes/template.php');
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
|
|
|
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
$
|
186 |
-
|
187 |
-
|
188 |
-
add_meta_box('cftdiv'.$i, $title, array(&$this, 'insert_custom_field'), $type, 'normal', 'core', $key);
|
189 |
-
endforeach;
|
190 |
endif;
|
191 |
-
|
192 |
-
endforeach;
|
193 |
-
endif;
|
194 |
-
else :
|
195 |
-
add_meta_box('cftdiv', __('Custom Field Template', 'custom-field-template'), array(&$this, 'insert_custom_field'), 'post', 'normal', 'core');
|
196 |
-
add_meta_box('cftdiv', __('Custom Field Template', 'custom-field-template'), array(&$this, 'insert_custom_field'), 'page', 'normal', 'core');
|
197 |
-
endif;
|
198 |
-
|
199 |
-
if ( empty($options['custom_field_template_deploy_box']) && is_array($options['custom_fields']) ) :
|
200 |
-
$custom_post_type = array();
|
201 |
-
foreach($options['custom_fields'] as $key => $val ) :
|
202 |
-
if ( isset($options['custom_fields'][$key]['custom_post_type']) ) :
|
203 |
$tmp_custom_post_type = explode(',', $options['custom_fields'][$key]['custom_post_type']);
|
204 |
$tmp_custom_post_type = array_filter( $tmp_custom_post_type );
|
205 |
$tmp_custom_post_type = array_unique(array_filter(array_map('trim', $tmp_custom_post_type)));
|
206 |
-
$
|
|
|
|
|
207 |
endif;
|
|
|
208 |
endforeach;
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
|
|
219 |
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
endif;
|
221 |
-
}
|
222 |
-
|
223 |
-
if( strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/post.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/page-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/page.php') ) :
|
224 |
-
add_action('admin_head', array(&$this, 'custom_field_template_admin_head_buffer') );
|
225 |
-
add_action('admin_footer', array(&$this, 'custom_field_template_admin_footer_buffer') );
|
226 |
endif;
|
227 |
}
|
228 |
|
@@ -1109,6 +1109,7 @@ type = file';
|
|
1109 |
$plugin_dir = dirname( plugin_basename(__FILE__) );
|
1110 |
?>
|
1111 |
<style type="text/css">
|
|
|
1112 |
div.grippie {
|
1113 |
background:#EEEEEE url(<?php echo '../' . PLUGINDIR . '/' . $plugin_dir . '/js/'; ?>grippie.png) no-repeat scroll center 2px;
|
1114 |
border-color:#DDDDDD;
|
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.5
|
9 |
Text Domain: custom-field-template
|
10 |
Domain Path: /
|
11 |
*/
|
41 |
add_action( 'admin_print_scripts', array(&$this, 'custom_field_template_admin_scripts') );
|
42 |
add_action( 'admin_head', array(&$this, 'custom_field_template_admin_head'), 100 );
|
43 |
add_action( 'dbx_post_sidebar', array(&$this, 'custom_field_template_dbx_post_sidebar') );
|
44 |
+
add_action( 'add_meta_boxes', array(&$this, 'custom_field_template_add_meta_boxes') );
|
45 |
|
46 |
//add_action( 'edit_post', array(&$this, 'edit_meta_value'), 100 );
|
47 |
add_action( 'save_post', array(&$this, 'edit_meta_value'), 100, 2 );
|
154 |
add_action( 'simple_edit_form', array(&$this, 'insert_custom_field'), 1 );
|
155 |
add_action( 'edit_form_advanced', array(&$this, 'insert_custom_field'), 1 );
|
156 |
add_action( 'edit_page_form', array(&$this, 'insert_custom_field'), 1 );
|
157 |
+
}
|
|
|
|
|
|
|
|
|
158 |
|
159 |
+
if( strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/post.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/page-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/page.php') ) :
|
160 |
+
add_action('admin_head', array(&$this, 'custom_field_template_admin_head_buffer') );
|
161 |
+
add_action('admin_footer', array(&$this, 'custom_field_template_admin_footer_buffer') );
|
162 |
+
endif;
|
163 |
+
}
|
164 |
+
|
165 |
+
function custom_field_template_add_meta_boxes() {
|
166 |
+
$options = $this->get_custom_field_template_data();
|
167 |
|
168 |
+
if ( function_exists('remove_meta_box') && !empty($options['custom_field_template_disable_default_custom_fields']) ) :
|
169 |
+
remove_meta_box('postcustom', 'post', 'normal');
|
170 |
+
remove_meta_box('postcustom', 'page', 'normal');
|
171 |
+
remove_meta_box('pagecustomdiv', 'page', 'normal');
|
172 |
+
endif;
|
173 |
+
|
174 |
+
if ( !empty($options['custom_field_template_deploy_box']) ) :
|
175 |
+
if ( !empty($options['custom_fields']) ) :
|
176 |
+
$i = 0;
|
177 |
+
foreach ( $options['custom_fields'] as $key => $val ) :
|
178 |
+
if ( empty($options['custom_field_template_replace_the_title']) ) $title = __('Custom Field Template', 'custom-field-template');
|
179 |
+
else $title = $options['custom_fields'][$key]['title'];
|
180 |
+
if ( empty($options['custom_fields'][$key]['custom_post_type']) ) :
|
181 |
+
if ( empty($options['custom_fields'][$key]['post_type']) ) :
|
182 |
+
add_meta_box('cftdiv'.$i, $title, array(&$this, 'insert_custom_field'), 'post', 'normal', 'core', $key);
|
183 |
+
add_meta_box('cftdiv'.$i, $title, array(&$this, 'insert_custom_field'), 'page', 'normal', 'core', $key);
|
184 |
+
elseif ( $options['custom_fields'][$key]['post_type']=='post' ) :
|
185 |
+
add_meta_box('cftdiv'.$i, $title, array(&$this, 'insert_custom_field'), 'post', 'normal', 'core', $key);
|
186 |
+
elseif ( $options['custom_fields'][$key]['post_type']=='page' ) :
|
187 |
+
add_meta_box('cftdiv'.$i, $title, array(&$this, 'insert_custom_field'), 'page', 'normal', 'core', $key);
|
|
|
|
|
188 |
endif;
|
189 |
+
else :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
$tmp_custom_post_type = explode(',', $options['custom_fields'][$key]['custom_post_type']);
|
191 |
$tmp_custom_post_type = array_filter( $tmp_custom_post_type );
|
192 |
$tmp_custom_post_type = array_unique(array_filter(array_map('trim', $tmp_custom_post_type)));
|
193 |
+
foreach ( $tmp_custom_post_type as $type ) :
|
194 |
+
add_meta_box('cftdiv'.$i, $title, array(&$this, 'insert_custom_field'), $type, 'normal', 'core', $key);
|
195 |
+
endforeach;
|
196 |
endif;
|
197 |
+
$i++;
|
198 |
endforeach;
|
199 |
+
endif;
|
200 |
+
else :
|
201 |
+
add_meta_box('cftdiv', __('Custom Field Template', 'custom-field-template'), array(&$this, 'insert_custom_field'), 'post', 'normal', 'core');
|
202 |
+
add_meta_box('cftdiv', __('Custom Field Template', 'custom-field-template'), array(&$this, 'insert_custom_field'), 'page', 'normal', 'core');
|
203 |
+
endif;
|
204 |
+
|
205 |
+
if ( empty($options['custom_field_template_deploy_box']) && is_array($options['custom_fields']) ) :
|
206 |
+
$custom_post_type = array();
|
207 |
+
foreach($options['custom_fields'] as $key => $val ) :
|
208 |
+
if ( isset($options['custom_fields'][$key]['custom_post_type']) ) :
|
209 |
+
$tmp_custom_post_type = explode(',', $options['custom_fields'][$key]['custom_post_type']);
|
210 |
+
$tmp_custom_post_type = array_filter( $tmp_custom_post_type );
|
211 |
+
$tmp_custom_post_type = array_unique(array_filter(array_map('trim', $tmp_custom_post_type)));
|
212 |
+
$custom_post_type = array_merge($custom_post_type, $tmp_custom_post_type);
|
213 |
endif;
|
214 |
+
endforeach;
|
215 |
+
if ( isset($custom_post_type) && is_array($custom_post_type) ) :
|
216 |
+
foreach( $custom_post_type as $val ) :
|
217 |
+
if ( function_exists('remove_meta_box') && !empty($options['custom_field_template_disable_default_custom_fields']) ) :
|
218 |
+
remove_meta_box('postcustom', $val, 'normal');
|
219 |
+
endif;
|
220 |
+
add_meta_box('cftdiv', __('Custom Field Template', 'custom-field-template'), array(&$this, 'insert_custom_field'), $val, 'normal', 'core');
|
221 |
+
if ( empty($options['custom_field_template_disable_custom_field_column']) ) :
|
222 |
+
add_filter( 'manage_'.$val.'_posts_columns', array(&$this, 'add_manage_pages_columns') );
|
223 |
+
endif;
|
224 |
+
endforeach;
|
225 |
endif;
|
|
|
|
|
|
|
|
|
|
|
226 |
endif;
|
227 |
}
|
228 |
|
1109 |
$plugin_dir = dirname( plugin_basename(__FILE__) );
|
1110 |
?>
|
1111 |
<style type="text/css">
|
1112 |
+
#poststuff h3 { font-size: 14px; line-height: 1.4; margin: 0; padding: 8px 12px; }
|
1113 |
div.grippie {
|
1114 |
background:#EEEEEE url(<?php echo '../' . PLUGINDIR . '/' . $plugin_dir . '/js/'; ?>grippie.png) no-repeat scroll center 2px;
|
1115 |
border-color:#DDDDDD;
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: Hiroaki Miyashita
|
|
3 |
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.
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
The Custom Field Template plugin extends the functionality of custom fields.
|
@@ -112,6 +112,9 @@ See the default template and modify it.
|
|
112 |
|
113 |
== Changelog ==
|
114 |
|
|
|
|
|
|
|
115 |
= 2.3.4 =
|
116 |
* Bugfix: tag save.
|
117 |
|
3 |
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.4
|
7 |
+
Stable tag: 2.3.5
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
The Custom Field Template plugin extends the functionality of custom fields.
|
112 |
|
113 |
== Changelog ==
|
114 |
|
115 |
+
= 2.3.5 =
|
116 |
+
* Bugfix: WordPress 4.4.
|
117 |
+
|
118 |
= 2.3.4 =
|
119 |
* Bugfix: tag save.
|
120 |
|