You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
Scenario:
Add custom field with type = "color"
Expected:
The field is rendered on the backend and whenever new color is selected the input box value will be updated.
Current Behavior:
The color is selected but the input value remains blank.
File: includes/lib/class-{custom-post}-admin-api.php
Function: display_field()
Section: Get saved data
Fixes plus code enhancements - should replace current lines of 35 to 66:
// Get saved data
$option_name .= $field['id'];
($post) ? $option = get_post_meta( $post->ID, $field['id'], true ) : $option = get_option( $option_name );
if ( isset( $option ) && $option != '' ) {
$data = $option;
} else if(isset($field['default'])){
$data = $field['default'];
} else {
$data = '';
}
The text was updated successfully, but these errors were encountered:
Scenario:
Add custom field with type = "color"
Expected:
The field is rendered on the backend and whenever new color is selected the input box value will be updated.
Current Behavior:
The color is selected but the input value remains blank.
File: includes/lib/class-{custom-post}-admin-api.php
Function: display_field()
Section: Get saved data
Fixes plus code enhancements - should replace current lines of 35 to 66:
// Get saved data
$option_name .= $field['id'];
($post) ? $option = get_post_meta( $post->ID, $field['id'], true ) : $option = get_option( $option_name );
if ( isset( $option ) && $option != '' ) {
$data = $option;
} else if(isset($field['default'])){
$data = $field['default'];
} else {
$data = '';
}
The text was updated successfully, but these errors were encountered: