本文整理汇总了PHP中RGCurrency::get_currencies方法的典型用法代码示例。如果您正苦于以下问题:PHP RGCurrency::get_currencies方法的具体用法?PHP RGCurrency::get_currencies怎么用?PHP RGCurrency::get_currencies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RGCurrency
的用法示例。
在下文中一共展示了RGCurrency::get_currencies方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gravityforms_settings_page
public static function gravityforms_settings_page()
{
global $wpdb;
if (!GFCommon::ensure_wp_version()) {
return;
}
if (isset($_GET['setup'])) {
//forcing setup
RGForms::setup(true);
}
require_once 'currency.php';
if (isset($_POST['submit'])) {
check_admin_referer('gforms_update_settings', 'gforms_update_settings');
if (!GFCommon::current_user_can_any('gravityforms_edit_settings')) {
die(esc_html__("You don't have adequate permission to edit settings.", 'gravityforms'));
}
RGFormsModel::save_key(sanitize_text_field($_POST['gforms_key']));
update_option('rg_gforms_disable_css', (bool) rgpost('gforms_disable_css'));
update_option('rg_gforms_enable_html5', (bool) rgpost('gforms_enable_html5'));
update_option('gform_enable_noconflict', (bool) rgpost('gform_enable_noconflict'));
update_option('gform_enable_background_updates', (bool) rgpost('gform_enable_background_updates'));
update_option('rg_gforms_enable_akismet', self::get_posted_akismet_setting());
// do not cast to bool, option is enabled by default; need a "1" or a "0"
update_option('rg_gforms_captcha_public_key', sanitize_text_field(rgpost('gforms_captcha_public_key')));
update_option('rg_gforms_captcha_private_key', sanitize_text_field(rgpost('gforms_captcha_private_key')));
if (!rgempty('gforms_currency') && in_array(rgpost('gforms_currency'), array_keys(RGCurrency::get_currencies()))) {
update_option('rg_gforms_currency', rgpost('gforms_currency'));
}
//Updating message because key could have been changed
GFCommon::cache_remote_message();
//Re-caching version info
$version_info = GFCommon::get_version_info(false);
?>
<div class="updated fade" style="padding:6px;">
<?php
esc_html_e('Settings Updated', 'gravityforms');
?>
.
</div>
<?php
}
if (!isset($version_info)) {
$version_info = GFCommon::get_version_info();
}
self::page_header(__('General Settings', 'gravityforms'), '');
?>
<form method="post">
<?php
wp_nonce_field('gforms_update_settings', 'gforms_update_settings');
?>
<h3><span><i class="fa fa-cogs"></i> <?php
esc_html_e('General Settings', 'gravityforms');
?>
</span></h3>
<table class="form-table">
<tr valign="top">
<th scope="row">
<label for="gforms_key"><?php
esc_html_e('Support License Key', 'gravityforms');
?>
</label> <?php
gform_tooltip('settings_license_key');
?>
</th>
<td>
<?php
$key = GFCommon::get_key();
$key_field = '<input type="password" name="gforms_key" id="gforms_key" style="width:350px;" value="' . $key . '" />';
if (!rgempty('is_error', $version_info)) {
$key_field .= " <img src='" . GFCommon::get_base_url() . "/images/exclamation.png' class='gf_keystatus_error gf_tooltip' alt='There was an error validating your key' title='<h6>" . esc_attr__('Validation Error', 'gravityforms') . '</h6>' . esc_attr__('There was an error while validating your license key. Gravity Forms will continue to work, but automatic upgrades will not be available. Please contact support to resolve this issue.', 'gravityforms') . "'/>";
} else {
if (rgar($version_info, 'is_valid_key')) {
$key_field .= " <i class='fa fa-check gf_keystatus_valid'></i> <span class='gf_keystatus_valid_text'>" . esc_html__('Valid Key : Your license key has been successfully validated.', 'gravityforms') . '</span>';
} else {
if (!empty($key)) {
$key_field .= " <i class='fa fa-times gf_keystatus_invalid'></i> <span class='gf_keystatus_invalid_text'>" . esc_html__('Invalid or Expired Key : Please make sure you have entered the correct value and that your key is not expired.', 'gravityforms') . '</span>';
}
}
}
echo apply_filters('gform_settings_key_field', $key_field);
?>
<br />
<span class="gf_settings_description"><?php
esc_html_e('The license key is used for access to automatic upgrades and support.', 'gravityforms');
?>
</span>
</td>
</tr>
<tr valign="top">
<th scope="row">
<label for="gforms_disable_css"><?php
esc_html_e('Output CSS', 'gravityforms');
?>
</label> <?php
gform_tooltip('settings_output_css');
?>
</th>
<td>
<input type="radio" name="gforms_disable_css" value="0" id="gforms_css_output_enabled" <?php
echo get_option('rg_gforms_disable_css') == 1 ? '' : "checked='checked'";
//.........这里部分代码省略.........
示例2: display
function display()
{
$disabled = apply_filters('gform_currency_disabled', false) ? "disabled='disabled'" : '';
?>
<table class="form-table">
<tr valign="top">
<th scope="row">
<label for="gforms_currency"><?php
esc_html_e('Currency', 'gravityforms');
?>
</label> <?php
gform_tooltip('settings_currency');
?>
</th>
<td>
<?php
$disabled = apply_filters('gform_currency_disabled', false) ? "disabled='disabled'" : '';
?>
<select id="gforms_currency" name="currency" <?php
echo $disabled;
?>
>
<option value=""><?php
esc_html_e('Select a Currency', 'gravityforms');
?>
</option>
<?php
require_once GFCommon::get_base_path() . '/currency.php';
$current_currency = $this->currency;
foreach (RGCurrency::get_currencies() as $code => $currency) {
?>
<option value="<?php
echo esc_attr($code);
?>
" <?php
echo $current_currency == $code ? "selected='selected'" : '';
?>
><?php
echo esc_html($currency['name']);
?>
</option>
<?php
}
?>
</select>
<?php
do_action('gform_currency_setting_message', '');
?>
</td>
</tr>
<tr valign="top">
<th scope="row">
<label for="gform_enable_noconflict"><?php
esc_html_e('No-Conflict Mode', 'gravityforms');
?>
</label> <?php
gform_tooltip('settings_noconflict');
?>
</th>
<td>
<input type="radio" name="enable_noconflict" value="1" <?php
echo $this->enable_noconflict == 1 ? "checked='checked'" : '';
?>
id="gform_enable_noconflict" /> <?php
esc_html_e('On', 'gravityforms');
?>
<input type="radio" name="enable_noconflict" value="0" <?php
echo $this->enable_noconflict == 1 ? '' : "checked='checked'";
?>
id="gform_disable_noconflict" /> <?php
esc_html_e('Off', 'gravityforms');
?>
<br />
<span class="gf_settings_description"><?php
esc_html_e('Set this to ON to prevent extraneous scripts and styles from being printed on Gravity Forms admin pages, reducing conflicts with other plugins and themes.', 'gravityforms');
?>
</span>
</td>
</tr>
<tr valign="top">
<th scope="row">
<label for="gform_enable_toolbar_menu"><?php
esc_html_e('Toolbar Menu', 'gravityforms');
?>
</label> <?php
gform_tooltip('settings_toolbar_menu');
?>
</th>
<td>
<input type="radio" name="enable_toolbar_menu" value="1" <?php
checked($this->enable_toolbar_menu, true);
?>
id="gform_enable_toolbar_menu" /> <?php
esc_html_e('On', 'gravityforms');
?>
<input type="radio" name="enable_toolbar_menu" value="0" <?php
checked($this->enable_toolbar_menu, false);
//.........这里部分代码省略.........
示例3: gravityforms_settings_page
//.........这里部分代码省略.........
<input type="radio" name="gforms_enable_html5" value="0" <?php
echo get_option('rg_gforms_enable_html5') == 1 ? "" : "checked='checked'";
?>
/> <?php
_e("No", "gravityforms");
?>
<br />
<?php
_e("Set this to No if you would like to disable the plugin from outputting HTML5 form fields.", "gravityforms");
?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="gforms_currency"><?php
_e("Currency", "gravityforms");
?>
</label> <?php
gform_tooltip("settings_currency");
?>
</th>
<td>
<?php
$disabled = apply_filters("gform_currency_disabled", false) ? "disabled='disabled'" : "";
?>
<select id="gforms_currency" name="gforms_currency" <?php
echo $disabled;
?>
>
<?php
require_once "currency.php";
$current_currency = GFCommon::get_currency();
foreach (RGCurrency::get_currencies() as $code => $currency) {
?>
<option value="<?php
echo $code;
?>
" <?php
echo $current_currency == $code ? "selected='selected'" : "";
?>
><?php
echo $currency["name"];
?>
</option>
<?php
}
?>
</select>
<?php
do_action("gform_currency_setting_message", "");
?>
</td>
</tr>
</table>
<div class="hr-divider"></div>
<h3><?php
_e("reCAPTCHA Settings", "gravityforms");
?>
</h3>
<p style="text-align: left;"><?php
_e("Gravity Forms integrates with reCAPTCHA, a free CAPTCHA service that helps to digitize books while protecting your forms from spam bots. ", "gravityforms");
?>
示例4: gravityforms_settings_page
//.........这里部分代码省略.........
/> <?php
_e("No", "gravityforms");
?>
<br />
<?php
_e("Protect your form entries from spam using Akismet.", "gravityforms");
?>
</td>
</tr>
<?php
}
?>
<tr valign="top">
<th scope="row"><label for="gforms_currency"><?php
_e("Currency", "gravityforms");
?>
</label> <?php
gform_tooltip("settings_currency");
?>
</th>
<td>
<?php
$disabled = apply_filters("gform_currency_disabled", false) ? "disabled='disabled'" : "";
?>
<select id="gforms_currency" name="gforms_currency" <?php
echo $disabled;
?>
>
<?php
require_once "currency.php";
$current_currency = GFCommon::get_currency();
foreach (RGCurrency::get_currencies() as $code => $currency) {
?>
<option value="<?php
echo $code;
?>
" <?php
echo $current_currency == $code ? "selected='selected'" : "";
?>
><?php
echo $currency["name"];
?>
</option>
<?php
}
?>
</select>
<?php
do_action("gform_currency_setting_message", "");
?>
</td>
</tr>
</table>
<div class="hr-divider"></div>
<h3><?php
_e("reCAPTCHA Settings", "gravityforms");
?>
</h3>
<p style="text-align: left;"><?php
_e("Gravity Forms integrates with reCAPTCHA, a free CAPTCHA service that helps to digitize books while protecting your forms from spam bots. ", "gravityforms");
?>