Changeset 917226
- Timestamp:
- 05/19/2014 03:01:42 PM (12 years ago)
- Location:
- wp-admin-directory/trunk
- Files:
-
- 8 edited
-
README.txt (modified) (1 diff)
-
admin/assets/metaboxes/helpers/cmb_Meta_Box_Sanitize.php (modified) (3 diffs)
-
admin/assets/metaboxes/helpers/cmb_Meta_Box_Show_Filters.php (modified) (2 diffs)
-
admin/assets/metaboxes/helpers/cmb_Meta_Box_ajax.php (modified) (2 diffs)
-
admin/assets/metaboxes/helpers/cmb_Meta_Box_field.php (modified) (5 diffs)
-
admin/assets/metaboxes/helpers/cmb_Meta_Box_types.php (modified) (2 diffs)
-
admin/assets/metaboxes/init.php (modified) (9 diffs)
-
wp-admin-directory.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-admin-directory/trunk/README.txt
r917130 r917226 5 5 Requires at least: 3.7.0 6 6 Tested up to: 3.9.1 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
wp-admin-directory/trunk/admin/assets/metaboxes/helpers/cmb_Meta_Box_Sanitize.php
r917130 r917226 28 28 $this->field = $field; 29 29 $this->value = $value; 30 $this->object_id = cmb_Meta_Box::get_object_id();31 $this->object_type = cmb_Meta_Box::get_object_type();30 $this->object_id = WP_Admin_Dir_cmb_Meta_box::get_object_id(); 31 $this->object_type = WP_Admin_Dir_cmb_Meta_box::get_object_type(); 32 32 } 33 33 … … 226 226 227 227 if ( empty( $tzstring ) ) 228 $tzstring = cmb_Meta_Box::timezone_string();229 230 $offset = cmb_Meta_Box::timezone_offset( $tzstring, true );228 $tzstring = WP_Admin_Dir_cmb_Meta_box::timezone_string(); 229 230 $offset = WP_Admin_Dir_cmb_Meta_box::timezone_offset( $tzstring, true ); 231 231 232 232 if ( substr( $tzstring, 0, 3 ) === 'UTC' ) … … 292 292 // If there is no ID saved yet, try to get it from the url 293 293 if ( $value && ! $id_val ) { 294 $id_val = cmb_Meta_Box::image_id_from_url( $value );294 $id_val = WP_Admin_Dir_cmb_Meta_box::image_id_from_url( $value ); 295 295 } 296 296 -
wp-admin-directory/trunk/admin/assets/metaboxes/helpers/cmb_Meta_Box_Show_Filters.php
r917130 r917226 24 24 return $display; 25 25 26 $object_id = is_admin() ? cmb_Meta_Box::get_object_id() : @get_the_id();26 $object_id = is_admin() ? WP_Admin_Dir_cmb_Meta_box::get_object_id() : @get_the_id(); 27 27 28 28 if ( ! $object_id ) … … 45 45 return $display; 46 46 47 $object_id = cmb_Meta_Box::get_object_id();47 $object_id = WP_Admin_Dir_cmb_Meta_box::get_object_id(); 48 48 49 if ( ! $object_id || cmb_Meta_Box::get_object_type() !== 'post' )49 if ( ! $object_id || WP_Admin_Dir_cmb_Meta_box::get_object_type() !== 'post' ) 50 50 return false; 51 51 -
wp-admin-directory/trunk/admin/assets/metaboxes/helpers/cmb_Meta_Box_ajax.php
r917130 r917226 153 153 // get cached data 154 154 $data = 'options-page' === self::$object_type 155 ? cmb_Meta_Box::get_option( self::$object_id, self::$embed_args['cache_key'] )155 ? WP_Admin_Dir_cmb_Meta_box::get_option( self::$object_id, self::$embed_args['cache_key'] ) 156 156 : get_metadata( self::$object_type, self::$object_id, $meta_key, true ); 157 157 … … 177 177 if ( 'options-page' === self::$object_type ) { 178 178 // Set the option 179 cmb_Meta_Box::update_option( self::$object_id, self::$embed_args['cache_key'], $meta_value, array( 'type' => 'oembed' ) );179 WP_Admin_Dir_cmb_Meta_box::update_option( self::$object_id, self::$embed_args['cache_key'], $meta_value, array( 'type' => 'oembed' ) ); 180 180 // Save the option 181 cmb_Meta_Box::save_option( self::$object_id );181 WP_Admin_Dir_cmb_Meta_box::save_option( self::$object_id ); 182 182 } else { 183 183 update_metadata( self::$object_type, self::$object_id, $meta_key, $meta_value ); -
wp-admin-directory/trunk/admin/assets/metaboxes/helpers/cmb_Meta_Box_field.php
r917130 r917226 49 49 */ 50 50 public function __construct( $field_args, $group_field = null ) { 51 $this->object_id = cmb_Meta_Box::get_object_id();52 $this->object_type = cmb_Meta_Box::get_object_type();51 $this->object_id = WP_Admin_Dir_cmb_Meta_box::get_object_id(); 52 $this->object_type = WP_Admin_Dir_cmb_Meta_box::get_object_type(); 53 53 $this->group = ! empty( $group_field ) ? $group_field : false; 54 54 $this->args = $this->_set_field_defaults( $field_args ); … … 142 142 143 143 $data = 'options-page' === $type 144 ? cmb_Meta_Box::get_option( $id, $field_id )144 ? WP_Admin_Dir_cmb_Meta_box::get_option( $id, $field_id ) 145 145 : get_metadata( $type, $id, $field_id, ( $single || $repeat ) /* If multicheck this can be multiple values */ ); 146 146 … … 165 165 166 166 if ( 'options-page' === $type ) 167 return cmb_Meta_Box::update_option( $id, $field_id, $new_value, $single );167 return WP_Admin_Dir_cmb_Meta_box::update_option( $id, $field_id, $new_value, $single ); 168 168 169 169 if ( ! $single ) … … 182 182 183 183 return 'options-page' === $type 184 ? cmb_Meta_Box::remove_option( $id, $field_id )184 ? WP_Admin_Dir_cmb_Meta_box::remove_option( $id, $field_id ) 185 185 : delete_metadata( $type, $id, $field_id, $old ); 186 186 } … … 338 338 */ 339 339 public function field_timezone_offset() { 340 return cmb_Meta_Box::timezone_offset( $this->field_timezone() );340 return WP_Admin_Dir_cmb_Meta_box::timezone_offset( $this->field_timezone() ); 341 341 } 342 342 -
wp-admin-directory/trunk/admin/assets/metaboxes/helpers/cmb_Meta_Box_types.php
r917130 r917226 503 503 $this->field->args['default'] = $this->field->args( 'default' ) 504 504 ? $this->field->args( 'default' ) 505 : cmb_Meta_Box::timezone_string();505 : WP_Admin_Dir_cmb_Meta_box::timezone_string(); 506 506 507 507 $meta_value = $this->field->escaped_value(); … … 740 740 // If there is no ID saved yet, try to get it from the url 741 741 if ( $meta_value && ! $_id_value ) { 742 $_id_value = cmb_Meta_Box::image_id_from_url( esc_url_raw( $meta_value ) );742 $_id_value = WP_Admin_Dir_cmb_Meta_box::image_id_from_url( esc_url_raw( $meta_value ) ); 743 743 } 744 744 -
wp-admin-directory/trunk/admin/assets/metaboxes/init.php
r917130 r917226 36 36 37 37 // Autoload helper classes 38 spl_autoload_register(' cmb_Meta_Box::autoload_helpers');38 spl_autoload_register('WP_Admin_Dir_cmb_Meta_Box::autoload_helpers'); 39 39 40 40 $meta_boxes = array(); 41 41 $meta_boxes = apply_filters( 'cmb_meta_boxes', $meta_boxes ); 42 42 foreach ( $meta_boxes as $meta_box ) { 43 $my_box = new cmb_Meta_Box( $meta_box );43 $my_box = new WP_Admin_Dir_cmb_Meta_Box( $meta_box ); 44 44 } 45 45 46 define( 'CMB_META_BOX_URL', cmb_Meta_Box::get_meta_box_url() );46 define( 'CMB_META_BOX_URL', WP_Admin_Dir_cmb_Meta_Box::get_meta_box_url() ); 47 47 48 48 /** 49 49 * Create meta boxes 50 50 */ 51 class cmb_Meta_Box {51 class WP_Admin_Dir_cmb_Meta_Box { 52 52 53 53 /** … … 1032 1032 */ 1033 1033 function cmb_get_option( $option_key, $field_id = '' ) { 1034 return cmb_Meta_Box::get_option( $option_key, $field_id );1034 return WP_Admin_Dir_cmb_Meta_Box::get_option( $option_key, $field_id ); 1035 1035 } 1036 1036 … … 1046 1046 // Default to the loop post ID 1047 1047 $object_id = $object_id ? $object_id : get_the_ID(); 1048 cmb_Meta_Box::set_object_id( $object_id );1049 cmb_Meta_Box::set_object_type( $object_type );1048 WP_Admin_Dir_cmb_Meta_Box::set_object_id( $object_id ); 1049 WP_Admin_Dir_cmb_Meta_Box::set_object_type( $object_type ); 1050 1050 // Send back field object 1051 1051 return new cmb_Meta_Box_field( $field_args ); … … 1084 1084 */ 1085 1085 function cmb_print_metabox( $meta_box, $object_id ) { 1086 $cmb = new cmb_Meta_Box( $meta_box );1086 $cmb = new WP_Admin_Dir_cmb_Meta_Box( $meta_box ); 1087 1087 if ( $cmb ) { 1088 1088 1089 cmb_Meta_Box::set_object_id( $object_id );1089 WP_Admin_Dir_cmb_Meta_Box::set_object_id( $object_id ); 1090 1090 1091 1091 if ( ! wp_script_is( 'cmb-scripts', 'registered' ) ) … … 1098 1098 wp_enqueue_style( 'cmb-styles' ); 1099 1099 1100 cmb_Meta_Box::show_form( $meta_box );1100 WP_Admin_Dir_cmb_Meta_Box::show_form( $meta_box ); 1101 1101 } 1102 1102 … … 1110 1110 */ 1111 1111 function cmb_save_metabox_fields( $meta_box, $object_id ) { 1112 cmb_Meta_Box::save_fields( $meta_box, $object_id );1112 WP_Admin_Dir_cmb_Meta_Box::save_fields( $meta_box, $object_id ); 1113 1113 } 1114 1114 … … 1123 1123 function cmb_metabox_form( $meta_box, $object_id, $echo = true ) { 1124 1124 1125 $meta_box = cmb_Meta_Box::set_mb_defaults( $meta_box );1125 $meta_box = WP_Admin_Dir_cmb_Meta_Box::set_mb_defaults( $meta_box ); 1126 1126 1127 1127 // Make sure form should be shown … … 1130 1130 1131 1131 // Make sure that our object type is explicitly set by the metabox config 1132 cmb_Meta_Box::set_object_type(cmb_Meta_Box::set_mb_type( $meta_box ) );1132 WP_Admin_Dir_cmb_Meta_Box::set_object_type( WP_Admin_Dir_cmb_Meta_Box::set_mb_type( $meta_box ) ); 1133 1133 1134 1134 // Save the metabox if it's been submitted … … 1138 1138 // check nonce 1139 1139 isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST['wp_meta_box_nonce'] ) 1140 && wp_verify_nonce( $_POST['wp_meta_box_nonce'], cmb_Meta_Box::nonce() )1140 && wp_verify_nonce( $_POST['wp_meta_box_nonce'], WP_Admin_Dir_cmb_Meta_Box::nonce() ) 1141 1141 && $_POST['object_id'] == $object_id 1142 1142 ) -
wp-admin-directory/trunk/wp-admin-directory.php
r917130 r917226 4 4 * Plugin URI: http://wordpress.org/plugins/buddypress/ 5 5 * Description: Groups togeher menu links in a single page 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Jason Witt 8 8 * Author URI: http://jawittdesigns@gmail.com
Note: See TracChangeset
for help on using the changeset viewer.