本文整理汇总了PHP中wp_create_nonce函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_create_nonce函数的具体用法?PHP wp_create_nonce怎么用?PHP wp_create_nonce使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_create_nonce函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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')));
}
示例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>';
}
示例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))));
}
}
示例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;
}
示例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;
}
示例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" />';
}
示例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);
}
示例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>';
}
}
示例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'));
}
示例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 ;
}
示例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;
}
示例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());
}
示例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;
}