Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form>
- <select name="font_id">
- <?php
- $url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyD6j7CsUTblh29PAXN3NqxBjnN-5nuuFGU';
- $response = wp_remote_get( 'http://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyD6j7CsUTblh29PAXN3NqxBjnN-5nuuFGU', array( 'sslverify' => true ) );
- $response = wp_remote_retrieve_body( wp_remote_get($url, array('sslverify' => false )));
- if( is_wp_error( $response ) ) {
- echo 'Something went wrong!';
- } else {
- $json_a = json_decode($response, true);
- $items = $json_a['items'];
- $i = 0;
- foreach ($items as $item) {
- $i++;
- $str = $item['family'];
- ?>
- <option value="<?php echo $str; ?>"><?php echo $str; ?></option>;
- <?php } } ?>
- </select>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement