Changeset 1525061
- Timestamp:
- 10/31/2016 02:48:05 AM (9 years ago)
- Location:
- advanced-custom-post-types
- Files:
-
- 25 added
- 6 edited
-
tags/0.5.0 (added)
-
tags/0.5.0/acpt.php (added)
-
tags/0.5.0/admin (added)
-
tags/0.5.0/admin/assets (added)
-
tags/0.5.0/admin/assets/index.php (added)
-
tags/0.5.0/admin/assets/pluralize.js (added)
-
tags/0.5.0/admin/assets/script.js (added)
-
tags/0.5.0/admin/assets/select2.min.css (added)
-
tags/0.5.0/admin/assets/select2.min.js (added)
-
tags/0.5.0/admin/assets/style.css (added)
-
tags/0.5.0/admin/class-dashicons.php (added)
-
tags/0.5.0/admin/class-fields.php (added)
-
tags/0.5.0/admin/class-load.php (added)
-
tags/0.5.0/admin/class-meta-boxes.php (added)
-
tags/0.5.0/admin/class-notices.php (added)
-
tags/0.5.0/admin/class-post-type.php (added)
-
tags/0.5.0/admin/dashicons.json (added)
-
tags/0.5.0/admin/fields.json (added)
-
tags/0.5.0/admin/index.php (added)
-
tags/0.5.0/class-debug.php (added)
-
tags/0.5.0/class-load-base.php (added)
-
tags/0.5.0/class-load-main.php (added)
-
tags/0.5.0/class-settings.php (added)
-
tags/0.5.0/index.php (added)
-
tags/0.5.0/readme.txt (added)
-
trunk/acpt.php (modified) (1 diff)
-
trunk/admin/class-load.php (modified) (2 diffs)
-
trunk/admin/class-meta-boxes.php (modified) (5 diffs)
-
trunk/admin/class-notices.php (modified) (2 diffs)
-
trunk/admin/class-post-type.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
advanced-custom-post-types/trunk/acpt.php
r1523580 r1525061 3 3 Plugin Name: Advanced Custom Post Types 4 4 Description: Customise WordPress with custom post types 5 Version: 0. 4.55 Version: 0.5.0 6 6 Author: iambriansreed 7 7 Author URI: http://iambrian.com/ -
advanced-custom-post-types/trunk/admin/class-load.php
r1523580 r1525061 3 3 namespace Advanced_Custom_Post_Types\Admin { 4 4 5 use Advanced_Custom_Post_Types\Debug;6 5 use Advanced_Custom_Post_Types\Load_Main; 7 6 use Advanced_Custom_Post_Types\Load_Base; … … 93 92 } 94 93 95 Notices:: set( false);94 Notices::remove_all(); 96 95 } 97 96 } -
advanced-custom-post-types/trunk/admin/class-meta-boxes.php
r1523578 r1525061 2 2 3 3 namespace Advanced_Custom_Post_Types\Admin; 4 5 use Advanced_Custom_Post_Types\Debug;6 4 7 5 class Meta_Boxes { … … 13 11 public function __construct( Fields $fields ) { 14 12 13 global $post; 14 15 15 $this->fields = $fields; 16 16 17 17 $this->plugin_dir_url = plugin_dir_url( __FILE__ ); 18 19 $this->set_field_values( $post ); 18 20 19 21 foreach ( $fields->groups() as $name => $field_group ) { … … 46 48 } 47 49 48 /** 49 * @param $hook 50 */ 51 public function admin_enqueue_scripts( $hook ) { 50 public function admin_enqueue_scripts() { 52 51 53 52 wp_dequeue_style( 'select2' ); … … 203 202 public function set_field_values( $post ) { 204 203 205 global $pagenow;206 207 204 if ( $this->field_values ) { 208 205 return; 209 206 } 210 207 211 if ( 'post-new.php' === $pagenow ) { 212 $this->field_values = $this->fields->defaults(); 213 } else { 214 $post_type_data = json_decode( $post->post_content, true ); 208 $this->field_values = $this->fields->defaults(); 209 210 $post_type_data = $post->post_content ? json_decode( $post->post_content, true ) : false; 211 212 if ( $post_type_data && is_array( $post_type_data ) && 213 isset( $post_type_data['args'] ) && is_array( $post_type_data['args'] ) 214 ) { 215 215 foreach ( $post_type_data['args'] as $name => $value ) { 216 216 $this->field_values[ 'acpt_' . $name ] = $value; 217 217 } 218 } else { 219 220 Notices::add_warning( 'There was an error loading your Custom Post Type.' ); 218 221 } 219 222 } … … 225 228 226 229 /** 227 * @param $post228 230 * @param $field 229 231 * -
advanced-custom-post-types/trunk/admin/class-notices.php
r1506712 r1525061 6 6 7 7 /** 8 * add an error notice to users notices 9 * 10 * @param $message 11 * @param bool $is_dismissible 12 */ 13 public static function add_error( $message, $is_dismissible = true ) { 14 self::add( $message, 'error', $is_dismissible ); 15 } 16 17 /** 18 * add a warning notice to users notices 19 * 20 * @param $message 21 * @param bool $is_dismissible 22 */ 23 public static function add_warning( $message, $is_dismissible = true ) { 24 self::add( $message, 'warning', $is_dismissible ); 25 } 26 27 /** 28 * add an success notice to users notices 29 * 30 * @param $message 31 * @param bool $is_dismissible 32 */ 33 public static function add_success( $message, $is_dismissible = true ) { 34 self::add( $message, 'success', $is_dismissible ); 35 } 36 37 /** 38 * add an info notice to users notices 39 * 40 * @param $message 41 * @param bool $is_dismissible 42 */ 43 public static function add_info( $message, $is_dismissible = true ) { 44 self::add( $message, 'info', $is_dismissible ); 45 } 46 47 /** 8 48 * add a notice to users notices 9 49 * 10 50 * @param $message 11 * @param string $type 51 * @param string $type (error, warning, success, or info) 12 52 * @param bool $is_dismissible 13 53 */ 14 p ublicstatic function add( $message, $type = 'info', $is_dismissible = true ) {54 private static function add( $message, $type = 'info', $is_dismissible = true ) { 15 55 16 56 $notices = self::get_all(); … … 41 81 42 82 /** 83 * clear all users notices 84 */ 85 public static function remove_all() { 86 87 self::set( false ); 88 } 89 90 /** 43 91 * save notices 44 92 * 45 93 * @param $notices 46 94 */ 47 p ublicstatic function set( $notices ) {95 private static function set( $notices ) { 48 96 49 97 if ( $notices === false ) { -
advanced-custom-post-types/trunk/admin/class-post-type.php
r1523580 r1525061 3 3 namespace Advanced_Custom_Post_Types\Admin; 4 4 5 use Advanced_Custom_Post_Types\Debug;6 5 use Advanced_Custom_Post_Types\Load_Main; 7 6 use Advanced_Custom_Post_Types\Settings; … … 28 27 public function save( $post ) { 29 28 30 $existing_post = get_post( $post->ID );31 32 29 // get fields and pre process the data 33 30 if ( ! isset( $_POST ) || ! is_array( $_POST ) ) { … … 49 46 50 47 if ( count( $this->errors ) ) { 51 Notices::add ( implode( '<br>', $this->errors ), 'error', false );48 Notices::add_error( implode( '<br>', $this->errors ), false ); 52 49 } 53 50 … … 113 110 * @param $post_id 114 111 * 115 * @return array116 112 */ 117 113 private function set_field_values( $post_id ) { … … 176 172 /** 177 173 * creates the register_post_type arguments from the acpt fields values 178 *179 * @param $this ->field_values180 174 * 181 175 * @return array -
advanced-custom-post-types/trunk/readme.txt
r1523585 r1525061 67 67 = 0.4.5 = 68 68 * Fixes At a Glance dashboard issues 69 70 = 0.5.0 = 71 * Fixes SVN merge issues, notices updates, adds warning for legacy post type data 72
Note: See TracChangeset
for help on using the changeset viewer.