'POST', 'body' => array( 'client_name' => 'WPGancio', 'redirect_uris' => esc_html($redirect_uri), 'scopes' => 'event:write', 'website' => 'https://gancio.org' ) )); if ( is_wp_error( $response ) ) { add_settings_error('wpgancio_messages', 'wpgancio_messages', $response->get_error_message()); } else { $data = json_decode( wp_remote_retrieve_body($response), true); update_option('wpgancio_client_secret', $data['client_secret']); update_option('wpgancio_client_id', $data['client_id']); return $instance_url; } } function wpgancio_options_page() { // add top level menu page add_options_page( 'Gancio', 'Gancio', 'manage_options', 'wpgancio', 'wpgancio_options_page_html' ); } // instance url field cb // field callbacks can accept an $args parameter, which is an array. // $args is defined at the add_settings_field() function. // wordpress has magic interaction with the following keys: label_for, class. // the "label_for" key value is used for the "for" attribute of the