manager ->get_control($setting->id)->choices; // If the input is a valid key, return it; otherwise, return the default. return (array_key_exists($input, $choices) ? $input : $setting->default); } function decents_blog_sanitize_checkbox($checked) { return ((isset($checked) && true === $checked) ? true : false); } function decents_blog_get_post_view() { $count = get_post_meta( get_the_ID(), 'decents_blog_post_views_count', true ); return "$count"; } function decents_blog_set_post_view() { $key = 'decents_blog_post_views_count'; $post_id = get_the_ID(); $count = (int) get_post_meta( $post_id, $key, true ); $count++; update_post_meta( $post_id, $key, $count ); }