view = array( 'json' => array(), ); // load json $request = wp_remote_post( 'https://assets.advancedcustomfields.com/add-ons/add-ons.json' ); // validate if( is_wp_error($request) || wp_remote_retrieve_response_code($request) != 200) { acf_add_admin_notice(__('Error. Could not load add-ons list', 'acf'), 'error'); } else { $this->view['json'] = json_decode( $request['body'], true ); } } /* * html * * description * * @type function * @date 7/01/2014 * @since 5.0.0 * * @param $post_id (int) * @return $post_id (int) */ function html() { // load view acf_get_view('settings-addons', $this->view); } } // initialize new acf_settings_addons(); ?>