Version Description
- WCK menu now only appears for Administrator role only
- Minor fixes and improvements
Download this release
Release Info
Developer | madalin.ungureanu |
Plugin | Custom Post Types and Custom Fields creator – WCK |
Version | 1.0.6 |
Comparing to | |
See all releases |
Code changes from version 1.0.5 to 1.0.6
- images/banner_pro.png +0 -0
- images/wck-icon-dark.png +0 -0
- readme.txt +7 -2
- wck-cfc.php +32 -31
- wck-cptc.php +1 -1
- wck-ctc.php +8 -5
- wck-sas.php +31 -27
- wck-template-api/wck-field-preprocess.php +11 -5
- wck-template-api/wck-template-api.php +7 -3
- wck.php +8 -1
- wordpress-creation-kit-api/fields/upload.php +2 -5
- wordpress-creation-kit-api/wordpress-creation-kit.php +9 -3
images/banner_pro.png
CHANGED
Binary file
|
images/wck-icon-dark.png
ADDED
Binary file
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: custom fields, custom field, wordpress custom fields, advanced custom fiel
|
|
6 |
|
7 |
Requires at least: 3.1
|
8 |
Tested up to: 3.7.1
|
9 |
-
Stable tag: 1.0.
|
10 |
|
11 |
A must have tool for creating custom fields, custom post types and taxonomies, fast and without any programming knowledge.
|
12 |
|
@@ -42,12 +42,13 @@ A must have tool for creating custom fields, custom post types and taxonomies, f
|
|
42 |
= WCK PRO =
|
43 |
The [PRO version](http://www.cozmoslabs.com/wordpress-creation-kit/) offers:
|
44 |
|
|
|
45 |
* Front-end Posting - form builder for content creation and editing
|
46 |
* Options Page Creator - create option pages for your theme or your plugin
|
47 |
* More field types: Datepicker, Country Select, User Select
|
48 |
* Premium Email Support for your project
|
49 |
|
50 |
-
[See complete list of features](http://www.cozmoslabs.com/wordpress-creation-kit
|
51 |
|
52 |
= Website =
|
53 |
http://www.cozmoslabs.com/wordpress-creation-kit/
|
@@ -138,6 +139,10 @@ Creating a taxonomy generally automatically creates a special query variable usi
|
|
138 |
10. Taxonomy listing
|
139 |
|
140 |
== Changelog ==
|
|
|
|
|
|
|
|
|
141 |
= 1.0.5 =
|
142 |
* Fixed error from 1.0.4 require_once
|
143 |
|
6 |
|
7 |
Requires at least: 3.1
|
8 |
Tested up to: 3.7.1
|
9 |
+
Stable tag: 1.0.6
|
10 |
|
11 |
A must have tool for creating custom fields, custom post types and taxonomies, fast and without any programming knowledge.
|
12 |
|
42 |
= WCK PRO =
|
43 |
The [PRO version](http://www.cozmoslabs.com/wordpress-creation-kit/) offers:
|
44 |
|
45 |
+
* Swift Templates - Build your front-end templates directly from the WordPress admin UI, without writing any PHP code
|
46 |
* Front-end Posting - form builder for content creation and editing
|
47 |
* Options Page Creator - create option pages for your theme or your plugin
|
48 |
* More field types: Datepicker, Country Select, User Select
|
49 |
* Premium Email Support for your project
|
50 |
|
51 |
+
[See complete list of features](http://www.cozmoslabs.com/wordpress-creation-kit/)
|
52 |
|
53 |
= Website =
|
54 |
http://www.cozmoslabs.com/wordpress-creation-kit/
|
139 |
10. Taxonomy listing
|
140 |
|
141 |
== Changelog ==
|
142 |
+
= 1.0.6 =
|
143 |
+
* WCK menu now only appears for Administrator role only
|
144 |
+
* Minor fixes and improvements
|
145 |
+
|
146 |
= 1.0.5 =
|
147 |
* Fixed error from 1.0.4 require_once
|
148 |
|
wck-cfc.php
CHANGED
@@ -24,35 +24,36 @@ function wck_cfc_print_scripts($hook){
|
|
24 |
add_action( 'init', 'wck_cfc_create_custom_fields_cpt' );
|
25 |
|
26 |
function wck_cfc_create_custom_fields_cpt(){
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
56 |
}
|
57 |
|
58 |
/* add admin body class to cfc custom post type */
|
@@ -96,7 +97,7 @@ function wck_cfc_create_box(){
|
|
96 |
$post_type_names = array();
|
97 |
if( !empty( $post_types ) ){
|
98 |
foreach ($post_types as $post_type ) {
|
99 |
-
if ( $post_type->name != 'attachment' && $post_type->name != 'wck-meta-box' && $post_type->name != 'wck-frontend-posting' && $post_type->name != 'wck-option-page' && $post_type->name != 'wck-option-field' )
|
100 |
$post_type_names[] = $post_type->name;
|
101 |
}
|
102 |
}
|
@@ -514,7 +515,7 @@ function wck_cfc_add_side_boxes(){
|
|
514 |
}
|
515 |
function wck_cfc_side_box_one(){
|
516 |
?>
|
517 |
-
<a href="http://www.cozmoslabs.com/wordpress-creation-kit/"><img src="<?php echo plugins_url('/images/banner_pro.png', __FILE__)
|
518 |
<?php
|
519 |
}
|
520 |
|
24 |
add_action( 'init', 'wck_cfc_create_custom_fields_cpt' );
|
25 |
|
26 |
function wck_cfc_create_custom_fields_cpt(){
|
27 |
+
if( is_admin() && current_user_can( 'edit_theme_options' ) ){
|
28 |
+
$labels = array(
|
29 |
+
'name' => _x( 'WCK Custom Meta Boxes', 'post type general name'),
|
30 |
+
'singular_name' => _x( 'Custom Meta Box', 'post type singular name'),
|
31 |
+
'add_new' => _x( 'Add New', 'Custom Meta Box' ),
|
32 |
+
'add_new_item' => __( "Add New Meta Box", "wck" ),
|
33 |
+
'edit_item' => __( "Edit Meta Box", "wck" ) ,
|
34 |
+
'new_item' => __( "New Meta Box", "wck" ),
|
35 |
+
'all_items' => __( "Custom Fields Creator", "wck" ),
|
36 |
+
'view_item' => __( "View Meta Box", "wck" ),
|
37 |
+
'search_items' => __( "Search Meta Boxes", "wck" ),
|
38 |
+
'not_found' => __( "No Meta Boxes found", "wck" ),
|
39 |
+
'not_found_in_trash' => __( "No Meta Boxes found in Trash", "wck" ),
|
40 |
+
'parent_item_colon' => '',
|
41 |
+
'menu_name' => __( "Custom Meta Boxes", "wck" )
|
42 |
+
);
|
43 |
+
$args = array(
|
44 |
+
'labels' => $labels,
|
45 |
+
'public' => true,
|
46 |
+
'publicly_queryable' => false,
|
47 |
+
'show_ui' => true,
|
48 |
+
'show_in_menu' => 'wck-page',
|
49 |
+
'has_archive' => false,
|
50 |
+
'hierarchical' => false,
|
51 |
+
'capability_type' => 'post',
|
52 |
+
'supports' => array( 'title' )
|
53 |
+
);
|
54 |
+
|
55 |
+
register_post_type( 'wck-meta-box', $args );
|
56 |
+
}
|
57 |
}
|
58 |
|
59 |
/* add admin body class to cfc custom post type */
|
97 |
$post_type_names = array();
|
98 |
if( !empty( $post_types ) ){
|
99 |
foreach ($post_types as $post_type ) {
|
100 |
+
if ( $post_type->name != 'attachment' && $post_type->name != 'wck-meta-box' && $post_type->name != 'wck-frontend-posting' && $post_type->name != 'wck-option-page' && $post_type->name != 'wck-option-field' && $post_type->name != 'wck-swift-template' )
|
101 |
$post_type_names[] = $post_type->name;
|
102 |
}
|
103 |
}
|
515 |
}
|
516 |
function wck_cfc_side_box_one(){
|
517 |
?>
|
518 |
+
<a href="http://www.cozmoslabs.com/wordpress-creation-kit/"><img src="<?php echo plugins_url('/images/banner_pro.png', __FILE__) ?>?v=1" width="260" height="385" alt="WCK-PRO"/></a>
|
519 |
<?php
|
520 |
}
|
521 |
|
wck-cptc.php
CHANGED
@@ -263,7 +263,7 @@ function wck_cptc_add_side_boxes(){
|
|
263 |
}
|
264 |
function wck_cptc_side_box_one(){
|
265 |
?>
|
266 |
-
<a href="http://www.cozmoslabs.com/wordpress-creation-kit/"><img src="<?php echo plugins_url('/images/banner_pro.png', __FILE__)
|
267 |
<?php
|
268 |
}
|
269 |
|
263 |
}
|
264 |
function wck_cptc_side_box_one(){
|
265 |
?>
|
266 |
+
<a href="http://www.cozmoslabs.com/wordpress-creation-kit/"><img src="<?php echo plugins_url('/images/banner_pro.png', __FILE__) ?>?v=1" width="260" height="385" alt="WCK-PRO"/></a>
|
267 |
<?php
|
268 |
}
|
269 |
|
wck-ctc.php
CHANGED
@@ -27,7 +27,7 @@ function wck_ctc_create_box(){
|
|
27 |
$post_type_names = array();
|
28 |
if( !empty( $post_types ) ){
|
29 |
foreach ( $post_types as $post_type ) {
|
30 |
-
if ( $post_type->name != 'attachment' && $post_type->name != 'wck-meta-box' && $post_type->name != 'wck-frontend-posting' && $post_type->name != 'wck-option-page' && $post_type->name != 'wck-option-field' )
|
31 |
$post_type_names[] = $post_type->name;
|
32 |
}
|
33 |
}
|
@@ -104,9 +104,12 @@ function wck_ctc_create_taxonomy(){
|
|
104 |
'public' => $ct['public'] == 'false' ? false : true,
|
105 |
'show_ui' => $ct['show-ui'] == 'false' ? false : true,
|
106 |
'hierarchical' => $ct['hierarchical'] == 'false' ? false : true,
|
107 |
-
'show_tagcloud' => $ct['show-tagcloud'] == 'false' ? false : true
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
110 |
|
111 |
if( !empty( $ct['attach-to'] ) )
|
112 |
$object_type = explode( ', ', $ct['attach-to'] );
|
@@ -220,7 +223,7 @@ function wck_ctc_add_side_boxes(){
|
|
220 |
}
|
221 |
function wck_ctc_side_box_one(){
|
222 |
?>
|
223 |
-
<a href="http://www.cozmoslabs.com/wordpress-creation-kit/"><img src="<?php echo plugins_url('/images/banner_pro.png', __FILE__)
|
224 |
<?php
|
225 |
}
|
226 |
|
27 |
$post_type_names = array();
|
28 |
if( !empty( $post_types ) ){
|
29 |
foreach ( $post_types as $post_type ) {
|
30 |
+
if ( $post_type->name != 'attachment' && $post_type->name != 'wck-meta-box' && $post_type->name != 'wck-frontend-posting' && $post_type->name != 'wck-option-page' && $post_type->name != 'wck-option-field' && $post_type->name != 'wck-swift-template' )
|
31 |
$post_type_names[] = $post_type->name;
|
32 |
}
|
33 |
}
|
104 |
'public' => $ct['public'] == 'false' ? false : true,
|
105 |
'show_ui' => $ct['show-ui'] == 'false' ? false : true,
|
106 |
'hierarchical' => $ct['hierarchical'] == 'false' ? false : true,
|
107 |
+
'show_tagcloud' => $ct['show-tagcloud'] == 'false' ? false : true
|
108 |
+
);
|
109 |
+
|
110 |
+
if( !empty( $ct['show-admin-column'] ) ){
|
111 |
+
$args['show_admin_column'] = $ct['show-admin-column'] == 'false' ? false : true;
|
112 |
+
}
|
113 |
|
114 |
if( !empty( $ct['attach-to'] ) )
|
115 |
$object_type = explode( ', ', $ct['attach-to'] );
|
223 |
}
|
224 |
function wck_ctc_side_box_one(){
|
225 |
?>
|
226 |
+
<a href="http://www.cozmoslabs.com/wordpress-creation-kit/"><img src="<?php echo plugins_url('/images/banner_pro.png', __FILE__) ?>?v=1" width="260" height="385" alt="WCK-PRO"/></a>
|
227 |
<?php
|
228 |
}
|
229 |
|
wck-sas.php
CHANGED
@@ -50,34 +50,34 @@ function wck_sas_create_box(){
|
|
50 |
$wck_premium_update = WCK_PLUGIN_DIR.'/update/';
|
51 |
if (file_exists ($wck_premium_update . 'update-checker.php'))
|
52 |
new Wordpress_Creation_Kit( $args );
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
/* create the box */
|
79 |
-
new Wordpress_Creation_Kit( $args );
|
80 |
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
/* Add the welcoming text on WCK Start and Settings Page */
|
@@ -122,6 +122,9 @@ function wck_sas_quickintro($hook){
|
|
122 |
<p><?php _e( 'Create new taxonomies for filtering your content', 'wck' ); ?></p>
|
123 |
<p><?php _e( 'Access documentation <a href="http://www.cozmoslabs.com/wordpress-creation-kit/custom-taxonomy-creator/" target="_blank">here</a> about how to display them in your templates.', 'wck' ); ?></p>
|
124 |
|
|
|
|
|
|
|
125 |
<h4><?php _e( 'Front-End Posting (available in the Pro version)', 'wck' ); ?></h4>
|
126 |
<p><?php _e( 'Create and edit posts/pages or custom posts directly from the front-end.', 'wck' ); ?></p>
|
127 |
<p><?php _e( 'Available shortcodes:', 'wck' ); ?></p>
|
@@ -146,6 +149,7 @@ function wck_sas_quickintro($hook){
|
|
146 |
/* add refresh to page. Needed to display the serial notification. Need to refactor in the future so it works via ajax. */
|
147 |
add_action("wck_refresh_list_wck_serial", "wck_serial_after_refresh_list");
|
148 |
add_action("wck_refresh_entry_wck_serial", "wck_serial_after_refresh_list");
|
|
|
149 |
add_action("wck_refresh_entry_wck_tools", "wck_serial_after_refresh_list");
|
150 |
function wck_serial_after_refresh_list(){
|
151 |
echo '<script type="text/javascript">window.location="'. get_admin_url() . 'admin.php?page=sas-page&updated=true' .'";</script>';
|
50 |
$wck_premium_update = WCK_PLUGIN_DIR.'/update/';
|
51 |
if (file_exists ($wck_premium_update . 'update-checker.php'))
|
52 |
new Wordpress_Creation_Kit( $args );
|
53 |
+
|
54 |
+
/* set up the tools array */
|
55 |
+
$sas_tools_activate = array(
|
56 |
+
array( 'type' => 'radio', 'title' => __( 'Custom Fields Creator', 'wck' ), 'options' => array( 'enabled', 'disabled' ), 'default' => 'enabled' ),
|
57 |
+
array( 'type' => 'radio', 'title' => __( 'Custom Post Type Creator', 'wck' ), 'options' => array( 'enabled', 'disabled' ), 'default' => 'enabled' ),
|
58 |
+
array( 'type' => 'radio', 'title' => __( 'Custom Taxonomy Creator', 'wck' ), 'options' => array( 'enabled', 'disabled' ), 'default' => 'enabled' ),
|
59 |
+
);
|
60 |
+
if( file_exists( dirname(__FILE__).'/wck-fep.php' ) )
|
61 |
+
$sas_tools_activate[] = array( 'type' => 'radio', 'title' => __( 'Frontend Posting', 'wck' ), 'options' => array( 'enabled', 'disabled' ), 'default' => 'enabled' );
|
62 |
+
if( file_exists( dirname(__FILE__).'/wck-opc.php' ) )
|
63 |
+
$sas_tools_activate[] = array( 'type' => 'radio', 'title' => __( 'Option Pages Creator', 'wck' ), 'options' => array( 'enabled', 'disabled' ), 'default' => 'enabled' );
|
64 |
+
if( file_exists( dirname(__FILE__).'/wck-stp.php' ) )
|
65 |
+
$sas_tools_activate[] = array( 'type' => 'radio', 'title' => __( 'Swift Templates', 'wck' ), 'options' => array( 'enabled', 'disabled' ), 'default' => 'enabled' );
|
66 |
+
|
67 |
+
/* set up the box arguments */
|
68 |
+
$args = array(
|
69 |
+
'metabox_id' => 'wck_tools_activate',
|
70 |
+
'metabox_title' => __( 'WordPress Creation Kit Tools: enable or disable the tools you want', 'wck' ),
|
71 |
+
'post_type' => 'sas-page',
|
72 |
+
'meta_name' => 'wck_tools',
|
73 |
+
'meta_array' => $sas_tools_activate,
|
74 |
+
'context' => 'option',
|
75 |
+
'single' => true
|
76 |
+
);
|
|
|
|
|
|
|
77 |
|
78 |
+
/* create the box */
|
79 |
+
new Wordpress_Creation_Kit( $args );
|
80 |
+
}
|
81 |
}
|
82 |
|
83 |
/* Add the welcoming text on WCK Start and Settings Page */
|
122 |
<p><?php _e( 'Create new taxonomies for filtering your content', 'wck' ); ?></p>
|
123 |
<p><?php _e( 'Access documentation <a href="http://www.cozmoslabs.com/wordpress-creation-kit/custom-taxonomy-creator/" target="_blank">here</a> about how to display them in your templates.', 'wck' ); ?></p>
|
124 |
|
125 |
+
<h4><?php _e( 'Swift Templates (available in the Pro version)', 'wck' ); ?></h4>
|
126 |
+
<p><?php _e( 'Build your front-end templates directly from the WordPress admin UI, without writing any PHP code.', 'wck' ); ?></p>
|
127 |
+
|
128 |
<h4><?php _e( 'Front-End Posting (available in the Pro version)', 'wck' ); ?></h4>
|
129 |
<p><?php _e( 'Create and edit posts/pages or custom posts directly from the front-end.', 'wck' ); ?></p>
|
130 |
<p><?php _e( 'Available shortcodes:', 'wck' ); ?></p>
|
149 |
/* add refresh to page. Needed to display the serial notification. Need to refactor in the future so it works via ajax. */
|
150 |
add_action("wck_refresh_list_wck_serial", "wck_serial_after_refresh_list");
|
151 |
add_action("wck_refresh_entry_wck_serial", "wck_serial_after_refresh_list");
|
152 |
+
add_action("wck_refresh_list_wck_tools", "wck_serial_after_refresh_list");
|
153 |
add_action("wck_refresh_entry_wck_tools", "wck_serial_after_refresh_list");
|
154 |
function wck_serial_after_refresh_list(){
|
155 |
echo '<script type="text/javascript">window.location="'. get_admin_url() . 'admin.php?page=sas-page&updated=true' .'";</script>';
|
wck-template-api/wck-field-preprocess.php
CHANGED
@@ -39,8 +39,11 @@ function wck_preprocess_field_textarea( $field ){
|
|
39 |
*/
|
40 |
add_filter( 'wck_output_get_field_checkbox', 'wck_preprocess_field_checkbox', 10 );
|
41 |
function wck_preprocess_field_checkbox( $field ){
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -53,9 +56,12 @@ function wck_preprocess_field_checkbox( $field ){
|
|
53 |
* @return string $checkbox The processed field
|
54 |
*/
|
55 |
add_filter( 'wck_output_the_field_checkbox', 'wck_preprocess_the_field_checkbox', 10 );
|
56 |
-
function wck_preprocess_the_field_checkbox( $field ){
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
/**
|
39 |
*/
|
40 |
add_filter( 'wck_output_get_field_checkbox', 'wck_preprocess_field_checkbox', 10 );
|
41 |
function wck_preprocess_field_checkbox( $field ){
|
42 |
+
if( !empty( $field ) ){
|
43 |
+
$checkbox = explode( ', ', $field );
|
44 |
+
return $checkbox;
|
45 |
+
}
|
46 |
+
return array();
|
47 |
}
|
48 |
|
49 |
/**
|
56 |
* @return string $checkbox The processed field
|
57 |
*/
|
58 |
add_filter( 'wck_output_the_field_checkbox', 'wck_preprocess_the_field_checkbox', 10 );
|
59 |
+
function wck_preprocess_the_field_checkbox( $field ){
|
60 |
+
if( !empty( $field ) ){
|
61 |
+
$checkbox_list = implode( ', ', $field );
|
62 |
+
return $checkbox_list;
|
63 |
+
}
|
64 |
+
return '';
|
65 |
}
|
66 |
|
67 |
/**
|
wck-template-api/wck-template-api.php
CHANGED
@@ -51,7 +51,7 @@ if( !function_exists( 'get_cfc_field' ) ){
|
|
51 |
*
|
52 |
*/
|
53 |
if( !function_exists( 'the_cfc_field' ) ){
|
54 |
-
function the_cfc_field( $meta_name, $field_name, $post_id = false, $key = 0
|
55 |
|
56 |
$current_field = WCK_Template_API::get_field( $meta_name, $field_name, $post_id, $key );
|
57 |
|
@@ -75,7 +75,11 @@ if( !function_exists( 'the_cfc_field' ) ){
|
|
75 |
if ( is_array( $current_field ) ){
|
76 |
return;
|
77 |
}
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
}
|
51 |
*
|
52 |
*/
|
53 |
if( !function_exists( 'the_cfc_field' ) ){
|
54 |
+
function the_cfc_field( $meta_name, $field_name, $post_id = false, $key = 0, $do_echo = true ){
|
55 |
|
56 |
$current_field = WCK_Template_API::get_field( $meta_name, $field_name, $post_id, $key );
|
57 |
|
75 |
if ( is_array( $current_field ) ){
|
76 |
return;
|
77 |
}
|
78 |
+
|
79 |
+
if ( $do_echo ){
|
80 |
+
echo $current_field;
|
81 |
+
} else {
|
82 |
+
return $current_field;
|
83 |
+
}
|
84 |
}
|
85 |
}
|
wck.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WCK - Custom Fields and Custom Post Types Creator
|
4 |
Description: WordPress Creation Kit consists of three tools that can help you create and maintain custom post types, custom taxonomies and most importantly, custom fields and metaboxes for your posts, pages or CPT's.
|
5 |
Author: Reflection Media, Madalin Ungureanu, sareiodata
|
6 |
-
Version: 1.0.
|
7 |
Author URI: http://www.reflectionmedia.ro
|
8 |
|
9 |
License: GPL2
|
@@ -76,6 +76,9 @@ if( $wck_tools ){
|
|
76 |
if( !empty( $wck_tools[0]['option-pages-creator'] ) ){
|
77 |
$wck_opc = $wck_tools[0]['option-pages-creator'];
|
78 |
}
|
|
|
|
|
|
|
79 |
}
|
80 |
/* include Custom Post Type Creator */
|
81 |
if( !isset( $wck_cptc ) || $wck_cptc == 'enabled' )
|
@@ -96,6 +99,10 @@ if( file_exists( dirname(__FILE__).'/wck-fep.php' ) && ( !isset( $wck_fep ) || $
|
|
96 |
if( file_exists( dirname(__FILE__).'/wck-opc.php' ) && ( !isset( $wck_opc ) || $wck_opc == 'enabled' ) )
|
97 |
require_once('wck-opc.php');
|
98 |
|
|
|
|
|
|
|
|
|
99 |
/* deactivation hook */
|
100 |
register_deactivation_hook( __FILE__, 'wck_deactivate_function' );
|
101 |
function wck_deactivate_function() {
|
3 |
Plugin Name: WCK - Custom Fields and Custom Post Types Creator
|
4 |
Description: WordPress Creation Kit consists of three tools that can help you create and maintain custom post types, custom taxonomies and most importantly, custom fields and metaboxes for your posts, pages or CPT's.
|
5 |
Author: Reflection Media, Madalin Ungureanu, sareiodata
|
6 |
+
Version: 1.0.6
|
7 |
Author URI: http://www.reflectionmedia.ro
|
8 |
|
9 |
License: GPL2
|
76 |
if( !empty( $wck_tools[0]['option-pages-creator'] ) ){
|
77 |
$wck_opc = $wck_tools[0]['option-pages-creator'];
|
78 |
}
|
79 |
+
if( !empty( $wck_tools[0]['swift-templates'] ) ){
|
80 |
+
$wck_stp = $wck_tools[0]['swift-templates'];
|
81 |
+
}
|
82 |
}
|
83 |
/* include Custom Post Type Creator */
|
84 |
if( !isset( $wck_cptc ) || $wck_cptc == 'enabled' )
|
99 |
if( file_exists( dirname(__FILE__).'/wck-opc.php' ) && ( !isset( $wck_opc ) || $wck_opc == 'enabled' ) )
|
100 |
require_once('wck-opc.php');
|
101 |
|
102 |
+
/* include Swift Templates */
|
103 |
+
if( file_exists( dirname(__FILE__).'/wck-stp.php' ) && ( !isset( $wck_stp ) || $wck_stp == 'enabled' ) )
|
104 |
+
require_once('wck-stp.php');
|
105 |
+
|
106 |
/* deactivation hook */
|
107 |
register_deactivation_hook( __FILE__, 'wck_deactivate_function' );
|
108 |
function wck_deactivate_function() {
|
wordpress-creation-kit-api/fields/upload.php
CHANGED
@@ -32,13 +32,10 @@ if( !empty ( $value ) )
|
|
32 |
$element .= '</p></div>';
|
33 |
/* the upload link. we send through get the hidden input id, details div id and meta name */
|
34 |
if( !empty( $details['attach_to_post'] ) ){
|
35 |
-
if( get_the_id() != null )
|
36 |
-
$post_id = get_the_id();
|
37 |
-
|
38 |
$attach_to_post = 'post_id='. $post_id .'&';
|
39 |
-
}else
|
40 |
$attach_to_post = '';
|
41 |
-
|
42 |
if( empty( $var_prefix ) )
|
43 |
$var_prefix = '';
|
44 |
if( empty( $edit_class ) )
|
32 |
$element .= '</p></div>';
|
33 |
/* the upload link. we send through get the hidden input id, details div id and meta name */
|
34 |
if( !empty( $details['attach_to_post'] ) ){
|
|
|
|
|
|
|
35 |
$attach_to_post = 'post_id='. $post_id .'&';
|
36 |
+
}else {
|
37 |
$attach_to_post = '';
|
38 |
+
}
|
39 |
if( empty( $var_prefix ) )
|
40 |
$var_prefix = '';
|
41 |
if( empty( $edit_class ) )
|
wordpress-creation-kit-api/wordpress-creation-kit.php
CHANGED
@@ -16,6 +16,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
16 |
if( file_exists( dirname(__FILE__). '/wck-fep/wck-fep.php' ) )
|
17 |
require_once( 'wck-fep/wck-fep.php' );
|
18 |
|
|
|
|
|
|
|
|
|
19 |
/*
|
20 |
|
21 |
Usage Example 1:
|
@@ -259,6 +263,8 @@ class Wordpress_Creation_Kit{
|
|
259 |
|
260 |
$element .= '</div><!-- .mb-right-column -->';
|
261 |
|
|
|
|
|
262 |
return $element;
|
263 |
|
264 |
}
|
@@ -451,7 +457,7 @@ class Wordpress_Creation_Kit{
|
|
451 |
|
452 |
/* display it differently based on field type*/
|
453 |
if( $details['type'] == 'upload' ){
|
454 |
-
$display_value = self::
|
455 |
} elseif ( $details['type'] == 'user select' ) {
|
456 |
$display_value = self::wck_get_entry_field_user_select( $value ) . '</pre>';
|
457 |
} elseif ( $details['type'] == 'cpt select' ){
|
@@ -501,8 +507,8 @@ class Wordpress_Creation_Kit{
|
|
501 |
return $list;
|
502 |
}
|
503 |
|
504 |
-
/* function to generate output for
|
505 |
-
function
|
506 |
if( !empty ( $id ) && is_numeric( $id ) ){
|
507 |
$file_src = wp_get_attachment_url($id);
|
508 |
$thumbnail = wp_get_attachment_image( $id, array( 80, 60 ), true );
|
16 |
if( file_exists( dirname(__FILE__). '/wck-fep/wck-fep.php' ) )
|
17 |
require_once( 'wck-fep/wck-fep.php' );
|
18 |
|
19 |
+
if( file_exists( dirname(__FILE__). '/wck-static-metabox-api.php' ) )
|
20 |
+
require_once( 'wck-static-metabox-api.php' );
|
21 |
+
|
22 |
+
|
23 |
/*
|
24 |
|
25 |
Usage Example 1:
|
263 |
|
264 |
$element .= '</div><!-- .mb-right-column -->';
|
265 |
|
266 |
+
$element = apply_filters( "wck_output_form_field_{$meta}_" . Wordpress_Creation_Kit::wck_generate_slug( $details['title'] ), $element );
|
267 |
+
|
268 |
return $element;
|
269 |
|
270 |
}
|
457 |
|
458 |
/* display it differently based on field type*/
|
459 |
if( $details['type'] == 'upload' ){
|
460 |
+
$display_value = self::wck_get_entry_field_upload($value);
|
461 |
} elseif ( $details['type'] == 'user select' ) {
|
462 |
$display_value = self::wck_get_entry_field_user_select( $value ) . '</pre>';
|
463 |
} elseif ( $details['type'] == 'cpt select' ){
|
507 |
return $list;
|
508 |
}
|
509 |
|
510 |
+
/* function to generate output for upload field */
|
511 |
+
function wck_get_entry_field_upload($id){
|
512 |
if( !empty ( $id ) && is_numeric( $id ) ){
|
513 |
$file_src = wp_get_attachment_url($id);
|
514 |
$thumbnail = wp_get_attachment_image( $id, array( 80, 60 ), true );
|