Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Bug fix plus code enhancements, custom field with type = "color" #36

Open
a-fawzy opened this issue Sep 3, 2015 · 0 comments · May be fixed by #92
Open

Bug fix plus code enhancements, custom field with type = "color" #36

a-fawzy opened this issue Sep 3, 2015 · 0 comments · May be fixed by #92

Comments

@a-fawzy
Copy link

a-fawzy commented Sep 3, 2015

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 = '';
}

@carl-alberto carl-alberto linked a pull request May 16, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant