本文整理汇总了PHP中WC_HTTPS::force_https_url方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_HTTPS::force_https_url方法的具体用法?PHP WC_HTTPS::force_https_url怎么用?PHP WC_HTTPS::force_https_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_HTTPS
的用法示例。
在下文中一共展示了WC_HTTPS::force_https_url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_icon
/**
* get_icon function.
*
* @access public
* @return string
*/
public function get_icon()
{
$icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/visa.svg') . '" alt="Visa" width="32" style="margin-left: 0.3em" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/mastercard.svg') . '" alt="Mastercard" width="32" style="margin-left: 0.3em" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/amex.svg') . '" alt="Amex" width="32" style="margin-left: 0.3em" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/discover.svg') . '" alt="Discover" width="32" style="margin-left: 0.3em" />';
return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
}
示例2: get_icon
/**
* get_icon function.
*
* @access public
* @return string
*/
public function get_icon()
{
$icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/visa.png') . '" alt="Visa" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/mastercard.png') . '" alt="Mastercard" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/amex.png') . '" alt="Amex" />';
if ('USD' === get_woocommerce_currency()) {
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/discover.png') . '" alt="Discover" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/jcb.png') . '" alt="JCB" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(plugins_url('/assets/images/diners.png', dirname(__FILE__))) . '" alt="Diners" />';
}
if ($this->bitcoin) {
$icon .= '<img src="' . WC_HTTPS::force_https_url(plugins_url('/assets/images/bitcoin.png', dirname(__FILE__))) . '" alt="Bitcoin" />';
}
return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
}
示例3: get_icon
/**
* get_icon function.
*
* @access public
* @return string
*/
public function get_icon()
{
$ext = version_compare(WC()->version, '2.6', '>=') ? '.svg' : '.png';
$style = version_compare(WC()->version, '2.6', '>=') ? 'style="margin-left: 0.3em"' : '';
$icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/visa' . $ext) . '" alt="Visa" width="32" ' . $style . ' />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/mastercard' . $ext) . '" alt="Mastercard" width="32" ' . $style . ' />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/amex' . $ext) . '" alt="Amex" width="32" ' . $style . ' />';
if ('USD' === get_woocommerce_currency()) {
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/discover' . $ext) . '" alt="Discover" width="32" ' . $style . ' />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/jcb' . $ext) . '" alt="JCB" width="32" ' . $style . ' />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/diners' . $ext) . '" alt="Diners" width="32" ' . $style . ' />';
}
if ($this->bitcoin) {
$icon .= '<img src="' . WC_HTTPS::force_https_url(plugins_url('/assets/images/bitcoin' . $ext, WC_STRIPE_MAIN_FILE)) . '" alt="Bitcoin" width="32" ' . $style . ' />';
}
return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
}
示例4: force_ssl
/**
* @deprecated 2.1.0
* @param $content
* @return string
*/
public function force_ssl($content)
{
_deprecated_function('Woocommerce->force_ssl', '2.1', 'WC_HTTPS::force_https_url');
return WC_HTTPS::force_https_url($content);
}
示例5: get_icon
/**
* get_icon function.
*
* @access public
* @return string
*/
public function get_icon()
{
switch (WC()->countries->get_base_country()) {
case 'US':
$allowed = array('visa', 'mastercard', 'amex', 'discover', 'diners', 'jcb');
break;
default:
$allowed = array('visa', 'mastercard', 'amex');
break;
}
$icon = '';
foreach ($allowed as $name) {
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/' . $name . '.png') . '" alt="' . $this->cards[$name] . '" style="width:40px;" />';
}
return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
}
示例6: get_sample_check_html
/**
* Get the sample check image HTML
*
* @since 4.0.0
* @return string sample check image HTML
*/
protected function get_sample_check_html()
{
$image_url = WC_HTTPS::force_https_url($this->get_gateway()->get_plugin()->get_payment_gateway_framework_assets_url() . '/images/sample-check.png');
$html = sprintf('<div class="js-sv-wc-payment-gateway-echeck-form-sample-check" style="display: none;"><img width="541" height="270" src="%s" /></div>', esc_url($image_url));
/**
* Payment Gateway Payment Form Sample eCheck HTML.
*
* Filters the HTML rendered for the same eCheck image.
*
* @since 4.0.0
* @param string $html
* @param \SV_WC_Payment_Gateway_Payment_Form $this payment form instance
*/
return apply_filters('wc_' . $this->get_gateway()->get_id() . '_payment_form_sample_check_html', $html, $this);
}
示例7: forceSSL
/**
*
* Envia mesajes de error al checkout segun la version
* @author ivelazquex <isai.velazquez@gmail.com>
* @param $url string
* @return string
*/
private function forceSSL($url)
{
global $woocommerce;
if (class_exists('WC_HTTPS')) {
// version >= 2.3
return WC_HTTPS::force_https_url($url);
} else {
// version < 2.3
return $woocommerce->force_ssl($url);
}
}
示例8: get_icon
/**
* get_icon function.
*
* @access public
* @return string
*/
public function get_icon()
{
$icon = '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/visa.png') . '" alt="Visa" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/mastercard.png') . '" alt="Mastercard" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/discover.png') . '" alt="Discover" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/amex.png') . '" alt="Amex" />';
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/jcb.png') . '" alt="JCB" />';
return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
}
示例9: gateway_icon_create
/**
* gateway_icon_create
*
* Helper to get the a gateway icon image tag
*
* @access protected
* @return void
*/
protected function gateway_icon_create($icon, $max_height)
{
$icon_url = WC_HTTPS::force_https_url(plugin_dir_url(__FILE__) . 'assets/images/cards/' . $icon . '.png');
return '<img src="' . $icon_url . '" alt="' . esc_attr($this->get_title()) . '" style="max-height:' . $max_height . '"/>';
}
示例10: get_payment_method_image_url
public function get_payment_method_image_url($type)
{
$image_type = strtolower($type);
return WC_HTTPS::force_https_url(plugins_url('images/' . $image_type . '.jpg', __FILE__));
}
示例11: get_icon
/**
* Add selected card icons to payment method label, defaults to Visa/MC/Amex/Discover
*/
public function get_icon()
{
global $woocommerce;
$icon = '';
if ($this->icon) {
if (get_option('woocommerce_force_ssl_checkout') == 'no') {
// use icon provided by filter
$icon = '<img src="' . esc_url($this->icon) . '" alt="' . esc_attr($this->title) . '" />';
} else {
// use icon provided by filter
$icon = '<img src="' . esc_url(WC_HTTPS::force_https_url($this->icon)) . '" alt="' . esc_attr($this->title) . '" />';
}
} elseif (!empty($this->cardtypes)) {
if (get_option('woocommerce_force_ssl_checkout') == 'no') {
// display icons for the selected card types
foreach ($this->cardtypes as $card_type) {
$icon .= '<img src="' . esc_url($this->get_plugin_url() . '/assets/card-' . strtolower(str_replace(' ', '-', $card_type)) . '.png') . '" alt="' . esc_attr(strtolower($card_type)) . '" />';
}
} else {
// display icons for the selected card types
foreach ($this->cardtypes as $card_type) {
$icon .= '<img src="' . esc_url(WC_HTTPS::force_https_url($this->get_plugin_url()) . '/assets/card-' . strtolower(str_replace(' ', '-', $card_type)) . '.png') . '" alt="' . esc_attr(strtolower($card_type)) . '" />';
}
}
}
return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
}
示例12: get_icon
/**
* get_icon function.
*
* @return string
*/
public function get_icon()
{
$link = null;
switch (WC()->countries->get_base_country()) {
case 'US':
case 'NZ':
case 'CZ':
case 'HU':
case 'MY':
$icon = 'https://www.paypalobjects.com/webstatic/mktg/logo/AM_mc_vs_dc_ae.jpg';
break;
case 'TR':
$icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_paypal_odeme_secenekleri.jpg';
break;
case 'GB':
$icon = 'https://www.paypalobjects.com/webstatic/mktg/Logo/AM_mc_vs_ms_ae_UK.png';
break;
case 'MX':
$icon = array('https://www.paypal.com/es_XC/Marketing/i/banner/paypal_visa_mastercard_amex.png', 'https://www.paypal.com/es_XC/Marketing/i/banner/paypal_debit_card_275x60.gif');
$link = 'https://www.paypal.com/mx/cgi-bin/webscr?cmd=xpt/Marketing/general/WIPaypal-outside';
break;
case 'FR':
$icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_paypal_moyens_paiement_fr.jpg';
break;
case 'AU':
$icon = 'https://www.paypalobjects.com/webstatic/en_AU/mktg/logo/Solutions-graphics-1-184x80.jpg';
break;
case 'DK':
$icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_PayPal_betalingsmuligheder_dk.jpg';
break;
case 'RU':
$icon = 'https://www.paypalobjects.com/webstatic/ru_RU/mktg/business/pages/logo-center/AM_mc_vs_dc_ae.jpg';
break;
case 'NO':
$icon = 'https://www.paypalobjects.com/webstatic/mktg/logo-center/banner_pl_just_pp_319x110.jpg';
break;
case 'CA':
$icon = 'https://www.paypalobjects.com/webstatic/en_CA/mktg/logo-image/AM_mc_vs_dc_ae.jpg';
break;
case 'HK':
$icon = 'https://www.paypalobjects.com/webstatic/en_HK/mktg/logo/AM_mc_vs_dc_ae.jpg';
break;
case 'SG':
$icon = 'https://www.paypalobjects.com/webstatic/en_SG/mktg/Logos/AM_mc_vs_dc_ae.jpg';
break;
case 'TW':
$icon = 'https://www.paypalobjects.com/webstatic/en_TW/mktg/logos/AM_mc_vs_dc_ae.jpg';
break;
case 'TH':
$icon = 'https://www.paypalobjects.com/webstatic/en_TH/mktg/Logos/AM_mc_vs_dc_ae.jpg';
break;
default:
$icon = WC_HTTPS::force_https_url(WC()->plugin_url() . '/includes/gateways/paypal/assets/images/paypal.png');
$link = null;
break;
}
if (is_null($link)) {
$link = 'https://www.paypal.com/' . strtolower(WC()->countries->get_base_country()) . '/webapps/mpp/paypal-popup';
}
if (is_array($icon)) {
$icon_html = '';
foreach ($icon as $i) {
$icon_html .= '<img src="' . esc_attr($i) . '" alt="PayPal Acceptance Mark" />';
}
} else {
$icon_html = '<img src="' . esc_attr(apply_filters('woocommerce_paypal_icon', $icon)) . '" alt="PayPal Acceptance Mark" />';
}
if ($link) {
$what_is_paypal = sprintf('<a href="%1$s" class="about_paypal" onclick="javascript:window.open(\'%1$s\',\'WIPaypal\',\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700\'); return false;" title="' . esc_attr__('What is PayPal?', 'woocommerce') . '">' . esc_attr__('What is PayPal?', 'woocommerce') . '</a>', esc_url($link));
} else {
$what_is_paypal = '';
}
return apply_filters('woocommerce_gateway_icon', $icon_html . $what_is_paypal, $this->id);
}
示例13: get_icon
/**
* get_icon function.
*
* @access public
* @return string
*/
public function get_icon()
{
$icon = '<br>';
if (is_array($this->cardtypes)) {
$card_types = array_reverse($this->cardtypes);
foreach ($card_types as $card_type) {
$icon .= '<img src="' . WC_HTTPS::force_https_url(WC()->plugin_url() . '/assets/images/icons/credit-cards/' . $card_type . '.png') . '" alt="' . $card_type . '" />';
}
}
return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
}
示例14: get_icon
/**
* get_icon function.
*
* @see WC_Payment_Gateway::get_icon()
* @return string card icons
*/
public function get_icon()
{
global $wc_elavon_vm;
$icon = '';
if ($this->icon) {
// default behavior
$icon = '<img src="' . esc_url(WC_HTTPS::force_https_url($this->icon)) . '" alt="' . esc_attr($this->title) . '" />';
} elseif ($this->cardtypes) {
// display icons for the selected card types
$icon = '';
foreach ($this->cardtypes as $cardtype) {
if (file_exists(wc_elavon_vm()->get_plugin_path() . '/assets/images/card-' . strtolower($cardtype) . '.png')) {
$icon .= '<img src="' . esc_url(WC_HTTPS::force_https_url(wc_elavon_vm()->get_plugin_url() . '/assets/images/card-' . strtolower($cardtype) . '.png')) . '" alt="' . esc_attr(strtolower($cardtype)) . '" />';
}
}
}
return apply_filters('woocommerce_gateway_icon', $icon, $this->id);
}
示例15: force_https_url
/**
* Forces the provided $content url to https protocol
*
* @since 1.0
* @param string $content the url
* @return string the url with https protocol
*/
public static function force_https_url($content)
{
if (self::is_wc_version_gte_2_1()) {
return WC_HTTPS::force_https_url($content);
} else {
global $woocommerce;
return $woocommerce->force_ssl($content);
}
}