plugin install
This commit is contained in:
@@ -67,7 +67,6 @@ if ( ! class_exists( 'acf_admin_options_page' ) ) :
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function admin_load() {
|
||||
|
||||
// globals
|
||||
@@ -200,7 +199,6 @@ if ( ! class_exists( 'acf_admin_options_page' ) ) :
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function postbox_submitdiv( $post, $args ) {
|
||||
|
||||
/**
|
||||
|
||||
@@ -147,7 +147,7 @@ if ( ! class_exists( 'ACF_Admin_Updates' ) ) :
|
||||
// Check if we should force check the license status.
|
||||
$force_get_license_status = false;
|
||||
$retry_license_nonce = acf_request_arg( 'acf_retry_nonce' );
|
||||
if ( wp_verify_nonce( $retry_license_nonce, 'acf_recheck_status' ) ) {
|
||||
if ( wp_verify_nonce( $retry_license_nonce, 'acf_recheck_status' ) || ! empty( $_GET['force-license-check'] ) ) {
|
||||
$force_get_license_status = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ if ( ! class_exists( 'ACF_Admin_UI_Options_Pages' ) ) :
|
||||
|
||||
// Description.
|
||||
case 'acf-description':
|
||||
if ( ! empty( $post['description'] ) && is_string( $post['description'] ) ) {
|
||||
if ( ! empty( $post['description'] ) && ( is_string( $post['description'] ) || is_numeric( $post['description'] ) ) ) {
|
||||
echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>';
|
||||
} else {
|
||||
echo '<span class="acf-emdash" aria-hidden="true">—</span>';
|
||||
|
||||
@@ -26,18 +26,46 @@ foreach ( acf_get_combined_options_page_settings_tabs() as $tab_key => $tab_labe
|
||||
$acf_dashicon_link
|
||||
);
|
||||
|
||||
// Set the default value for the icon field.
|
||||
$acf_default_icon_value = array(
|
||||
'type' => 'dashicons',
|
||||
'value' => 'dashicons-admin-generic',
|
||||
);
|
||||
|
||||
$acf_icon_value = $acf_default_icon_value;
|
||||
|
||||
// Override the value for backwards compatibility, if it was saved with the key 'icon_url' as a string.
|
||||
if ( ! empty( $acf_ui_options_page['icon_url'] ) ) {
|
||||
if ( strpos( $acf_ui_options_page['icon_url'], 'dashicons-' ) === 0 ) {
|
||||
$acf_icon_value = array(
|
||||
'type' => 'dashicons',
|
||||
'value' => $acf_ui_options_page['icon_url'],
|
||||
);
|
||||
} else {
|
||||
$acf_icon_value = array(
|
||||
'type' => 'url',
|
||||
'value' => $acf_ui_options_page['icon_url'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Override the above value if a 'menu_icon' key exists, and is not empty, which is the new key for storing the icon.
|
||||
if ( ! empty( $acf_ui_options_page['menu_icon'] ) ) {
|
||||
$acf_icon_value = $acf_ui_options_page['menu_icon'];
|
||||
}
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'label' => __( 'Menu Icon', 'acf' ),
|
||||
'type' => 'text',
|
||||
'name' => 'icon_url',
|
||||
'key' => 'icon_url',
|
||||
'class' => 'acf-options-page-menu_icon',
|
||||
'prefix' => 'acf_ui_options_page',
|
||||
'value' => $acf_ui_options_page['icon_url'],
|
||||
'instructions' => $acf_menu_icon_instructions,
|
||||
'placeholder' => 'dashicons-admin-generic',
|
||||
'conditions' => array(
|
||||
'label' => __( 'Menu Icon', 'acf' ),
|
||||
'type' => 'icon_picker',
|
||||
'name' => 'menu_icon',
|
||||
'key' => 'menu_icon',
|
||||
'class' => 'acf-options-page-menu_icon',
|
||||
'prefix' => 'acf_ui_options_page',
|
||||
'required' => false,
|
||||
'value' => $acf_icon_value,
|
||||
'default_value' => $acf_default_icon_value,
|
||||
'conditions' => array(
|
||||
'field' => 'parent_slug',
|
||||
'operator' => '==',
|
||||
'value' => 'none',
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
<?php
|
||||
global $acf_ui_options_page, $acf_parent_page_options;
|
||||
|
||||
$acf_duplicate_options_page = acf_get_ui_options_page_from_request_args( 'acfduplicate' );
|
||||
|
||||
if ( acf_is_ui_options_page( $acf_duplicate_options_page ) ) {
|
||||
// Reset vars that likely have to be changed.
|
||||
$acf_duplicate_options_page['key'] = uniqid( 'ui_options_page_' );
|
||||
$acf_duplicate_options_page['title'] = '';
|
||||
$acf_duplicate_options_page['page_title'] = '';
|
||||
$acf_duplicate_options_page['menu_title'] = '';
|
||||
$acf_duplicate_options_page['menu_slug'] = '';
|
||||
|
||||
// Rest of the vars can be reused.
|
||||
$acf_ui_options_page = $acf_duplicate_options_page;
|
||||
}
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'label' => __( 'Page Title', 'acf' ),
|
||||
|
||||
Reference in New Issue
Block a user