diff --git a/acf.php b/acf.php index 9d2ed11..25ffdab 100644 --- a/acf.php +++ b/acf.php @@ -3,7 +3,7 @@ Plugin Name: Advanced Custom Fields PRO Plugin URI: https://www.advancedcustomfields.com/ Description: Customise WordPress with powerful, professional and intuitive fields -Version: 5.4.8 +Version: 5.5.2 Author: Elliot Condon Author URI: http://www.elliotcondon.com/ Copyright: Elliot Condon @@ -58,7 +58,7 @@ class acf { // basic 'name' => __('Advanced Custom Fields', 'acf'), - 'version' => '5.4.8', + 'version' => '5.5.2', // urls 'basename' => plugin_basename( __FILE__ ), @@ -83,7 +83,10 @@ class acf { 'google_api_key' => '', 'google_api_client' => '', 'enqueue_google_maps' => true, - 'enqueue_select2' => true, + 'enqueue_select2' => true, + 'enqueue_datepicker' => true, + 'enqueue_datetimepicker' => true, + 'select2_version' => 3 ); @@ -131,11 +134,17 @@ class acf { acf_include('admin/admin.php'); acf_include('admin/field-group.php'); acf_include('admin/field-groups.php'); - acf_include('admin/update.php'); - acf_include('admin/update-network.php'); + acf_include('admin/install.php'); acf_include('admin/settings-tools.php'); - //acf_include('admin/settings-addons.php'); acf_include('admin/settings-info.php'); + + + // network + if( is_network_admin() ) { + + acf_include('admin/install-network.php'); + + } } @@ -214,6 +223,7 @@ class acf { acf_include('fields/password.php'); acf_include('fields/wysiwyg.php'); acf_include('fields/oembed.php'); + //acf_include('fields/output.php'); acf_include('fields/image.php'); acf_include('fields/file.php'); acf_include('fields/select.php'); @@ -350,12 +360,12 @@ class acf { // acf-disabled register_post_status('acf-disabled', array( - 'label' => __( 'Disabled', 'acf' ), + 'label' => __( 'Inactive', 'acf' ), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, - 'label_count' => _n_noop( 'Disabled (%s)', 'Disabled (%s)', 'acf' ), + 'label_count' => _n_noop( 'Inactive (%s)', 'Inactive (%s)', 'acf' ), )); } diff --git a/admin/admin.php b/admin/admin.php index 11c7e1f..b08039a 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -1,7 +1,15 @@ notices[] = array( + 'text' => $text, + 'class' => 'updated ' . $class, + 'wrap' => $wrap + ); + + } + + + /* + * get_notices + * + * This function will return an array of admin notices + * + * @type function + * @date 17/10/13 + * @since 5.0.0 + * + * @param n/a + * @return (array) + */ + + function get_notices() { + + // bail early if no notices + if( empty($this->notices) ) return false; + + + // return + return $this->notices; + + } + + /* * admin_menu * @@ -41,11 +101,7 @@ class acf_admin { function admin_menu() { // bail early if no show_admin - if( !acf_get_setting('show_admin') ) { - - return; - - } + if( !acf_get_setting('show_admin') ) return; // vars @@ -100,18 +156,15 @@ class acf_admin { function admin_notices() { // vars - $admin_notices = acf_get_admin_notices(); + $notices = $this->get_notices(); // bail early if no notices - if( empty($admin_notices) ) { - - return; - - } + if( !$notices ) return; - foreach( $admin_notices as $notice ) { + // loop + foreach( $notices as $notice ) { $open = ''; $close = ''; @@ -133,8 +186,50 @@ class acf_admin { } - // initialize -new acf_admin(); +acf()->admin = new acf_admin(); + +endif; // class_exists check + + +/* +* acf_add_admin_notice +* +* This function will add the notice data to a setting in the acf object for the admin_notices action to use +* +* @type function +* @date 17/10/13 +* @since 5.0.0 +* +* @param $text (string) +* @param $class (string) +* @return (int) message ID (array position) +*/ + +function acf_add_admin_notice( $text, $class = '', $wrap = 'p' ) { + + return acf()->admin->add_notice($text, $class, $wrap); + +} + + +/* +* acf_get_admin_notices +* +* This function will return an array containing any admin notices +* +* @type function +* @date 17/10/13 +* @since 5.0.0 +* +* @param n/a +* @return (array) +*/ + +function acf_get_admin_notices() { + + return acf()->admin->get_notices(); + +} ?> diff --git a/admin/field-group.php b/admin/field-group.php index b4368f8..7bfe15c 100644 --- a/admin/field-group.php +++ b/admin/field-group.php @@ -392,7 +392,7 @@ class acf_admin_field_group { // vars - $status = $field_group['active'] ? __("Active",'acf') : __("Disabled",'acf'); + $status = $field_group['active'] ? __("Active",'acf') : __("Inactive",'acf'); ?>