Changeset 1671330
- Timestamp:
- 06/05/2017 11:03:00 PM (9 years ago)
- Location:
- backend-custom-fields/trunk
- Files:
-
- 5 edited
-
backend-custom-fields.php (modified) (2 diffs)
-
classes/BCF_Fields.php (modified) (1 diff)
-
classes/BCF_Post.php (modified) (1 diff)
-
classes/BCF_User.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
backend-custom-fields/trunk/backend-custom-fields.php
r1195126 r1671330 7 7 Plugin URI: http://mostasharoon.org 8 8 Description: An easy way to display the custom fields at the backend. 9 Version: 1.0 9 Version: 1.0.2 10 10 Author: Mohammed Thaer 11 11 Author URI: http://mostasharoon.org … … 13 13 */ 14 14 15 define( 'BCF_VERSION', '1.0 ' );15 define( 'BCF_VERSION', '1.0.2' ); 16 16 17 17 /* ----------------------------------------------------------------------------------- */ -
backend-custom-fields/trunk/classes/BCF_Fields.php
r1195126 r1671330 112 112 return $html; 113 113 } 114 115 static function select2( array $args ) { 116 117 $default_args = array( 118 'name' => '', 119 'class' => '', 120 'multiple' => false, 121 'options' => array(), 122 'selected' => array(), 123 'id' => '' 124 ); 125 126 $args = array_merge( $default_args, $args ); 127 $multiple = $args['multiple'] ? 'multiple' : ''; 128 129 $html = '<select ' . $multiple . ' name="' . $args['name'] . '" id="' . $args['id'] . '" class="' . $args['class'] . '">'; 130 131 if ( ! empty( $args['options'] ) ) { 132 foreach ( $args['options'] as $id => $option ) { 133 $selected = in_array( $id, $args['selected'] ) ? 'selected' : ''; 134 $html .= '<option ' . $selected . ' value="' . $id . '">' . $option . '</option>'; 135 } 136 } 137 138 $html .= '</select>'; 139 140 141 return $html; 142 } 114 143 } -
backend-custom-fields/trunk/classes/BCF_Post.php
r1195126 r1671330 54 54 if ( method_exists( $this, $field['template'] ) ) { 55 55 $html .= '<tr>'; 56 $html .= $this->$field['template']( $field, $id, 'post' ); 56 57 //Incompatible with PHP7 58 // $html .= $this->$field['template']( $field, $id, 'post' ); 59 $html .= call_user_func_array( array( $this, $field['template'] ), array( $field, $id, 'post' ) ); 60 57 61 $html .= '</tr>'; 58 62 } -
backend-custom-fields/trunk/classes/BCF_User.php
r1195126 r1671330 97 97 $html .= '<th>' . BCF_Fields::label( esc_html__( 'Profile Form' ), 'bcf_pb_form' ) . '</th>'; 98 98 $html .= '<td>'; 99 $html .= BCF_Fields::select ( $args );99 $html .= BCF_Fields::select2( $args ); 100 100 $html .= BCF_Fields::p( esc_html__( 'Backend Custom Fields For Forms Management System couldn\'t know the form that this user use when he/she get register, please select the form then update the profile.', 'bcf' ), 'description' ); 101 101 $html .= '</td>'; … … 112 112 if ( method_exists( $this, $field['template'] ) ) { 113 113 $html .= '<tr>'; 114 $html .= $this->$field['template']( $field, $id, 'user' ); 114 115 //Incompatible with PHP7 116 // $html .= $this->$field['template']( $field, $id, 'user' ); 117 $html .= call_user_func_array( array( $this, $field['template'] ), array($field, $id, 'user' ) ); 118 115 119 $html .= '</tr>'; 116 120 } … … 154 158 if ( method_exists( $this, $field['template'] ) ) { 155 159 $html .= '<tr>'; 156 $html .= $this->$field['template']( $field, $id, 'user' ); 160 161 //Incompatible with PHP7 162 // $html .= $this->$field['template']( $field, $id, 'user' ); 163 $html .= call_user_func_array( array( $this, $field['template'] ), array($field, $id, 'user' ) ); 164 157 165 $html .= '</tr>'; 158 166 } -
backend-custom-fields/trunk/readme.txt
r1195126 r1671330 4 4 Tags: forms management system, visual builder, custom fields, custom post type, form, forms, mostasharoon, views, admin, advanced, custom, custom field, edit, field, file, image, more fields, Post, repeater, simple fields, text, textarea, type 5 5 Requires at least: 3.5 6 Tested up to: 4. 2.27 Stable tag: 1.0 6 Tested up to: 4.7.5 7 Stable tag: 1.0.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 40 40 == Changelog == 41 41 42 = 1.0.2 = 43 * Fix can't attach a form to a user that don't have one. 44 45 = 1.0.1 = 46 * Fix issue with PHP7. 47 42 48 = 1.0 = 43 49 * initial release
Note: See TracChangeset
for help on using the changeset viewer.