當前位置: 首頁>>代碼示例>>PHP>>正文


PHP vc_generate_nonce函數代碼示例

本文整理匯總了PHP中vc_generate_nonce函數的典型用法代碼示例。如果您正苦於以下問題:PHP vc_generate_nonce函數的具體用法?PHP vc_generate_nonce怎麽用?PHP vc_generate_nonce使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了vc_generate_nonce函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: renderEditor

 /**
  * vc_filter: vc_frontend_editor_iframe_url - hook to edit iframe url, can be used in vendors like qtranslate do.
  */
 function renderEditor()
 {
     global $current_user;
     get_currentuserinfo();
     $this->current_user = $current_user;
     $this->post_url = vc_str_remove_protocol(get_permalink($this->post_id));
     if (!self::inlineEnabled() || !vc_user_access()->wpAny(array('edit_post', $this->post_id))->get()) {
         header('Location: ' . $this->post_url);
     }
     $this->registerJs();
     $this->registerCss();
     visual_composer()->registerAdminCss();
     //bc
     visual_composer()->registerAdminJavascript();
     //bc
     if ($this->post && 'auto-draft' === $this->post->post_status) {
         $post_data = array('ID' => $this->post_id, 'post_status' => 'draft', 'post_title' => '');
         add_filter('wp_insert_post_empty_content', array($this, 'allowInsertEmptyPost'));
         wp_update_post($post_data, true);
         $this->post->post_status = 'draft';
         $this->post->post_title = '';
     }
     add_filter('admin_body_class', array($this, 'filterAdminBodyClass'));
     $this->post_type = get_post_type_object($this->post->post_type);
     $this->url = $this->post_url . (preg_match('/\\?/', $this->post_url) ? '&' : '?') . 'vc_editable=true&vc_post_id=' . $this->post->ID . '&_vcnonce=' . vc_generate_nonce('vc-admin-nonce');
     $this->url = apply_filters('vc_frontend_editor_iframe_url', $this->url);
     $this->enqueueAdmin();
     $this->enqueueMappedShortcode();
     wp_enqueue_media(array('post' => $this->post_id));
     remove_all_actions('admin_notices', 3);
     remove_all_actions('network_admin_notices', 3);
     $post_custom_css = strip_tags(get_post_meta($this->post_id, '_wpb_post_custom_css', true));
     $this->post_custom_css = $post_custom_css;
     if (!defined('IFRAME_REQUEST')) {
         define('IFRAME_REQUEST', true);
     }
     /**
      * @deprecated vc_admin_inline_editor action hook
      */
     do_action('vc_admin_inline_editor');
     /**
      * new one
      */
     do_action('vc_frontend_editor_render');
     add_filter('admin_title', array(&$this, 'setEditorTitle'));
     $this->render('editor');
     die;
 }
開發者ID:k2jysy,項目名稱:wedev,代碼行數:51,代碼來源:class-vc-frontend-editor.php

示例2: json_encode

,
			vc_mapper = <?php 
echo json_encode(WPBMap::getShortCodes());
?>
,
			vc_vendor_settings_presets = <?php 
echo json_encode($vc_vendor_settings_presets);
?>
,
			vc_settings_presets = <?php 
echo json_encode($vc_settings_presets);
?>
,
			vc_roles = [], // @todo fix_roles BC for roles
			vcAdminNonce = '<?php 
echo vc_generate_nonce('vc-admin-nonce');
?>
';
	</script>

<?php 
vc_include_template('editors/partials/vc_settings-image-block.tpl.php');
?>
	<div style="height: 1px; visibility: hidden; overflow: hidden;">
		<?php 
// Disable notice in edit-form-advanced.php
$is_IE = false;
require_once ABSPATH . 'wp-admin/edit-form-advanced.php';
// Fix: WP 4.0
wp_dequeue_script('editor-expand');
do_action('vc_frontend_editor_render_template');
開發者ID:ntngiri,項目名稱:Wordpress-dhaba,代碼行數:31,代碼來源:frontend_editor.tpl.php

示例3: wp_enqueue_script

    wp_enqueue_script('twbs-pagination');
}
$this->enqueueScripts();
?>
<!-- vc_grid start -->
<div class="vc_grid-container-wrapper vc_clearfix">
	<div class="<?php 
echo esc_attr($css_class);
?>
"
	     data-vc-<?php 
echo esc_attr($this->pagable_type);
?>
-settings="<?php 
echo esc_attr(json_encode($this->grid_settings));
?>
"
		 data-vc-request="<?php 
echo esc_attr(admin_url('admin-ajax.php', 'relative'));
?>
"
		 data-vc-post-id="<?php 
echo esc_attr(get_the_ID());
?>
"
	     data-vc-public-nonce="<?php 
echo vc_generate_nonce('vc-public-nonce');
?>
">
	</div>
</div><!-- vc_grid end -->
開發者ID:tyburrowbridge,項目名稱:tmb,代碼行數:31,代碼來源:vc_basic_grid.php


注:本文中的vc_generate_nonce函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。