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


PHP SucomUtil::sanitize_hookname方法代码示例

本文整理汇总了PHP中SucomUtil::sanitize_hookname方法的典型用法代码示例。如果您正苦于以下问题:PHP SucomUtil::sanitize_hookname方法的具体用法?PHP SucomUtil::sanitize_hookname怎么用?PHP SucomUtil::sanitize_hookname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SucomUtil的用法示例。


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

示例1: add_plugin_hooks

 protected function add_plugin_hooks($type, &$class, &$hooks, &$prio, &$lca)
 {
     $lca = $lca === '' ? $this->p->cf['lca'] : $lca;
     foreach ($hooks as $name => $num) {
         $hook = $lca . '_' . $name;
         $method = SucomUtil::sanitize_hookname($type . '_' . $name);
         call_user_func('add_' . $type, $hook, array(&$class, $method), $prio, $num);
         if ($this->p->debug->enabled) {
             $this->p->debug->log($type . ' for ' . $hook . ' added', 3);
         }
     }
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:12,代码来源:util.php

示例2: load_meta_page

 public function load_meta_page($screen = false)
 {
     // all meta modules set this property, so use it to optimize code execution
     if (!empty(NgfbMeta::$head_meta_tags) || !isset($screen->id)) {
         return;
     }
     if ($this->p->debug->enabled) {
         $this->p->debug->mark();
         $this->p->debug->log('screen id: ' . $screen->id);
         $this->p->util->log_is_functions();
     }
     $lca = $this->p->cf['lca'];
     switch ($screen->id) {
         case 'upload':
         case strpos($screen->id, 'edit-') === 0 ? true : false:
             // posts list table
             return;
             break;
     }
     // make sure we have at least a post type and post status
     if (($obj = $this->p->util->get_post_object()) === false || empty($obj->post_type) || empty($obj->post_status)) {
         return;
     }
     $post_id = empty($obj->ID) ? 0 : $obj->ID;
     if ($obj->post_status !== 'auto-draft') {
         $post_type = get_post_type_object($obj->post_type);
         $add_metabox = empty($this->p->options['plugin_add_to_' . $post_type->name]) ? false : true;
         if (apply_filters($this->p->cf['lca'] . '_add_metabox_post', $add_metabox, $post_id, $post_type->name) === true) {
             // hook used by woocommerce module to load front-end libraries and start a session
             do_action($this->p->cf['lca'] . '_admin_post_header', $post_id, $post_type->name);
             // read_cache is false to generate notices etc.
             NgfbMeta::$head_meta_tags = $this->p->head->get_header_array($post_id, false);
             NgfbMeta::$head_meta_info = $this->p->head->extract_head_info(NgfbMeta::$head_meta_tags);
             if ($obj->post_status === 'publish') {
                 // check for missing open graph image and issue warning
                 if (empty(NgfbMeta::$head_meta_info['og:image'])) {
                     $this->p->notice->err($this->p->msgs->get('notice-missing-og-image'));
                 }
                 // check duplicates only when the post is available publicly and we have a valid permalink
                 if (!empty($this->p->options['plugin_check_head'])) {
                     $this->check_post_header($post_id, $obj);
                 }
             }
         }
     }
     $action_query = $lca . '-action';
     if (!empty($_GET[$action_query])) {
         $action_name = SucomUtil::sanitize_hookname($_GET[$action_query]);
         if (empty($_GET[NGFB_NONCE])) {
             if ($this->p->debug->enabled) {
                 $this->p->debug->log('nonce token validation query field missing');
             }
         } elseif (!wp_verify_nonce($_GET[NGFB_NONCE], NgfbAdmin::get_nonce())) {
             $this->p->notice->err(__('Nonce token validation failed for action \\"' . $action_name . '\\".', 'nextgen-facebook'));
         } else {
             $_SERVER['REQUEST_URI'] = remove_query_arg(array($action_query, NGFB_NONCE));
             switch ($action_name) {
                 default:
                     do_action($lca . '_load_meta_page_post_' . $action_name, $post_id, $obj);
                     break;
             }
         }
     }
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:64,代码来源:post.php

示例3: get_json_array

 public function get_json_array($use_post, &$obj, &$mt_og, $post_id, $author_id)
 {
     if ($this->p->debug->enabled) {
         $this->p->debug->mark();
     }
     $ret = array();
     foreach (array_unique(array('http://schema.org/WebSite', 'http://schema.org/Person', 'http://schema.org/Organization', $this->get_head_item_type($use_post, $obj))) as $type) {
         $filter_name = $this->p->cf['lca'] . '_json_' . SucomUtil::sanitize_hookname($type);
         if (($json = apply_filters($filter_name, false, $use_post, $obj, $mt_og, $post_id, $author_id)) !== false) {
             $ret[] = "<script type=\"application/ld+json\">\n" . $json . "</script>\n";
         }
     }
     $ret = SucomUtil::a2aa($ret);
     // convert to array or arrays
     if ($this->p->debug->enabled) {
         $this->p->debug->log($ret);
     }
     return $ret;
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:19,代码来源:schema.php

示例4: load_meta_page

 public function load_meta_page()
 {
     // all meta modules set this property, so use it to optimize code execution
     if (!empty(WpssoMeta::$head_meta_tags)) {
         return;
     }
     $screen_id = SucomUtil::get_screen_id();
     if ($this->p->debug->enabled) {
         $this->p->debug->mark();
         $this->p->debug->log('screen_id: ' . $screen_id);
     }
     if ($screen_id !== 'user-edit' && $screen_id !== 'profile') {
         return;
     }
     $user_id = $this->p->util->get_author_object('id');
     $add_metabox = empty($this->p->options['plugin_add_to_user']) ? false : true;
     if (apply_filters($this->p->cf['lca'] . '_add_metabox_user', $add_metabox, $user_id, $screen_id) === true) {
         do_action($this->p->cf['lca'] . '_admin_user_header', $user_id, $screen_id);
         // use_post is false since this isn't a post
         // read_cache is false to generate notices etc.
         WpssoMeta::$head_meta_tags = $this->p->head->get_header_array(false, false);
         WpssoMeta::$head_meta_info = $this->p->head->extract_head_info(WpssoMeta::$head_meta_tags);
         if (empty(WpssoMeta::$head_meta_info['og:image'])) {
             // check for missing open graph image and issue warning
             $this->p->notice->err($this->p->msgs->get('notice-missing-og-image'));
         }
     }
     $lca = $this->p->cf['lca'];
     $action_query = $lca . '-action';
     if (!empty($_GET[$action_query])) {
         $action_name = SucomUtil::sanitize_hookname($_GET[$action_query]);
         if (empty($_GET[WPSSO_NONCE])) {
             if ($this->p->debug->enabled) {
                 $this->p->debug->log('nonce token validation query field missing');
             }
         } elseif (!wp_verify_nonce($_GET[WPSSO_NONCE], WpssoAdmin::get_nonce())) {
             $this->p->notice->err(__('Nonce token validation failed for action \\"' . $action_name . '\\".', 'wpsso'));
         } else {
             $_SERVER['REQUEST_URI'] = remove_query_arg(array($action_query, WPSSO_NONCE));
             switch ($action_name) {
                 default:
                     do_action($lca . '_load_meta_page_user_' . $action_name, $user_id, $screen_id);
                     break;
             }
         }
     }
 }
开发者ID:sonvq,项目名称:passioninvestment,代码行数:47,代码来源:user.php

示例5: load_meta_page

 public function load_meta_page($screen = false)
 {
     // all meta modules set this property, so use it to optimize code execution
     if (!empty(NgfbMeta::$head_meta_tags) || !isset($screen->id)) {
         return;
     }
     if ($this->p->debug->enabled) {
         $this->p->debug->mark();
         $this->p->debug->log('screen id: ' . $screen->id);
     }
     $lca = $this->p->cf['lca'];
     switch ($screen->id) {
         case 'edit-' . $this->tax_slug:
             break;
         default:
             return;
             break;
     }
     $add_metabox = empty($this->p->options['plugin_add_to_taxonomy']) ? false : true;
     if (apply_filters($this->p->cf['lca'] . '_add_metabox_taxonomy', $add_metabox, $this->term_id, $screen->id) === true) {
         do_action($this->p->cf['lca'] . '_admin_taxonomy_header', $this->term_id, $screen->id);
         // use_post is false since this isn't a post
         // read_cache is false to generate notices etc.
         NgfbMeta::$head_meta_tags = $this->p->head->get_header_array(false);
         NgfbMeta::$head_meta_info = $this->p->head->extract_head_info(NgfbMeta::$head_meta_tags);
         if (empty(NgfbMeta::$head_meta_info['og:image'])) {
             // check for missing open graph image and issue warning
             $this->p->notice->err($this->p->msgs->get('notice-missing-og-image'));
         }
     }
     $action_query = $lca . '-action';
     if (!empty($_GET[$action_query])) {
         $action_name = SucomUtil::sanitize_hookname($_GET[$action_query]);
         if (empty($_GET[NGFB_NONCE])) {
             if ($this->p->debug->enabled) {
                 $this->p->debug->log('nonce token validation query field missing');
             }
         } elseif (!wp_verify_nonce($_GET[NGFB_NONCE], NgfbAdmin::get_nonce())) {
             $this->p->notice->err(__('Nonce token validation failed for action \\"' . $action_name . '\\".', 'nextgen-facebook'));
         } else {
             $_SERVER['REQUEST_URI'] = remove_query_arg(array($action_query, NGFB_NONCE));
             switch ($action_name) {
                 default:
                     do_action($lca . '_load_meta_page_taxonomy_' . $action_name, $this->term_id);
                     break;
             }
         }
     }
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:49,代码来源:taxonomy.php

示例6: show_form_content

 protected function show_form_content()
 {
     $lca = $this->p->cf['lca'];
     if ($this->menu_lib === 'profile') {
         $user_id = get_current_user_id();
         $profileuser = get_user_to_edit($user_id);
         $current_color = get_user_option('admin_color', $user_id);
         if (empty($current_color)) {
             $current_color = 'fresh';
         }
         // match wordpress behavior (users page for admins, profile page for everyone else)
         $admin_url = current_user_can('list_users') ? $this->p->util->get_admin_url($this->menu_id, null, 'users') : $this->p->util->get_admin_url($this->menu_id, null, $this->menu_lib);
         echo '<form name="' . $lca . '" id="' . $lca . '_setting_form" action="user-edit.php" method="post">' . "\n";
         echo '<input type="hidden" name="wp_http_referer" value="' . $admin_url . '" />' . "\n";
         echo '<input type="hidden" name="action" value="update" />' . "\n";
         echo '<input type="hidden" name="user_id" value="' . $user_id . '" />' . "\n";
         echo '<input type="hidden" name="nickname" value="' . $profileuser->nickname . '" />' . "\n";
         echo '<input type="hidden" name="email" value="' . $profileuser->user_email . '" />' . "\n";
         echo '<input type="hidden" name="admin_color" value="' . $current_color . '" />' . "\n";
         echo '<input type="hidden" name="rich_editing" value="' . $profileuser->rich_editing . '" />' . "\n";
         echo '<input type="hidden" name="comment_shortcuts" value="' . $profileuser->comment_shortcuts . '" />' . "\n";
         echo '<input type="hidden" name="admin_bar_front" value="' . _get_admin_bar_pref('front', $user_id) . '" />' . "\n";
         wp_nonce_field('update-user_' . $user_id);
     } elseif ($this->menu_lib === 'setting' || $this->menu_lib === 'submenu') {
         echo '<form name="' . $lca . '" id="' . $lca . '_setting_form" action="options.php" method="post">' . "\n";
         settings_fields($lca . '_setting');
     } elseif ($this->menu_lib === 'sitesubmenu') {
         echo '<form name="' . $lca . '" id="' . $lca . '_setting_form" action="edit.php?action=' . NGFB_SITE_OPTIONS_NAME . '" method="post">' . "\n";
         echo '<input type="hidden" name="page" value="' . $this->menu_id . '" />';
     } else {
         return;
     }
     wp_nonce_field(self::get_nonce(), NGFB_NONCE);
     wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
     wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
     do_meta_boxes($this->pagehook, 'normal', null);
     do_action($this->p->cf['lca'] . '_form_content_metaboxes_' . SucomUtil::sanitize_hookname($this->menu_id), $this->pagehook);
     switch ($this->menu_id) {
         case 'readme':
         case 'setup':
         case 'sitereadme':
         case 'sitesetup':
             break;
         default:
             if ($this->menu_lib === 'profile') {
                 echo $this->get_submit_buttons(_x('Save All Profile Settings', 'submit button', 'nextgen-facebook'));
             } else {
                 echo $this->get_submit_buttons();
             }
             break;
     }
     echo '</form>', "\n";
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:53,代码来源:admin.php

示例7: show_form_content

 protected function show_form_content()
 {
     if ($this->is_submenu($this->menu_id) || $this->is_setting($this->menu_id)) {
         echo '<form name="' . $this->p->cf['lca'] . '" id="' . $this->p->cf['lca'] . '_setting_form" action="options.php" method="post">' . "\n";
         settings_fields($this->p->cf['lca'] . '_setting');
     } elseif ($this->is_sitesubmenu($this->menu_id)) {
         echo '<form name="' . $this->p->cf['lca'] . '" id="' . $this->p->cf['lca'] . '_setting_form" action="edit.php?action=' . WPSSO_SITE_OPTIONS_NAME . '" method="post">' . "\n";
         echo '<input type="hidden" name="page" value="' . $this->menu_id . '">';
     }
     wp_nonce_field(self::get_nonce(), WPSSO_NONCE);
     wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
     wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
     do_meta_boxes($this->pagehook, 'normal', null);
     do_action($this->p->cf['lca'] . '_form_content_metaboxes_' . SucomUtil::sanitize_hookname($this->menu_id), $this->pagehook);
     switch ($this->menu_id) {
         case 'readme':
         case 'setup':
         case 'sitereadme':
         case 'sitesetup':
             break;
         default:
             echo $this->get_submit_buttons();
             break;
     }
     echo '</form>', "\n";
 }
开发者ID:sonvq,项目名称:passioninvestment,代码行数:26,代码来源:admin.php


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