当前位置: 首页>>代码示例>>PHP>>正文


PHP do_action_ref_array函数代码示例

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


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

示例1: wp_admin_bar_render

/**
 * Render the admin bar to the page based on the $wp_admin_bar->menu member var.
 * This is called very late on the footer actions so that it will render after anything else being
 * added to the footer.
 *
 * It includes the action "admin_bar_menu" which should be used to hook in and
 * add new menus to the admin bar. That way you can be sure that you are adding at most optimal point,
 * right before the admin bar is rendered. This also gives you access to the $post global, among others.
 *
 * @since 3.1.0
 */
function wp_admin_bar_render()
{
    global $wp_admin_bar;
    if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) {
        return false;
    }
    /**
     * Load all necessary admin bar items.
     *
     * This is the hook used to add, remove, or manipulate admin bar items.
     *
     * @since 3.1.0
     *
     * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference
     */
    do_action_ref_array('admin_bar_menu', array(&$wp_admin_bar));
    /**
     * Fires before the admin bar is rendered.
     *
     * @since 3.1.0
     */
    do_action('wp_before_admin_bar_render');
    $wp_admin_bar->render();
    /**
     * Fires after the admin bar is rendered.
     *
     * @since 3.1.0
     */
    do_action('wp_after_admin_bar_render');
}
开发者ID:ajspencer,项目名称:NCSSM-SG-WordPress,代码行数:41,代码来源:admin-bar.php

示例2: createHandle

 /**
  * Create cURL handle for a HTTP request.
  *
  * @access public
  * @since 2.7.0
  *
  * @param string $url The request URL.
  * @param string|array $args Optional. Override the defaults.
  * @return cURL handle
  */
 public function createHandle($url, $args = array())
 {
     $defaults = array('timeout' => 5, 'headers' => array(), 'body' => null);
     $r = wp_parse_args($args, $defaults);
     $handle = curl_init();
     // cURL offers really easy proxy support.
     $proxy = new WP_HTTP_Proxy();
     if ($proxy->is_enabled() && $proxy->send_through_proxy($url)) {
         curl_setopt($handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
         curl_setopt($handle, CURLOPT_PROXY, $proxy->host());
         curl_setopt($handle, CURLOPT_PROXYPORT, $proxy->port());
         if ($proxy->use_authentication()) {
             curl_setopt($handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
             curl_setopt($handle, CURLOPT_PROXYUSERPWD, $proxy->authentication());
         }
     }
     /*
      * CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since.
      * a value of 0 will allow an unlimited timeout.
      */
     $timeout = (int) ceil($r['timeout']);
     curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, $timeout);
     curl_setopt($handle, CURLOPT_TIMEOUT, $timeout);
     curl_setopt($handle, CURLOPT_URL, $url);
     curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 2);
     curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, true);
     /*
      * The option doesn't work with safe mode or when open_basedir is set, and there's
      * a bug #17490 with redirected POST requests, so handle redirections outside Curl.
      */
     curl_setopt($handle, CURLOPT_FOLLOWLOCATION, false);
     if (defined('CURLOPT_PROTOCOLS')) {
         // PHP 5.2.10 / cURL 7.19.4
         curl_setopt($handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
     }
     curl_setopt($handle, CURLOPT_POST, true);
     curl_setopt($handle, CURLOPT_POSTFIELDS, $r['body']);
     curl_setopt($handle, CURLOPT_HEADER, false);
     // cURL expects full header strings in each element.
     $headers = array();
     foreach ($r['headers'] as $name => $value) {
         $headers[] = "{$name}: {$value}";
     }
     curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
     /**
      * Fires before the cURL request is executed.
      *
      * Cookies are not currently handled by the HTTP API. This action allows
      * plugins to handle cookies themselves.
      *
      * @since 2.8.0
      *
      * @param resource &$handle The cURL handle returned by curl_init().
      * @param array    $r       The HTTP request arguments.
      * @param string   $url     The request URL.
      */
     do_action_ref_array('http_api_curl', array(&$handle, $r, $url));
     return $handle;
 }
开发者ID:mozilla,项目名称:wp-web-push,代码行数:70,代码来源:class-wp-http-curl-multi.php

示例3: __construct

 /**
  * Constructor
  *
  * @global WP_Embed $wp_embed
  */
 public function __construct()
 {
     global $wp_embed;
     // Make sure we populate the WP_Embed handlers array.
     // These are providers that use a regex callback on the URL in question.
     // Do not confuse with oEmbed providers, which require an external ping.
     // Used in WP_Embed::shortcode().
     $this->handlers = $wp_embed->handlers;
     if (bp_use_embed_in_activity()) {
         add_filter('bp_get_activity_content_body', array(&$this, 'autoembed'), 8);
         add_filter('bp_get_activity_content_body', array(&$this, 'run_shortcode'), 7);
     }
     if (bp_use_embed_in_activity_replies()) {
         add_filter('bp_get_activity_content', array(&$this, 'autoembed'), 8);
         add_filter('bp_get_activity_content', array(&$this, 'run_shortcode'), 7);
     }
     if (bp_use_embed_in_forum_posts()) {
         add_filter('bp_get_the_topic_post_content', array(&$this, 'autoembed'), 8);
         add_filter('bp_get_the_topic_post_content', array(&$this, 'run_shortcode'), 7);
     }
     if (bp_use_embed_in_private_messages()) {
         add_filter('bp_get_the_thread_message_content', array(&$this, 'autoembed'), 8);
         add_filter('bp_get_the_thread_message_content', array(&$this, 'run_shortcode'), 7);
     }
     /**
      * Filters the BuddyPress Core oEmbed setup.
      *
      * @since 1.5.0
      *
      * @param BP_Embed $this Current instance of the BP_Embed. Passed by reference.
      */
     do_action_ref_array('bp_core_setup_oembed', array(&$this));
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:38,代码来源:class-bp-embed.php

示例4: bb_syntax_highlight

function bb_syntax_highlight($match)
{
    global $bb_syntax_matches;
    $i = intval($match[1]);
    $match = $bb_syntax_matches[$i];
    $language = strtolower(trim($match[1]));
    $line = trim($match[2]);
    $escaped = trim($match[3]);
    $code = bb_syntax_code_trim($match[4]);
    //if ($escaped == "true") $code = htmlspecialchars_decode($code);
    $code = htmlspecialchars_decode($code);
    //$code = str_replace("&lt;", "<", $code);
    //$code = str_replace("&gt;", ">", $code);
    $geshi = new GeSHi($code, $language);
    $geshi->enable_keyword_links(false);
    do_action_ref_array('bb_syntax_init_geshi', array(&$geshi));
    $output = "\n<div class=\"bb_syntax\">";
    if ($line) {
        $output .= "<table><tr><td class=\"line_numbers\">";
        $output .= bb_syntax_line_numbers($code, $line);
        $output .= "</td><td class=\"code\">";
        $output .= $geshi->parse_code();
        $output .= "</td></tr></table>";
    } else {
        $output .= "<div class=\"code\">";
        $output .= $geshi->parse_code();
        $output .= "</div>";
    }
    $output .= "</div>\n";
    return $output;
}
开发者ID:achorg,项目名称:DH-Answers,代码行数:31,代码来源:bb-syntax.php

示例5: registerRoute

 /**
  * Registers route
  * 
  * @param string $method HTTP method
  * @param string $pattern The path pattern to match
  * @param callback $callback Callback function for route
  * @return \Slim\Route
  */
 public function registerRoute($method, $pattern, $callback)
 {
     $method = strtolower($method);
     $valid_methods = array('get', 'post', 'delete', 'put', 'head', 'options');
     if (!in_array($method, $valid_methods)) {
         return false;
     }
     $match = get_api_base() . trailingslashit('v' . $this->version) . $pattern;
     $app = $this->app;
     return $this->app->{$method}($match, function () use($app, $callback) {
         $args = func_get_args();
         array_unshift($args, $app);
         $res = $app->response();
         $res->header('Access-Control-Allow-Origin', '*');
         if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
             $res->header('Access-Control-Allow-Headers', $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
         }
         if (($json_p = $app->request()->get('callback')) && \Voce\JSONP::is_valid_callback($json_p)) {
             $app->contentType('application/javascript; charset=utf-8;');
             $res->write($json_p . '(');
         } else {
             $app->contentType('application/json; charset=utf-8;');
             $json_p = false;
         }
         $data = call_user_func_array($callback, $args);
         if (!is_null($data)) {
             $json = json_encode($data);
             $res->write($json);
         }
         if ($json_p) {
             $res->write(')');
         }
         do_action_ref_array('thermal_response', array(&$res, &$app, &$data));
     });
 }
开发者ID:katymdc,项目名称:thermal-api,代码行数:43,代码来源:API_Base.php

示例6: import

 public function import($forceResync)
 {
     if (get_option('goodreads_user_id')) {
         if (!class_exists('SimplePie')) {
             require_once ABSPATH . WPINC . '/class-feed.php';
         }
         $rss_source = sprintf(self::$apiurl, get_option('goodreads_user_id'));
         /* Create the SimplePie object */
         $feed = new SimplePie();
         /* Set the URL of the feed you're retrieving */
         $feed->set_feed_url($rss_source);
         /* Tell SimplePie to cache the feed using WordPress' cache class */
         $feed->set_cache_class('WP_Feed_Cache');
         /* Tell SimplePie to use the WordPress class for retrieving feed files */
         $feed->set_file_class('WP_SimplePie_File');
         /* Tell SimplePie how long to cache the feed data in the WordPress database */
         $feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', get_option('reclaim_update_interval'), $rss_source));
         /* Run any other functions or filters that WordPress normally runs on feeds */
         do_action_ref_array('wp_feed_options', array(&$feed, $rss_source));
         /* Initiate the SimplePie instance */
         $feed->init();
         /* Tell SimplePie to send the feed MIME headers */
         $feed->handle_content_type();
         if ($feed->error()) {
             parent::log(sprintf(__('no %s data', 'reclaim'), $this->shortname));
             parent::log($feed->error());
         } else {
             $data = self::map_data($feed);
             parent::insert_posts($data);
             update_option('reclaim_' . $this->shortname . '_last_update', current_time('timestamp'));
         }
     } else {
         parent::log(sprintf(__('%s user data missing. No import was done', 'reclaim'), $this->shortname));
     }
 }
开发者ID:sandeepone,项目名称:reclaim-social-media,代码行数:35,代码来源:goodreads.class.php

示例7: ru_restore_scripts_l10n

function ru_restore_scripts_l10n()
{
    global $wp_scripts;
    if (is_a($wp_scripts, 'WP_Scripts')) {
        do_action_ref_array('wp_default_scripts', array(&$wp_scripts));
    }
}
开发者ID:slaFFik,项目名称:l10n-ru,代码行数:7,代码来源:ru_RU.php

示例8: __construct

 /**
  * Main constructor for Jetpack Comments
  *
  * @since JetpackComments (1.4)
  */
 public function __construct()
 {
     parent::__construct();
     // Jetpack Comments is loaded
     do_action_ref_array('jetpack_comments_loaded', array($this));
     add_action('after_setup_theme', array($this, 'set_default_color_theme_based_on_theme_settings'), 100);
 }
开发者ID:ugurozer,项目名称:little,代码行数:12,代码来源:comments.php

示例9: init

 public static function init()
 {
     // Setup headers
     header('Content-Type: application/json');
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     header("Cache-Control: no-store, no-cache, must-revalidate");
     header("Cache-Control: post-check=0, pre-check=0", false);
     header("Pragma: no-cache");
     // Setup handler
     $handler = new AjaxHandler();
     $handler->registerMethod('items.get', array('LilinaAPI', 'items_get'));
     $handler->registerMethod('items.getList', array('LilinaAPI', 'items_getList'));
     $handler->registerMethod('feeds.get', array('LilinaAPI', 'feeds_get'));
     $handler->registerMethod('feeds.getList', array('LilinaAPI', 'feeds_getList'));
     $handler->registerMethod('update.single', array('LilinaAPI', 'update_single'));
     do_action_ref_array('LilinaAPI-register', array(&$handler));
     // Dispatch
     $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
     try {
         $output = $handler->handle($action, $_REQUEST);
         echo json_encode($output);
     } catch (Exception $e) {
         header('HTTP/1.1 500 Internal Server Error');
         echo json_encode(array('error' => 1, 'msg' => $e->getMessage(), 'code' => $e->getCode()));
     }
 }
开发者ID:JocelynDelalande,项目名称:Lilina,代码行数:27,代码来源:method-api.php

示例10: cf_fields_init

 function cf_fields_init()
 {
     if (!is_blog_installed()) {
         return;
     }
     $this->cf_field_manager->register_field('CF_Field_Input');
     $this->cf_field_manager->register_field('CF_Field_Textarea');
     $this->cf_field_manager->register_field('CF_Field_EditorLight');
     $this->cf_field_manager->register_field('CF_Field_Select');
     $this->cf_field_manager->register_field('CF_Field_SelectMultiple');
     $this->cf_field_manager->register_field('CF_Field_Checkbox');
     $this->cf_field_manager->register_field('CF_Field_Radio');
     $this->cf_field_manager->register_field('CF_Field_DatePicker');
     $this->cf_field_manager->register_field('CF_Field_Dropdown_Users');
     $this->cf_field_manager->register_field('CF_Field_Media');
     $this->cf_field_manager->register_field('CF_Field_Dropdown_Pages');
     if (function_exists('rpt_set_object_relation')) {
         $this->cf_field_manager->register_field('CF_Field_RelationPostType');
     }
     do_action_ref_array('fields_init-' . $this->post_type, array(&$this));
     do_action_ref_array('fields-init', array(&$this->cf_field_manager));
     $this->get_var('sidebars');
     if (isset($this->sidebars) && is_array($this->sidebars)) {
         foreach ($this->sidebars as $sidebar) {
             $sidebar['before_widget'] = '<div class="form-field">';
             $sidebar['after_widget'] = '</div>';
             $sidebar['before_title'] = '<label class="title-field">';
             $sidebar['after_title'] = ' :</label>';
             $this->cf_sidebar->cf_register_sidebar($sidebar);
         }
     }
 }
开发者ID:Makenrro,项目名称:repos,代码行数:32,代码来源:class.admin.posttype.php

示例11: shopp_admin_add_menu

/**
 * Add a menu to the Shopp menu area
 *
 * @api
 * @since 1.3
 *
 * @param string $label	The translated label to use for the menu
 * @param string $page The Shopp-internal menu page name (plugin prefix will be automatically added)
 * @param integer $position The index position of where to add the menu
 * @param mixed $handler The callback handler to use to handle the page
 * @param string $access The access capability required to see the menu
 * @param string $icon The URL for the icon to use for the menu
 * @return integer The position the menu was added
 **/
function shopp_admin_add_menu($label, $page, $position = null, $handler = false, $access = null, $icon = null)
{
    global $menu;
    $AdminPages = ShoppAdminPages();
    if (is_null($position)) {
        $position = 35;
    }
    if (is_null($access)) {
        $access = 'manage_options';
    }
    // Restrictive access by default (for admins only)
    if (false === $handler) {
        $handler = array(Shopp::object()->Flow, 'parse');
    }
    if (!is_callable($handler)) {
        shopp_debug(__FUNCTION__ . " failed: The specified callback handler is not valid.");
        return false;
    }
    while (isset($menu[$position])) {
        $position++;
    }
    $menupage = add_menu_page($label, $label, $access, ShoppAdmin::pagename($page), $handler, $icon, $position);
    $AdminPages->menu($page, $menupage);
    do_action_ref_array("shopp_add_topmenu_{$page}", array($menupage));
    // @deprecated
    do_action_ref_array("shopp_add_menu_{$page}", array($menupage));
    return $position;
}
开发者ID:forthrobot,项目名称:inuvik,代码行数:42,代码来源:admin.php

示例12: receive_callback

 public static function receive_callback()
 {
     self::validate_or_die();
     $metadata = self::get_callback_metadata_or_die();
     do_action_ref_array($metadata[0], $metadata[1]);
     self::set_return_code_and_die(200);
 }
开发者ID:postmatic,项目名称:beta-dist,代码行数:7,代码来源:web-api-handling.php

示例13: motopressCEGetLibrary

function motopressCEGetLibrary()
{
    require_once dirname(__FILE__) . '/../verifyNonce.php';
    require_once dirname(__FILE__) . '/../settings.php';
    require_once dirname(__FILE__) . '/../access.php';
    require_once dirname(__FILE__) . '/../functions.php';
    require_once dirname(__FILE__) . '/Library.php';
    global $motopressCELang;
    global $motopressCESettings;
    $errors = array();
    $motopressCELibrary = new MPCELibrary();
    do_action_ref_array('mp_library', array(&$motopressCELibrary));
    $json = $motopressCELibrary->toJson();
    if ($json) {
        echo $json;
    } else {
        $errors[] = $motopressCELang->CELibraryError;
    }
    if (!empty($errors)) {
        if ($motopressCESettings['debug']) {
            print_r($errors);
        } else {
            motopressCESetError($motopressCELang->CELibraryError);
        }
    }
    exit;
}
开发者ID:umang11,项目名称:glotech,代码行数:27,代码来源:getLibrary.php

示例14: fetch_feed2

 function fetch_feed2($url)
 {
     require_once ABSPATH . WPINC . '/class-feed.php';
     $feed = new SimplePie();
     $feed->set_sanitize_class('WP_SimplePie_Sanitize_KSES');
     // We must manually overwrite $feed->sanitize because SimplePie's
     // constructor sets it before we have a chance to set the sanitization class
     $feed->sanitize = new WP_SimplePie_Sanitize_KSES();
     $feed->set_cache_class('WP_Feed_Cache');
     $feed->set_file_class('WP_SimplePie_File');
     $feed->set_feed_url($url);
     $feed->force_feed(true);
     /** This filter is documented in wp-includes/class-feed.php */
     $feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url));
     /**
      * Fires just before processing the SimplePie feed object.
      *
      * @since 3.0.0
      *
      * @param object &$feed SimplePie feed object, passed by reference.
      * @param mixed  $url   URL of feed to retrieve. If an array of URLs, the feeds are merged.
      */
     do_action_ref_array('wp_feed_options', array(&$feed, $url));
     $feed->init();
     $feed->handle_content_type();
     if ($feed->error()) {
         return new WP_Error('simplepie-error', $feed->error());
     }
     return $feed;
 }
开发者ID:Telemedellin,项目名称:feriadelasfloresmedellin,代码行数:30,代码来源:getFeed.php

示例15: invoke

 public function invoke()
 {
     $this->executing = true;
     do_action_ref_array($this->name, $this->arguments);
     $this->executing = false;
     $this->complete = true;
 }
开发者ID:wells5609,项目名称:wp-app,代码行数:7,代码来源:SubAction.php


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