Skip to content

Instantly share code, notes, and snippets.

View iftekharbhuiyan's full-sized avatar

Iftekhar Bhuiyan iftekharbhuiyan

View GitHub Profile
@iftekharbhuiyan
iftekharbhuiyan / Reading JSON API
Last active July 23, 2017 05:01
Reading JSON API Data using PHP
<?php
// Desired IP address
$ip = '172.217.10.78';
// With Error Reporting: file_get_content();
// Without Error Reporting: @file_get_content();
$content = @file_get_contents('http://freegeoip.net/json/'.$ip);
// Result as an Array: json_decode($var, true);
// Result as an Object: json_decode($var);
$result = json_decode($content, true);
// For Array: $result['key'];
@iftekharbhuiyan
iftekharbhuiyan / functions.php
Created July 23, 2017 01:34
Disable Update Notification on WordPress
/**
* Remove update notification
* Applies to WordPress Core, Plugins, Themes
*/
// disable for core
add_filter('pre_site_transient_update_core','remove_wp_update_notification');
// disable for plugins
add_filter('pre_site_transient_update_plugins','remove_wp_update_notification');