本文整理汇总了PHP中wp_create_nonce函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_create_nonce函数的具体用法?PHP wp_create_nonce怎么用?PHP wp_create_nonce使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_create_nonce函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setup_wizard
/**
* Show the setup wizard
*/
public function setup_wizard()
{
if (empty($_GET['page']) || 'wc-setup' !== $_GET['page']) {
return;
}
$this->steps = array('introduction' => array('name' => __('Introduction', 'woocommerce'), 'view' => array($this, 'wc_setup_introduction'), 'handler' => ''), 'pages' => array('name' => __('Page Setup', 'woocommerce'), 'view' => array($this, 'wc_setup_pages'), 'handler' => array($this, 'wc_setup_pages_save')), 'locale' => array('name' => __('Store Locale', 'woocommerce'), 'view' => array($this, 'wc_setup_locale'), 'handler' => array($this, 'wc_setup_locale_save')), 'shipping_taxes' => array('name' => __('Shipping & Tax', 'woocommerce'), 'view' => array($this, 'wc_setup_shipping_taxes'), 'handler' => array($this, 'wc_setup_shipping_taxes_save')), 'payments' => array('name' => __('Payments', 'woocommerce'), 'view' => array($this, 'wc_setup_payments'), 'handler' => array($this, 'wc_setup_payments_save')), 'next_steps' => array('name' => __('Ready!', 'woocommerce'), 'view' => array($this, 'wc_setup_ready'), 'handler' => ''));
$this->step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps));
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_register_script('select2', WC()->plugin_url() . '/assets/js/select2/select2' . $suffix . '.js', array('jquery'), '3.5.2');
wp_register_script('wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array('jquery', 'select2'), WC_VERSION);
wp_localize_script('wc-enhanced-select', 'wc_enhanced_select_params', array('i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'woocommerce'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'woocommerce'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'woocommerce'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'woocommerce'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'woocommerce'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'woocommerce'), 'ajax_url' => admin_url('admin-ajax.php'), 'search_products_nonce' => wp_create_nonce('search-products'), 'search_customers_nonce' => wp_create_nonce('search-customers')));
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION);
wp_enqueue_style('wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array('dashicons', 'install'), WC_VERSION);
wp_register_script('wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup.min.js', array('jquery', 'wc-enhanced-select'), WC_VERSION);
wp_localize_script('wc-setup', 'wc_setup_params', array('locale_info' => json_encode(include WC()->plugin_path() . '/i18n/locale-info.php')));
if (!empty($_POST['save_step']) && isset($this->steps[$this->step]['handler'])) {
call_user_func($this->steps[$this->step]['handler']);
}
ob_start();
$this->setup_wizard_header();
$this->setup_wizard_steps();
$this->setup_wizard_content();
$this->setup_wizard_footer();
exit;
}
开发者ID:zengskie,项目名称:Heroku-WordPress-PostgreSQL,代码行数:28,代码来源:class-wc-admin-setup-wizard.php
示例2: load_scripts
function load_scripts()
{
wp_enqueue_script('admin-app', JS_APP_URL . 'build/js/admin-app-scripts.js', array('jquery'), PLUGIN_VERSION, false);
wp_enqueue_script('react-components', JS_APP_URL . 'build/js/all-components.js', array('admin-app'), PLUGIN_VERSION, true);
wp_enqueue_style('admin-app-styles', JS_APP_URL . 'build/css/styles.css', array(), PLUGIN_VERSION, 'all');
wp_localize_script('admin-app', 'admin_app_local', array('api_url' => get_rest_url(), 'template_directory' => JS_APP_URL . 'templates', 'nonce' => wp_create_nonce('wp_rest')));
}
开发者ID:WordPress-Admin-JavaScript-Boilerplate,项目名称:ReactJS-Boilerplate,代码行数:7,代码来源:admin_js.php
示例3: build_meta_box
/**
* Meta box view
*
* @return string
*
* @access public
* @since 1.0
*/
function build_meta_box($post, $metabox)
{
echo '<div class="ot-metabox-wrapper">';
/* Use nonce for verification */
echo '<input type="hidden" name="' . $this->meta_box['id'] . '_nonce" value="' . wp_create_nonce($this->meta_box['id']) . '" />';
/* meta box description */
echo isset($this->meta_box['desc']) && !empty($this->meta_box['desc']) ? '<div class="description" style="padding-top:10px;">' . htmlspecialchars_decode($this->meta_box['desc']) . '</div>' : '';
/* loop through meta box fields */
foreach ($this->meta_box['fields'] as $field) {
/* get current post meta data */
$field_value = get_post_meta($post->ID, $field['id'], true);
/* set standard value */
if (isset($field['std'])) {
$field_value = ot_filter_std_value($field_value, $field['std']);
}
/* build the arguments array */
$_args = array('type' => $field['type'], 'field_id' => $field['id'], 'field_name' => $field['id'], 'field_value' => $field_value, 'field_desc' => isset($field['desc']) ? $field['desc'] : '', 'field_std' => isset($field['std']) ? $field['std'] : '', 'field_rows' => isset($field['rows']) && !empty($field['rows']) ? $field['rows'] : 10, 'field_post_type' => isset($field['post_type']) && !empty($field['post_type']) ? $field['post_type'] : 'post', 'field_taxonomy' => isset($field['taxonomy']) && !empty($field['taxonomy']) ? $field['taxonomy'] : 'category', 'field_min_max_step' => isset($field['min_max_step']) && !empty($field['min_max_step']) ? $field['min_max_step'] : '0,100,1', 'field_class' => isset($field['class']) ? $field['class'] : '', 'field_choices' => isset($field['choices']) ? $field['choices'] : array(), 'field_settings' => isset($field['settings']) && !empty($field['settings']) ? $field['settings'] : array(), 'post_id' => $post->ID, 'meta' => true);
/* only allow simple textarea due to DOM issues with wp_editor() */
if ($_args['type'] == 'textarea') {
$_args['type'] = 'textarea-simple';
}
/* option label */
echo '<div class="format-settings">';
/* don't show title with textblocks */
if ($_args['type'] != 'textblock' && !empty($field['label'])) {
echo '<div class="format-setting-label">';
echo '<label for="' . $_args['field_id'] . '" class="label">' . $field['label'] . '</label>';
echo '</div>';
}
/* get the option HTML */
echo ot_display_by_type($_args);
echo '</div>';
}
echo '</div>';
}
开发者ID:Jwiens92,项目名称:CumberLandSpice,代码行数:43,代码来源:ot-meta-box-api.php
示例4: enqueueJavascripts
public function enqueueJavascripts($pageHookname)
{
if ($pageHookname === $this->adminConsolePageHookname) {
$jsDir = $this->config->getPluginUrl() . '/js';
$version = $this->config->getVersion();
$knockoutSuffix = '';
$suffix = '.min';
if (defined('WP_DEBUG') && WP_DEBUG) {
$knockoutSuffix = '.debug';
$suffix = '';
}
wp_register_script('knockout', $jsDir . '/deps/knockout-3.1.0' . $knockoutSuffix . '.js', array(), $version, false);
wp_enqueue_script('knockout');
wp_register_script('knockoutValidation', $jsDir . '/deps/knockout.validation' . $suffix . '.js', array('knockout'), $version, false);
wp_enqueue_script('knockoutValidation');
wp_register_script('autosize', $jsDir . '/deps/jquery.autosize' . $suffix . '.js', array('jquery'), $version, false);
wp_enqueue_script('autosize');
wp_register_script('chamameAdmin', $jsDir . '/admin' . $suffix . '.js', array('jquery', 'knockout', 'knockoutValidation', 'autosize'), $version, false);
wp_enqueue_script('chamameAdmin');
$ajaxUrl = str_replace(array('https:', 'http:'), '', admin_url('admin-ajax.php'));
$token = wp_create_nonce('chamameLiveChat');
$textDomain = $this->config->getTextDomain();
wp_localize_script('chamameAdmin', 'chamameParams', array('ajaxUrl' => $ajaxUrl, 'loggedIn' => $this->session->isLoggedIn(), 'conversationId' => $this->session->getActiveConversationId(), 'token' => $token, 'text' => array('error' => __('Something went wrong. Please try again', $textDomain))));
}
}
开发者ID:al-mamun,项目名称:chamame-live-chat,代码行数:25,代码来源:ChamameGuiAdmin.php
示例5: wpcf_fields_select_insert_form
/**
* Form data for group form.
*
* @return type
*/
function wpcf_fields_select_insert_form($form_data = array(), $parent_name = '')
{
$id = 'wpcf-fields-select-' . wpcf_unique_id(serialize($form_data));
$form['name'] = array('#type' => 'textfield', '#title' => __('Name of custom field', 'wpcf'), '#description' => __('Under this name field will be stored in DB (sanitized)', 'wpcf'), '#name' => 'name', '#attributes' => array('class' => 'wpcf-forms-set-legend'), '#validate' => array('required' => array('value' => true)));
$form['description'] = array('#type' => 'textarea', '#title' => __('Description', 'wpcf'), '#description' => __('Text that describes function to user', 'wpcf'), '#name' => 'description', '#attributes' => array('rows' => 5, 'cols' => 1));
$form['options-markup-open'] = array('#type' => 'markup', '#markup' => '<strong>' . __('Options', 'wpcf') . '</strong><br /><br />' . '<div class="wpcf-form-options-header-title">' . '<em>' . __('Display text', 'wpcf') . '</em>' . '</div><div class="wpcf-form-options-header-value">' . '<em>' . __('Custom field content', 'wpcf') . '</em></div>' . '<div id="' . $id . '-sortable"' . ' class="wpcf-fields-select-sortable wpcf-compare-unique-value-wrapper">');
$options = !empty($form_data['options']) ? $form_data['options'] : array();
$options = !empty($form_data['data']['options']) ? $form_data['data']['options'] : $options;
if (!empty($options)) {
foreach ($options as $option_key => $option) {
if ($option_key == 'default') {
continue;
}
$option['key'] = $option_key;
$option['default'] = isset($options['default']) ? $options['default'] : null;
$form = $form + wpcf_fields_select_get_option('', $option);
}
} else {
$form = $form + wpcf_fields_select_get_option();
}
if (!empty($options)) {
$count = count($options);
} else {
$count = 1;
}
$form['options-markup-close'] = array('#type' => 'markup', '#markup' => '</div><div id="' . $id . '-add-option"></div><br /><a href="' . admin_url('admin-ajax.php?action=wpcf_ajax&wpcf_action=add_select_option&_wpnonce=' . wp_create_nonce('add_select_option') . '&wpcf_ajax_update_add=' . $id . '-sortable&parent_name=' . urlencode($parent_name) . '&count=' . $count) . '" onclick="wpcfFieldsFormCountOptions(jQuery(this));"' . ' class="button-secondary wpcf-ajax-link">' . __('Add option', 'wpcf') . '</a>');
$form['options-close'] = array('#type' => 'markup', '#markup' => '<br /><br />');
return $form;
}
开发者ID:olechka1505,项目名称:hungrylemur,代码行数:34,代码来源:select.php
示例6: sp_ProfilePermissionsForum
function sp_ProfilePermissionsForum($thisForum, $userid)
{
global $thisAlt;
# Start the 'forum' section
$out = "<div class='spGroupForumSection {$thisAlt}'>";
# Column 1 of the forum row
$out .= '<div class="spColumnSection spProfilePermissionIcon">';
$icon = !empty($thisForum->forum_icon) ? sp_paint_custom_icon('spRowIcon', SFCUSTOMURL . $thisForum->forum_icon) : sp_paint_icon('spRowIcon', SPTHEMEICONSURL, 'sp_ForumIcon.png');
$out .= $icon;
$out .= '</div>';
# Column 2 of the forum row
$out .= '<div class="spColumnSection spProfilePermissionForum">';
$out .= "<div class='spRowName'>" . $thisForum->forum_name . "</div>";
$desc = !empty($thisForum->forum_desc) ? $thisForum->forum_desc : '';
$out .= "<div class='spRowName'>" . $desc . "</div>";
$out .= '</div>';
# Column 3 of the forum row
$site = SFHOMEURL . "index.php?sp_ahah=permissions&sfnonce=" . wp_create_nonce('forum-ahah') . "&forum=" . $thisForum->forum_id . '&userid=' . $userid;
$img = SFCOMMONIMAGES . '/working.gif';
$out .= '<div class="spColumnSection spProfilePermissionButton">';
$out .= '<a rel="nofollow" href="javascript:void(null)" onclick="spjLoadTool(\'' . $site . '\', \'perm' . $thisForum->forum_id . '\', \'' . $img . '\');">';
$out .= '<input type="submit" class="spSubmit" value="' . sp_text('View') . '" />';
$out .= '</a>';
$out .= '</div>';
$out .= sp_InsertBreak('echo=0');
$out .= '</div>';
# hidden area for the permissions for this forum
$out .= '<div id="perm' . $thisForum->forum_id . '" class="spHiddenSection spProfilePermission"></div>';
$thisAlt = $thisAlt == 'spOdd' ? 'spEven' : 'spOdd';
return $out;
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:31,代码来源:sp-form-permissions.php
示例7: page_url
function page_url()
{
global $post;
echo '<input type="hidden" name="sponsormeta_noncename" id="sponsormeta_noncename" value="' . wp_create_nonce(plugin_basename(__FILE__)) . '" />';
$URL = get_post_meta($post->ID, '_URL', true);
echo '<input type="text" name="_URL" value="' . $URL . '" class="widefat" />';
}
开发者ID:brunolampada,项目名称:foss4g2014-wordpress,代码行数:7,代码来源:page_metabox.php
示例8: json_api_client_js
/**
* Plugin Name: WP-API Client JS
*/
function json_api_client_js()
{
$scripts = wp_scripts();
$src = plugins_url('build/js/wp-api.js', __FILE__);
if (isset($scripts->registered['wp-api'])) {
$scripts->registered['wp-api']->src = $src;
} else {
wp_register_script('wp-api', $src, array('jquery', 'underscore', 'backbone'), '1.0', true);
}
/**
* @var \WP_REST_Server $wp_rest_server
*/
global $wp_rest_server;
if (empty($wp_rest_server)) {
/** This filter is documented in wp-includes/rest-api.php */
$wp_rest_server_class = apply_filters('wp_rest_server_class', 'WP_REST_Server');
$wp_rest_server = new $wp_rest_server_class();
/** This filter is documented in wp-includes/rest-api.php */
do_action('rest_api_init', $wp_rest_server);
}
$schema_request = new WP_REST_Request('GET', '/wp/v2');
$schema_response = $wp_rest_server->dispatch($schema_request);
$schema = null;
if (!$schema_response->is_error()) {
$schema = $schema_response->get_data();
}
$settings = array('root' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest'), 'versionString' => 'wp/v2/', 'schema' => $schema);
wp_localize_script('wp-api', 'wpApiSettings', $settings);
}
开发者ID:vickoman,项目名称:client-js,代码行数:32,代码来源:client-js.php
示例9: downloads_meta
function downloads_meta()
{
//Este código trae todas nuestras opciones de administración.
/*global $options;
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) {
$$value['id'] = $value['std'];
} else {
$$value['id'] = get_settings( $value['id'] );
}
}*/
global $post, $downloads_meta;
global $post_ID, $temp_ID;
foreach ($downloads_meta as $meta_box) {
$meta_box_value = get_post_meta($post->ID, $meta_box['name'] . '_value', true);
//Si el campo esta vacío
if ($meta_box_value == "") {
$meta_box_value = $meta_box['std'];
}
echo '<div class="post-meta">';
echo '<input type="hidden" name="' . $meta_box['name'] . '_noncename" id="' . $meta_box['name'] . '_noncename" value="' . wp_create_nonce(plugin_basename(__FILE__)) . '" />';
echo '<h2 style="margin:5px;">' . $meta_box['title'] . ' <a href="#help-' . $meta_box['name'] . '" class="gesti-open">¿Qué es esto?</a></h2>';
//cuadro de Ayuda
echo '<div id="help-' . $meta_box['name'] . '" class="help-box">';
echo '<p>' . $meta_box['description'] . '</p>';
echo '<p><a href="#help-' . $meta_box['name'] . '" class="gesti-close">Cerrar</a></p>';
echo '</div>';
echo '<p><input name="' . $meta_box['name'] . '_value" class="gesti-input" value="' . $meta_box_value . '" /></p>';
echo '<p>' . $meta_box['description2'] . '</p>';
echo '</div>';
}
}
开发者ID:Gestiopolis,项目名称:GestiopolisExp1,代码行数:32,代码来源:meta_downloads.php
示例10: enqueue_scripts
/**
* Register the stylesheets for the public-facing side of the site.
*
* @since 1.0.0
*/
public function enqueue_scripts()
{
global $post, $product;
if (is_object($post) && class_exists('WooCommerce')) {
$is_product_type_variable = 'false';
if (function_exists('wc_get_product')) {
$product = wc_get_product($post);
if ($product) {
if ($product->is_type('variable') && is_single()) {
$is_product_type_variable = 'true';
}
}
}
$attach_id = isset($_SESSION['attach_id']) && !empty($_SESSION['attach_id']) ? $_SESSION['attach_id'] : '';
if (!empty($attach_id)) {
$total_word = get_post_meta($attach_id, 'total_word', true);
} else {
$total_word = '';
}
if (!empty($attach_id)) {
$total_character = get_post_meta($attach_id, 'total_character', true);
} else {
$total_character = '';
}
wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/woocommerce-price-per-word-public.js', array('jquery'), $this->version, false);
if (wp_script_is($this->plugin_name)) {
wp_localize_script($this->plugin_name, 'woocommerce_price_per_word_params', apply_filters('woocommerce_price_per_word_params', array('ajax_url' => admin_url('admin-ajax.php'), 'woocommerce_price_per_word_params_nonce' => wp_create_nonce("woocommerce_price_per_word_params_nonce"), 'total_word' => $total_word, 'total_character' => $total_character, 'is_product_type_variable' => $is_product_type_variable, 'woocommerce_currency_symbol_js' => get_woocommerce_currency_symbol(), 'woocommerce_price_num_decimals' => wc_get_price_decimals(), 'aewcppw_word_character' => $this->wppw_get_product_type(), 'aewcppw_allow_users_to_enter_qty' => $this->aewcppw_allow_users_to_enter_qty())));
}
wp_enqueue_script($this->plugin_name . '-bn', plugin_dir_url(__FILE__) . 'js/woocommerce-price-per-word-bn.js', array('jquery'), $this->version, false);
}
}
开发者ID:angelleye,项目名称:woocommerce-price-per-word,代码行数:36,代码来源:class-woocommerce-price-per-word-public.php
示例11: test_dont_process_terms_if_taxonomy_does_not_allow_show_on_quick_edit
/**
* @ticket 26948
*/
public function test_dont_process_terms_if_taxonomy_does_not_allow_show_on_quick_edit()
{
register_taxonomy('wptests_tax_1', 'post', array('show_in_quick_edit' => false, 'hierarchical' => true));
register_taxonomy('wptests_tax_2', 'post', array('show_in_quick_edit' => true, 'hierarchical' => true));
$t1 = self::factory()->term->create(array('taxonomy' => 'wptests_tax_1'));
$t2 = self::factory()->term->create(array('taxonomy' => 'wptests_tax_2'));
// Become an administrator.
$this->_setRole('administrator');
$post = self::factory()->post->create_and_get(array('post_author' => get_current_user_id()));
// Set up a request.
$_POST['_inline_edit'] = wp_create_nonce('inlineeditnonce');
$_POST['post_ID'] = $post->ID;
$_POST['post_type'] = $post->post_type;
$_POST['content'] = $post->post_content;
$_POST['excerpt'] = $post->post_excerpt;
$_POST['_status'] = $post->post_status;
$_POST['post_status'] = $post->post_status;
$_POST['screen'] = 'post';
$_POST['post_view'] = 'excerpt';
$_POST['tax_input'] = array('wptests_tax_1' => array($t1), 'wptests_tax_2' => array($t2));
// Make the request.
try {
$this->_handleAjax('inline-save');
} catch (WPAjaxDieContinueException $e) {
unset($e);
}
// wptests_tax_1 terms should have been refused.
$post_terms_1 = wp_get_object_terms($post->ID, 'wptests_tax_1');
$this->assertEmpty($post_terms_1);
// wptests_tax_2 terms should have been added successfully.
$post_terms_2 = wp_get_object_terms($post->ID, 'wptests_tax_2');
$this->assertEqualSets(array($t2), wp_list_pluck($post_terms_2, 'term_id'));
}
开发者ID:atimmer,项目名称:wordpress-develop-mirror,代码行数:36,代码来源:QuickEdit.php
示例12: smartSeo_post_markers_custom_box
function smartSeo_post_markers_custom_box()
{
//get post meta value
global $post, $smartSeo;
$prefix = $smartSeo->prefix;
// use nonce for verification
echo '<input type="hidden" name="smartSeo_post_markers_noncename" id="smartSeo_post_markers_noncename" value="' . wp_create_nonce('nyc-smartSeo') . '" />';
foreach (post_option_fields() as $key => $value) {
if ($value['type'] == 'upload') {
echo '<div style="width: 100%;float: left; margin: 15px 0px 0px 10px;">';
echo '<div style="float: left;width: 150px;font-weight: bold;">' . $value['name'] . '</div>';
echo '<div style="float: left;width: 450px;font-weight: bold;">' . smartSeo_upload($value) . '</div>';
echo '<div style="float: left"><i>' . $value['desc'] . '</i></div>';
echo '</div>';
}
if ($value['type'] == 'text') {
$value['std'] = get_post_meta($post->ID, $value['id'], true);
echo '<div style="width: 100%;float: left;margin: 15px 0px 0px 10px; ">';
echo '<div style="float: left;width: 150px;font-weight: bold;">' . $value['name'] . '</div>';
echo '<div style="float: left;width: 450px;font-weight: bold;">' . smartSeo_text($value) . '</div>';
echo '<div style="float: left"><i>' . $value['desc'] . '</i></div>';
echo '</div>';
}
if ($value['type'] == 'textarea') {
$value['std'] = get_post_meta($post->ID, $value['id'], true);
echo '<div style="width: 100%;float: left;margin: 15px 0px 0px 10px; ">';
echo '<div style="float: left;width: 150px;font-weight: bold;">' . $value['name'] . '</div>';
echo '<div style="float: left;width: 450px;font-weight: bold;">' . smartSeo_textarea($value) . '</div>';
echo '<div style="float: left"><i>' . $value['desc'] . '</i></div>';
echo '</div>';
}
}
echo '<div style="clear:both"></div>';
//echo ;
}
开发者ID:nishant368,项目名称:newlifeoffice-new,代码行数:35,代码来源:post_block.php
示例13: redirect_url
/**
* Payment redirect URL fitler.
*
* @since 1.0.1
* @param string $url
* @param Pronamic_Pay_Payment $payment
* @return string
*/
public static function redirect_url($url, $payment)
{
global $transaction;
$transaction_id = $payment->get_source_id();
$transaction = new MeprTransaction($transaction_id);
switch ($payment->get_status()) {
case Pronamic_WP_Pay_Statuses::CANCELLED:
case Pronamic_WP_Pay_Statuses::EXPIRED:
case Pronamic_WP_Pay_Statuses::FAILURE:
$product = $transaction->product();
$url = add_query_arg(array('action' => 'payment_form', 'txn' => $transaction->trans_num, '_wpnonce' => wp_create_nonce('mepr_payment_form')), $product->url());
break;
case Pronamic_WP_Pay_Statuses::SUCCESS:
// @see https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/models/MeprOptions.php#L768-782
$mepr_options = MeprOptions::fetch();
$product = new MeprProduct($transaction->product_id);
$sanitized_title = sanitize_title($product->post_title);
$url = $mepr_options->thankyou_page_url('membership=' . $sanitized_title . '&trans_num=' . $transaction->trans_num);
break;
case Pronamic_WP_Pay_Statuses::OPEN:
default:
break;
}
return $url;
}
开发者ID:wp-pay-extensions,项目名称:memberpress,代码行数:33,代码来源:Extension.php
示例14: get_redirect_url
/**
* Get merchant redirect URL for IPS.
*
* This is store URL that will be redirected from middleware.
*
* @param string $env Environment
*
* @return string Redirect URL
*/
public function get_redirect_url($env)
{
if (!in_array($env, array('live', 'sandbox'))) {
$env = 'live';
}
return add_query_arg(array('env' => $env, 'wc_ppec_ips_admin_nonce' => wp_create_nonce('wc_ppec_ips')), wc_gateway_ppec()->get_admin_setting_link());
}
开发者ID:ksan5835,项目名称:maadithottam,代码行数:16,代码来源:class-wc-gateway-ppec-ips-handler.php
示例15: metaform
/**
* Setup metaform.
*
* Setup metaform for field type "entry".
*
* @since x.x.x
*
* @return array metaform configuration for field "entry".
*/
public function metaform()
{
/**
* add special class to hanfle select2
*/
$attributes = $this->getAttr();
if (isset($attributes['class'])) {
$attributes['class'] .= ' ';
} else {
$attributes['class'] = '';
}
$attributes['class'] .= 'js-wpcf-entry-select2';
/**
* setup post type
*/
$attributes['data-post-type'] = 'post';
$data = $this->getData();
if (isset($data['post_type'])) {
$attributes['data-post-type'] = $data['post_type'];
}
$attributes['data-nonce'] = wp_create_nonce('wpcf_entry_search');
$metaform = array();
$metaform[] = array('#type' => 'textfield', '#title' => $this->getTitle(), '#description' => $this->getDescription(), '#name' => $this->getName(), '#value' => $this->getValue(), '#validate' => $this->getValidationData(), '#repetitive' => $this->isRepetitive(), '#attributes' => $attributes, 'wpml_action' => $this->getWPMLAction());
return $metaform;
}
开发者ID:jairoburbano,项目名称:rimisp,代码行数:34,代码来源:class.entry.php
示例16: load_styles_scripts
/**
* Styles & Scripts conditional loading
*
* @param
* $hook
*/
public function load_styles_scripts()
{
$lang = get_bloginfo('language');
$lang = explode('-', $lang);
$lang = $lang[0];
/*
* Item reports Styles & Scripts
*/
if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_front']) && $this->gadwp->config->options['frontend_item_reports']) {
wp_enqueue_style('gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION);
wp_enqueue_style('gadwp-frontend-item-reports', GADWP_URL . 'front/css/item-reports.css', null, GADWP_CURRENT_VERSION);
$country_codes = GADWP_Tools::get_countrycodes();
if ($this->gadwp->config->options['ga_target_geomap'] && isset($country_codes[$this->gadwp->config->options['ga_target_geomap']])) {
$region = $this->gadwp->config->options['ga_target_geomap'];
} else {
$region = false;
}
wp_enqueue_style("wp-jquery-ui-dialog");
if (!wp_script_is('googlejsapi')) {
wp_register_script('googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null);
}
wp_enqueue_script('gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array('jquery'), GADWP_CURRENT_VERSION);
wp_enqueue_script('gadwp-frontend-item-reports', GADWP_URL . 'common/js/reports.js', array('gadwp-nprogress', 'googlejsapi', 'jquery', 'jquery-ui-dialog'), GADWP_CURRENT_VERSION);
/* @formatter:off */
wp_localize_script('gadwp-frontend-item-reports', 'gadwpItemData', array('ajaxurl' => admin_url('admin-ajax.php'), 'security' => wp_create_nonce('gadwp_frontend_item_reports'), 'dateList' => array('today' => __("Today", 'google-analytics-dashboard-for-wp'), 'yesterday' => __("Yesterday", 'google-analytics-dashboard-for-wp'), '7daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 7), '14daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 14), '30daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 30), '90daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 90), '365daysAgo' => sprintf(_n("%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp'), __('One', 'google-analytics-dashboard-for-wp')), '1095daysAgo' => sprintf(_n("%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp'), __('Three', 'google-analytics-dashboard-for-wp'))), 'reportList' => array('uniquePageviews' => __("Unique Views", 'google-analytics-dashboard-for-wp'), 'users' => __("Users", 'google-analytics-dashboard-for-wp'), 'organicSearches' => __("Organic", 'google-analytics-dashboard-for-wp'), 'pageviews' => __("Page Views", 'google-analytics-dashboard-for-wp'), 'visitBounceRate' => __("Bounce Rate", 'google-analytics-dashboard-for-wp'), 'locations' => __("Location", 'google-analytics-dashboard-for-wp'), 'referrers' => __("Referrers", 'google-analytics-dashboard-for-wp'), 'searches' => __("Searches", 'google-analytics-dashboard-for-wp'), 'trafficdetails' => __("Traffic", 'google-analytics-dashboard-for-wp'), 'technologydetails' => __("Technology", 'google-analytics-dashboard-for-wp')), 'i18n' => array(__("A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp'), __("Traffic Mediums", 'google-analytics-dashboard-for-wp'), __("Visitor Type", 'google-analytics-dashboard-for-wp'), __("Search Engines", 'google-analytics-dashboard-for-wp'), __("Social Networks", 'google-analytics-dashboard-for-wp'), __("Unique Views", 'google-analytics-dashboard-for-wp'), __("Users", 'google-analytics-dashboard-for-wp'), __("Page Views", 'google-analytics-dashboard-for-wp'), __("Bounce Rate", 'google-analytics-dashboard-for-wp'), __("Organic Search", 'google-analytics-dashboard-for-wp'), __("Pages/Session", 'google-analytics-dashboard-for-wp'), __("Invalid response, more details in JavaScript Console (F12).", 'google-analytics-dashboard-for-wp'), __("Not enough data collected", 'google-analytics-dashboard-for-wp'), __("This report is unavailable", 'google-analytics-dashboard-for-wp'), __("report generated by", 'google-analytics-dashboard-for-wp'), __("This plugin needs an authorization:", 'google-analytics-dashboard-for-wp') . ' <strong>' . __("authorize the plugin", 'google-analytics-dashboard-for-wp') . '</strong>!', __("Browser", 'google-analytics-dashboard-for-wp'), __("Operating System", 'google-analytics-dashboard-for-wp'), __("Screen Resolution", 'google-analytics-dashboard-for-wp'), __("Mobile Brand", 'google-analytics-dashboard-for-wp')), 'colorVariations' => GADWP_Tools::variations($this->gadwp->config->options['ga_dash_style']), 'region' => $region, 'language' => get_bloginfo('language'), 'filter' => $_SERVER["REQUEST_URI"], 'viewList' => false, 'scope' => 'front-item'));
/* @formatter:on */
}
}
开发者ID:brstgt,项目名称:layuda,代码行数:34,代码来源:setup.php
示例17: filter_the_content
public function filter_the_content($content)
{
$ww_problem = false;
if (is_page('webwork')) {
$ww_problem = true;
} else {
$ww_problem = get_query_var('ww_problem');
}
if ($ww_problem) {
$content = '<div id="webwork-app"></div>';
wp_enqueue_script('webwork-app', plugins_url() . '/webwork/build/index.js');
$route_base = get_option('home');
$route_base = preg_replace('|https?://[^/]+/|', '', $route_base);
// @todo Centralize this logic.
$main_site_url = get_blog_option(1, 'home');
$rest_api_endpoint = trailingslashit($main_site_url) . 'wp-json/webwork/v1/';
// @todo Abstract.
$post_data = null;
$ww_problem_text = '';
if (!empty($_GET['post_data_key'])) {
$post_data = get_blog_option(1, $_GET['post_data_key']);
$ww_problem_text = base64_decode($post_data['pg_object']);
}
// @todo This is awful.
$clients = get_blog_option(1, 'webwork_clients');
$remote_course_url = array_search(get_current_blog_id(), $clients);
wp_localize_script('webwork-app', 'WWData', array('problem_id' => $ww_problem, 'problem_text' => $ww_problem_text, 'remote_course_url' => $remote_course_url, 'rest_api_nonce' => wp_create_nonce('wp_rest'), 'rest_api_endpoint' => $rest_api_endpoint, 'route_base' => trailingslashit($route_base) . 'webwork/', 'user_can_ask_question' => is_user_logged_in(), 'user_can_post_response' => is_user_logged_in(), 'user_can_vote' => is_user_logged_in()));
wp_enqueue_style('webwork-app', plugins_url() . '/webwork/assets/css/app.css');
wp_register_script('webwork-mathjax-loader', WEBWORK_PLUGIN_URL . '/assets/js/webwork-mathjax-loader.js');
$webwork_mathjax_loader_strings = array('mathjax_src' => esc_url('https://cdn.mathjax.org/mathjax/latest/unpacked/MathJax.js?config=TeX-MML-AM_HTMLorMML-full'));
wp_localize_script('webwork-mathjax-loader', 'WeBWorK_MathJax', $webwork_mathjax_loader_strings);
wp_enqueue_script('webwork-mathjax-loader');
}
return $content;
}
开发者ID:livinglab,项目名称:webwork-for-wordpress,代码行数:35,代码来源:Client.php
示例18: _set_post_values
function _set_post_values($repeating_section, $form_id, $child_ids)
{
$checked = $form_id ? 0 : 1;
$args = array('action' => 'frm_toggle_repeat', 'nonce' => wp_create_nonce('frm_ajax'), 'form_id' => $form_id, 'parent_form_id' => $repeating_section->form_id, 'checked' => 0, 'field_id' => $repeating_section->id, 'children' => $child_ids, 'checked' => $checked);
$_POST = $args;
return $args;
}
开发者ID:amando96,项目名称:formidable-forms,代码行数:7,代码来源:test_FrmProFieldsControllerAjax.php
示例19: wpcf_fields_skype_meta_box_form
/**
* Form data for post edit page.
*
* @param type $field
*/
function wpcf_fields_skype_meta_box_form($field)
{
add_thickbox();
if (isset($field['value'])) {
$field['value'] = maybe_unserialize($field['value']);
}
$form = array();
add_filter('wpcf_fields_shortcode_slug_' . $field['slug'], 'wpcf_fields_skype_shortcode_filter', 10, 2);
$rand = wpcf_unique_id(serialize($field));
$form['skypename'] = array('#type' => 'textfield', '#value' => isset($field['value']['skypename']) ? $field['value']['skypename'] : '', '#name' => 'wpcf[' . $field['slug'] . '][skypename]', '#id' => 'wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '-skypename', '#inline' => true, '#suffix' => ' ' . __('Skype name', 'wpcf'), '#description' => '', '#prefix' => !empty($field['description']) ? wpcf_translate('field ' . $field['id'] . ' description', $field['description']) . '<br /><br />' : '', '#attributes' => array('style' => 'width:60%;'), '#_validate_this' => true, '#before' => '<div class="wpcf-skype">');
$form['style'] = array('#type' => 'hidden', '#value' => isset($field['value']['style']) ? $field['value']['style'] : 'btn2', '#name' => 'wpcf[' . $field['slug'] . '][style]', '#id' => 'wpcf-fields-skype-' . $field['slug'] . '-' . $rand . '-style');
$preview_skypename = !empty($field['value']['skypename']) ? $field['value']['skypename'] : '--not--';
$preview_style = !empty($field['value']['style']) ? $field['value']['style'] : 'btn2';
$preview = wpcf_fields_skype_get_button_image($preview_skypename, $preview_style);
// Set button
// TODO WPML move
if (isset($field['disable']) || wpcf_wpml_field_is_copied($field)) {
$edit_button = '';
} else {
$edit_button = '' . '<a href="' . admin_url('admin-ajax.php?action=wpcf_ajax&
|
请发表评论