• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_remote_fopen函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_remote_fopen函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_remote_fopen函数的具体用法?PHP wp_remote_fopen怎么用?PHP wp_remote_fopen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wp_remote_fopen函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: check_for_update

/**
 * Functionality to hook in the WordPress theme updater. Included in 
 * PressWork but only really needed for child themes.
 *
 * @since PressWork 1.0
 */
function check_for_update()
{
    $contents = wp_remote_fopen('http://themes.bavotasan.com/?themeversion=wpt-' . THEME_CODE);
    if (version_compare($contents, THEME_VERSION, '>')) {
        return $contents;
    }
}
开发者ID:Runemester,项目名称:PressWork,代码行数:13,代码来源:theme-updater.php


示例2: in_plugin_update_message

 function in_plugin_update_message($plugin_data, $r)
 {
     // vars
     $version = apply_filters('acf/get_info', 'version');
     $readme = wp_remote_fopen('http://plugins.svn.wordpress.org/advanced-custom-fields/trunk/readme.txt');
     $regexp = '/== Changelog ==(.*)= ' . $version . ' =/sm';
     $o = '';
     // validate
     if (!$readme) {
         return;
     }
     // regexp
     preg_match($regexp, $readme, $matches);
     if (!isset($matches[1])) {
         return;
     }
     // render changelog
     $changelog = explode('*', $matches[1]);
     array_shift($changelog);
     if (!empty($changelog)) {
         $o .= '<div class="acf-plugin-update-info">';
         $o .= '<h3>' . __("What's new", 'acf') . '</h3>';
         $o .= '<ul>';
         foreach ($changelog as $item) {
             $item = explode('http', $item);
             $o .= '<li>' . $item[0];
             if (isset($item[1])) {
                 $o .= '<a href="http' . $item[1] . '" target="_blank">' . __("credits", 'acf') . '</a>';
             }
             $o .= '</li>';
         }
         $o .= '</ul></div>';
     }
     echo $o;
 }
开发者ID:benjaminug,项目名称:Mini-Maker-Faire-WordPress-Theme,代码行数:35,代码来源:upgrade.php


示例3: woo_vm_status_widget

 function woo_vm_status_widget()
 {
     $vl_plugins = array();
     if ($check = wp_remote_fopen('http://www.visser.com.au/?woo_vm_data')) {
         $raw_plugins = explode('<br />', $check);
         foreach ($raw_plugins as $raw_plugin) {
             $raw_plugin = explode('@', $raw_plugin);
             $vl_plugins[] = array('name' => $raw_plugin[1], 'version' => $raw_plugin[3], 'url' => $raw_plugin[5]);
         }
     }
     if ($wp_plugins = get_plugins()) {
         foreach ($wp_plugins as $wp_plugin) {
             if ($wp_plugin['Author'] == 'Visser Labs') {
                 if ($vl_plugins) {
                     $size = count($vl_plugins);
                     for ($i = 0; $i < $size; $i++) {
                         if ($vl_plugins[$i]['name'] == $wp_plugin['Name']) {
                             $vl_plugins[$i]['name'] = str_replace('WooCommerce - ', '', $vl_plugins[$i]['name']);
                             $vl_plugins[$i]['installed'] = true;
                             if (version_compare(strval($vl_plugins[$i]['version']), strval($wp_plugin['Version']), '>') == 1) {
                                 $wp_plugins_update = true;
                                 $vl_plugins[$i]['version_existing'] = $wp_plugin['Version'];
                             }
                             if (strval($wp_plugin['Version']) > strval($vl_plugins[$i]['version'])) {
                                 $vl_plugins[$i]['version_beta'] = $wp_plugin['Version'];
                             }
                         }
                     }
                 }
             }
         }
     }
     include_once WOO_CD_PATH . 'templates/admin/woocommerce-admin_dashboard_vm-plugins.php';
 }
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:34,代码来源:common-dashboard_widgets.php


示例4: widget

    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
        $username = $instance['username'];
        $limit = $instance['number'];
        $link = $instance['link'];
        echo $before_widget;
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        $feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=" . $limit;
        $twitterFeed = wp_remote_fopen($feed);
        $this->pw_parse_feed($twitterFeed);
        ?>
	    <p class="clear"><a href="http://twitter.com/<?php 
        echo $username;
        ?>
"><?php 
        echo $link;
        ?>
</a></p>
	  	<?php 
        echo $after_widget;
    }
开发者ID:Runemester,项目名称:PressWork,代码行数:25,代码来源:widget-twitter.php


示例5: in_plugin_update_message

 function in_plugin_update_message($plugin_data, $r)
 {
     // vars
     $readme = wp_remote_fopen(str_replace('/info/', '/trunk/readme.txt', $this->settings['remote']));
     $regexp = '/== Changelog ==(.*)= ' . $this->get_version() . ' =/sm';
     $o = '';
     // validate
     if (!$readme) {
         return;
     }
     // regexp
     preg_match($regexp, $readme, $matches);
     if (!isset($matches[1])) {
         return;
     }
     // add style
     $o .= '<style type="text/css">';
     $o .= '#advanced-custom-fields-options-page + .plugin-update-tr .update-message { background: #EAF2FA; border: #C7D7E2 solid 1px; padding: 10px; }';
     $o .= '</style>';
     // render changelog
     $changelog = explode('*', $matches[1]);
     array_shift($changelog);
     if (!empty($changelog)) {
         $o .= '<div class="acf-plugin-update-info">';
         $o .= '<h3>' . __("What's new", 'acf') . '</h3>';
         $o .= '<ul>';
         foreach ($changelog as $item) {
             $o .= '<li>' . make_clickable($item) . '</li>';
         }
         $o .= '</ul></div>';
     }
     echo $o;
 }
开发者ID:adhitiadarmawan,项目名称:rsa,代码行数:33,代码来源:acf-options-page-update.php


示例6: image_to_base64

function image_to_base64($image_url)
{
    $type = pathinfo($image_url, PATHINFO_EXTENSION);
    $data = wp_remote_fopen($image_url);
    $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
    return $base64;
}
开发者ID:kanei,项目名称:vantuch.cz,代码行数:7,代码来源:functions.php


示例7: create_data

 function create_data()
 {
     $svg_file = find_file($this->paths['tempdir'], '.svg');
     $return = array();
     if (empty($svg_file)) {
         zn_delete_folder($this->paths['tempdir']);
         $return['message'] = 'The zip did not contained any svg files.';
     }
     $file_data = wp_remote_fopen(trailingslashit($this->paths['tempurl']) . $svg_file);
     if (!is_wp_error($file_data) && !empty($file_data)) {
         $xml = simplexml_load_string($file_data);
         $font_attr = $xml->defs->font->attributes();
         $this->font_name = (string) $font_attr['id'];
         $icon_list = array();
         $glyphs = $xml->defs->font->children();
         $class = '';
         foreach ($glyphs as $item => $glyph) {
             if ($item == 'glyph') {
                 $attributes = $glyph->attributes();
                 $unicode = (string) $attributes['unicode'];
                 $d = (string) $attributes['d'];
                 if ($class != 'hidden' && !empty($d)) {
                     $unicode_key = trim(json_encode($unicode), '\\\\"');
                     if ($item == 'glyph' && !empty($unicode_key) && trim($unicode_key) != '') {
                         $icon_list[$this->font_name][$unicode_key] = $unicode_key;
                     }
                 }
             }
         }
         if (!empty($icon_list) && !empty($this->font_name)) {
             $icon_list_file = fopen($this->paths['tempdir'] . '/icon_list.php', 'w');
             if ($icon_list_file) {
                 fwrite($icon_list_file, '<?php $icons = array();');
                 foreach ($icon_list[$this->font_name] as $unicode) {
                     if (!empty($unicode)) {
                         $delimiter = "'";
                         if (strpos($unicode, "'") !== false) {
                             $delimiter = '"';
                         }
                         fwrite($icon_list_file, "\r\n" . '$icons[\'' . $this->font_name . '\'][' . $delimiter . $unicode . $delimiter . '] = ' . $delimiter . $unicode . $delimiter . ';');
                     }
                 }
                 fclose($icon_list_file);
             } else {
                 zn_delete_folder($this->paths['tempdir']);
                 $return['message'] = 'There was a problem creating the icon list file';
                 return;
             }
             // RENAME ALL FILES SO WE CAN LOAD THEM BY FONT NAME
             $this->rename_files();
             // RENAME THE FOLDER WITH THE FONT NAME
             $this->rename_folder();
             // ADD FONT DATA TO FONT OPTION
             $this->add_font_data();
         }
     } else {
         $return['message'] = 'The svg file could not be opened.';
     }
     return $return;
 }
开发者ID:fjbeteiligung,项目名称:development,代码行数:60,代码来源:class-icon-manager.php


示例8: rssmi_plugin_update_info

function rssmi_plugin_update_info()
{
    if (rssmi_remoteFileExists("http://www.allenweiss.com/a/plugin-updates.txt") === True) {
        $info = wp_remote_fopen("http://www.allenweiss.com/a/plugin-updates.txt");
        echo '<br />' . strip_tags($info, "<br><a><b><i><span>");
    }
}
开发者ID:adams0917,项目名称:woocommerce_eht,代码行数:7,代码来源:wp-rss-multi-importer.php


示例9: process_before

 function process_before($code, $target)
 {
     // Determine what we are passing to:  local URL, remote URL, file
     if (substr($target, 0, 7) == 'http://' || substr($target, 0, 8) == 'https://') {
         echo @wp_remote_fopen($target);
     } else {
         if (substr($target, 0, 7) == 'file://') {
             $parts = explode('?', substr($target, 7));
             if (count($parts) > 1) {
                 // Put parameters into the environment
                 $args = explode('&', $parts[1]);
                 if (count($args) > 0) {
                     foreach ($args as $arg) {
                         $tmp = explode('=', $arg);
                         if (count($tmp) == 1) {
                             $_GET[$arg] = '';
                         } else {
                             $_GET[$tmp[0]] = $tmp[1];
                         }
                     }
                 }
             }
             include $parts[0];
             exit;
         } else {
             $_SERVER['REQUEST_URI'] = $target;
             if (strpos($target, '?')) {
                 $_SERVER['QUERY_STRING'] = substr($target, strpos($target, '?') + 1);
                 parse_str($_SERVER['QUERY_STRING'], $_GET);
             }
         }
     }
     return true;
 }
开发者ID:gigikiri,项目名称:bcnAutoWallpaperSite,代码行数:34,代码来源:pass.php


示例10: __construct

 public function __construct($manifest_path)
 {
     if (file_exists($manifest_path)) {
         $this->manifest = json_decode(wp_remote_fopen($manifest_path), true);
     } else {
         $this->manifest = array();
     }
 }
开发者ID:chowy1026,项目名称:jenny,代码行数:8,代码来源:assets.php


示例11: request

function request($api_key)
{
    $url = "http://www.123contactform.com/wp_dispatcher.php";
    $res = wp_remote_fopen("{$url}?api_key=" . $api_key);
    if ($res === false) {
        return false;
    }
    return json_decode($res);
}
开发者ID:shaun785,项目名称:123contactform-for-wordpress,代码行数:9,代码来源:dialog.php


示例12: dw_get_gfonts

 function dw_get_gfonts()
 {
     $fontsSeraliazed = wp_remote_fopen(get_template_directory_uri() . '/inc/font/gfonts_v2.txt');
     $fontArray = unserialize(trim($fontsSeraliazed));
     if (!empty($fontArray)) {
         return $fontArray->items;
     }
     return array();
 }
开发者ID:Glasgow2015,项目名称:team-6,代码行数:9,代码来源:theme-customization.php


示例13: get_remote_version

function get_remote_version($name)
{
    $checkfile = 'http://trac.landryonline.com/trac.fcgi/export/head/' . $name . '/trunk/check.chk';
    $status = array();
    $vcheck = wp_remote_fopen($checkfile);
    if ($vcheck) {
        $status = explode('@', $vcheck);
        return $status;
    }
}
开发者ID:roblandry,项目名称:check-my-version,代码行数:10,代码来源:inc.php


示例14: _vmidag_get_games_data

/**
 * Helper function to fetch games data from vmidag.se.
 */
function _vmidag_get_games_data()
{
    $data = wp_cache_get('games.json', 'vmidag');
    if (empty($data)) {
        $contents = wp_remote_fopen('http://www.vmidag.se/games.json');
        $data = json_decode($contents);
        wp_cache_set('games.json', $data, 'vmidag');
    }
    return $data;
}
开发者ID:kollegorna,项目名称:vmidag-wp-widget,代码行数:13,代码来源:vmidag.php


示例15: skype_status_check

function skype_status_check($skypeid=false, $format=".txt") {
	if (!$skypeid) return 'error';
 
	$tmp = wp_remote_fopen('http://mystatus.skype.com/'.$skypeid.$format);
	if (!$tmp) return 'error';
	else $contents = str_replace("\n", "", $tmp);

        if ($contents!="") return $contents;
        else return 'error';
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:10,代码来源:skype-functions.php


示例16: output

 public function output()
 {
     echo $this->element_before();
     $defaults_value = array('family' => 'Arial', 'variant' => 'regular', 'font' => 'websafe');
     $default_variants = apply_filters('zels_websafe_fonts_variants', array('regular', 'italic', '700', '700italic', 'inherit'));
     $websafe_fonts = apply_filters('zels_websafe_fonts', array('Arial', 'Arial Black', 'Comic Sans MS', 'Impact', 'Lucida Sans Unicode', 'Tahoma', 'Trebuchet MS', 'Verdana', 'Courier New', 'Lucida Console', 'Georgia, serif', 'Palatino Linotype', 'Times New Roman'));
     $value = wp_parse_args($this->element_value(), $defaults_value);
     $family_value = $value['family'];
     $variant_value = $value['variant'];
     $is_variant = isset($this->field['variant']) && $this->field['variant'] === false ? false : true;
     $is_chosen = isset($this->field['chosen']) && $this->field['chosen'] === false ? '' : 'chosen ';
     $google_json = json_decode(wp_remote_fopen(ZELS_URI . '/fields/typography/google-fonts.json'));
     $chosen_rtl = is_rtl() && !empty($is_chosen) ? 'chosen-rtl ' : '';
     if (!empty($google_json)) {
         $googlefonts = array();
         foreach ($google_json->items as $key => $font) {
             $googlefonts[$font->family] = $font->variants;
         }
         $is_google = array_key_exists($family_value, $googlefonts) ? true : false;
         echo '<label class="zels-typography-family">';
         echo '<select name="' . $this->element_name('[family]') . '" class="' . $is_chosen . $chosen_rtl . 'zels-typo-family" data-atts="family"' . $this->element_attributes() . '>';
         do_action('zels_typography_family', $family_value, $this);
         echo '<optgroup label="' . __('Web Safe Fonts', ZELS_TEXTDOMAIN) . '">';
         foreach ($websafe_fonts as $websafe_value) {
             echo '<option value="' . $websafe_value . '" data-variants="' . implode('|', $default_variants) . '" data-type="websafe"' . selected($websafe_value, $family_value, true) . '>' . $websafe_value . '</option>';
         }
         echo '</optgroup>';
         echo '<optgroup label="' . __('Google Fonts', ZELS_TEXTDOMAIN) . '">';
         foreach ($googlefonts as $google_key => $google_value) {
             echo '<option value="' . $google_key . '" data-variants="' . implode('|', $google_value) . '" data-type="google"' . selected($google_key, $family_value, true) . '>' . $google_key . '</option>';
         }
         echo '</optgroup>';
         echo '</select>';
         echo '</label>';
         if (!empty($is_variant)) {
             $variants = $is_google ? $googlefonts[$family_value] : $default_variants;
             $variants = $value['font'] === 'google' || $value['font'] === 'websafe' ? $variants : array('regular');
             echo '<label class="zels-typography-variant">';
             echo '<select name="' . $this->element_name('[variant]') . '" class="' . $is_chosen . $chosen_rtl . 'zels-typo-variant" data-atts="variant">';
             foreach ($variants as $variant) {
                 echo '<option value="' . $variant . '"' . $this->checked($variant_value, $variant, 'selected') . '>' . $variant . '</option>';
             }
             echo '</select>';
             echo '</label>';
         }
         echo '<input type="text" name="' . $this->element_name('[font]') . '" class="zels-typo-font hidden" data-atts="font" value="' . $value['font'] . '" />';
     } else {
         _e('Error! Can not load json file.', ZELS_TEXTDOMAIN);
     }
     echo $this->element_after();
 }
开发者ID:Mortek,项目名称:one-pager,代码行数:51,代码来源:typography.php


示例17: getTwitFeedburnCount

 function getTwitFeedburnCount($username, $type)
 {
     if ($type == "feedburner") {
         $option_name = 'gazpo_feedburner_counter';
     } elseif ($type == "twitter") {
         $option_name = 'gazpo_twitter_counter';
     }
     $current_time = time();
     $last_update_time = get_option("gazpo_social_counter_update_time");
     if (empty($last_update_time)) {
         $timestamp = strtotime('31-12-2011');
         //set an old time.
         update_option('gazpo_social_counter_update_time', $timestamp);
     }
     $difference = ($current_time - $last_update_time) / 86400;
     if ($difference >= 4) {
         // if difference is 4 days or more
         if ($type == "feedburner") {
             $feedburner_count = 0;
             //set initial value
             $date = date('Y-m-d', strtotime('-4 days'));
             //average subscribers in last 4 days
             $data = wp_remote_fopen("http://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=" . $username . "&dates=" . $date . "," . $date);
             if ($data) {
                 preg_match('/circulation=\\"([0-9]+)\\"/', $data, $match);
                 if ($match[1] != 0) {
                     $feedburner_count = $match[1];
                 }
             }
             $total = $feedburner_count;
             //return subscribers count
         } elseif ($type == "twitter") {
             $twitter_count = 0;
             //set initial value
             $data = wp_remote_fopen('http://twitter.com/users/show/' . $username);
             preg_match('/followers_count>(.*)</', $data, $match);
             if ($match[1] != 0) {
                 $twitter_count = $match[1];
             }
             $total = $twitter_count;
             //return followers count
         }
         if ($total > 0) {
             update_option($option_name, $total);
         }
         return strval($total);
     } else {
         $total = get_option($option_name);
         return strval($total);
     }
 }
开发者ID:jimdough,项目名称:Roadmaster,代码行数:51,代码来源:widget_subscriber_counter.php


示例18: zels_get_icons

 function zels_get_icons()
 {
     $jsons = glob(ZELS_DIR . '/fields/icon/*.json');
     if (!empty($jsons)) {
         foreach ($jsons as $path) {
             $object = json_decode(wp_remote_fopen(ZELS_URI . '/fields/icon/' . basename($path)));
             echo count($jsons) >= 2 ? '<h4 class="zels-icon-title">' . $object->name . '</h4>' : '';
             foreach ($object->icons as $icon) {
                 echo '<a class="zels-icon-tooltip" data-icon="' . $icon . '" data-title="' . $icon . '"><span class="zels-icon zels-selector"><i class="' . $icon . '"></i></span></a>';
             }
         }
     }
     do_action('zels_add_icons');
     die;
 }
开发者ID:Mortek,项目名称:one-pager,代码行数:15,代码来源:actions.php


示例19: shortCode

 /**
  * CSV ShortCode
  *
  * @uses function shortcode_atts
  * @uses function wp_remote_fopen
  *
  * @param  array  $atts User-defined shortcode attributes.
  * @return string       HTML for rendered table, or blank string if no data.
  */
 function shortCode($atts)
 {
     $defaults = array('src' => null, 'id' => '');
     $atts = shortcode_atts($defaults, $atts);
     // Enqueue plugin JavaScript & CSS only on pages where shortcode is used.
     $this->loadJsCssLibs();
     // Determine .csv file source based on 'src' and 'source' attributes; default to test.csv URL.
     $src = $this->getCsvSource($atts);
     // Get contents of .CSV file as string.
     $file = wp_remote_fopen($src);
     // Parse CSV string into a multidimensional array.
     $rows = $this->parseCsv($file);
     // Render table and return HTML string.
     return $this->getRenderTable($rows, $atts);
 }
开发者ID:anjanasilva,项目名称:AJ-CSV-to-DataTable,代码行数:24,代码来源:main_class.php


示例20: enter_license

function enter_license()
{
    global $licensing_server;
    if (isset($_POST["license_key"])) {
        ${${"GLOBALS"}["yhdawfobcwh"]} = trailingslashit(${${"GLOBALS"}["kegsmhrnrn"]}) . "?remote_key_auth=" . base64_encode($_POST["license_key"]) . "&remote_site=" . base64_encode(trailingslashit(site_url()));
        $cgoolndww = "licensing_string";
        if (wp_remote_fopen(${$cgoolndww}) == 1) {
            update_option("license_key", $_POST["license_key"]);
            echo "Activated!";
            echo "<script>document.location='/';</script>";
        } else {
            echo "<p>Sorry the license key you entered is invalid. Please try again or contact us for help at [email protected]</p>";
        }
    }
    if (!check_key()) {
        echo "<form method=\"post\">\n Enter license key: <input type=\"text\" name=\"license_key\" /> <input type=\"submit\" name=\"validate_license_key\" value=\"Activate\" />\n </form>\n <br /> <font color=\"red\"><b>Where is my key?:</b></font> <font color=\"green\">Your license key has been sent to your registered email address or you can get the license key from <a style=\"color:blue\" href=\"http://magazine3.com/license-key\" target=\"_blank\">Magazine3.com/license-key</a></font> <br />\n <font color=\"#111\">If for some reason key is not working, Send us an email on [email protected] </font><br />  ";
    }
}
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:18,代码来源:mm.php



注:本文中的wp_remote_fopen函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_remote_get函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_related_posts函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap