本文整理汇总了PHP中wc_help_tip函数的典型用法代码示例。如果您正苦于以下问题:PHP wc_help_tip函数的具体用法?PHP wc_help_tip怎么用?PHP wc_help_tip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wc_help_tip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dd_select_colvariants_products
function dd_select_colvariants_products()
{
global $post, $woocommerce;
$product_ids = array_filter(array_map('absint', (array) get_post_meta($post->ID, '_colvariants_ids', true)));
?>
<div class="options_group">
<p class="form-field">
<label for="colvariants_ids"><?php
_e('Color Variants', 'woocommerce');
?>
</label>
<input type="hidden" class="wc-product-search" style="width: 50%;" id="colvariants_ids" name="colvariants_ids" data-placeholder="<?php
_e('Search for a product…', 'woocommerce');
?>
" data-action="woocommerce_json_search_products" data-multiple="true" data-selected="<?php
$json_ids = array();
foreach ($product_ids as $product_id) {
$product = wc_get_product($product_id);
if (is_object($product)) {
$json_ids[$product_id] = wp_kses_post(html_entity_decode($product->get_formatted_name(), ENT_QUOTES, get_bloginfo('charset')));
}
}
echo esc_attr(json_encode($json_ids));
?>
" value="<?php
echo implode(',', array_keys($json_ids));
?>
" /> <?php
echo wc_help_tip(__('Color variants are products which are diplayed and linked on product page as a color selector field. Please included current color variant also.', 'dd'));
?>
</p>
</div>
<?php
}
示例2: wc_help_tip
/**
* Display a WooCommerce help tip.
*
* @since 1.0.4
*
* @param string $tip
* @return string
*/
public static function wc_help_tip($tip)
{
if (self::is_wc_version_gte_2_5()) {
return wc_help_tip($tip);
} else {
return '<img class="help_tip woocommerce-help-tip" data-tip="' . $tip . '" src="' . WC()->plugin_url() . '/assets/images/help.png" />';
}
}
开发者ID:seb86,项目名称:woocommerce-subscribe-to-all-the-things,代码行数:16,代码来源:class-wcsatt-core-compatibility.php
示例3: wc_help_tip
/**
* Backports wc_help_tip() to WC 2.4/2.3
*
* @link https://github.com/woothemes/woocommerce/pull/9417
*
* @since 4.2.0
* @param string $tip help tip content, HTML allowed if $has_html is true
* @param bool $has_html false by default, true to indicate tip content has HTML
* @return string help tip HTML, a <span> in WC 2.5, <img> in WC 2.4/2.3
*/
public static function wc_help_tip($tip, $has_html = false)
{
if (self::is_wc_version_gte_2_5()) {
return wc_help_tip($tip, $has_html);
} else {
$tip = $has_html ? wc_sanitize_tooltip($tip) : esc_attr($tip);
return sprintf('<img class="help_tip" data-tip="%1$s" src="%2$s" height="16" width="16" />', $tip, esc_url(WC()->plugin_url()) . '/assets/images/help.png');
}
}
示例4: wc_price
:</td>
<td class="total">
<?php
echo wc_price($order->get_total_discount(), array('currency' => $order->get_order_currency()));
?>
</td>
<td width="1%"></td>
</tr>
<?php
do_action('woocommerce_admin_order_totals_after_discount', $order->id);
?>
<tr>
<td class="label"><?php
echo wc_help_tip(__('This is the shipping and handling total costs for the order.', 'woocommerce'));
?>
<?php
_e('Shipping', 'woocommerce');
?>
:</td>
<td class="total"><?php
if (($refunded = $order->get_total_shipping_refunded()) > 0) {
echo '<del>' . strip_tags(wc_price($order->get_total_shipping(), array('currency' => $order->get_order_currency()))) . '</del> <ins>' . wc_price($order->get_total_shipping() - $refunded, array('currency' => $order->get_order_currency())) . '</ins>';
} else {
echo wc_price($order->get_total_shipping(), array('currency' => $order->get_order_currency()));
}
?>
</td>
<td width="1%"></td>
</tr>
示例5: __
if (!current_theme_supports('woocommerce') && !in_array($active_theme->template, wc_get_core_supported_themes())) {
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . __('Not Declared', 'woocommerce') . '</mark>';
} else {
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
}
?>
</td>
</tr>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0">
<thead>
<tr>
<th colspan="3" data-export-label="Templates"><h2><?php
_e('Templates', 'woocommerce');
echo wc_help_tip(__('This section shows any files that are overriding the default WooCommerce template pages.', 'woocommerce'));
?>
</h2></th>
</tr>
</thead>
<tbody>
<?php
if (file_exists(get_stylesheet_directory() . '/woocommerce.php') || file_exists(get_template_directory() . '/woocommerce.php')) {
?>
<tr>
<td data-export-label="Overrides"><?php
_e('Archive Template', 'woocommerce');
?>
:</td>
<td class="help"> </td>
<td><?php
示例6: esc_attr
]" value="<?php
if (isset($_download_limit)) {
echo esc_attr($_download_limit);
}
?>
" placeholder="<?php
esc_attr_e('Unlimited', 'woocommerce');
?>
" step="1" min="0" />
</p>
<p class="form-row form-row-last">
<label><?php
_e('Download expiry', 'woocommerce');
?>
<?php
echo wc_help_tip(__('Enter the number of days before a download link expires, or leave blank.', 'woocommerce'));
?>
</a></label>
<input type="number" size="5" name="variable_download_expiry[<?php
echo $loop;
?>
]" value="<?php
if (isset($_download_expiry)) {
echo esc_attr($_download_expiry);
}
?>
" placeholder="<?php
esc_attr_e('Unlimited', 'woocommerce');
?>
" step="1" min="0" />
</p>
示例7: output
/**
* Output the metabox.
*/
public static function output($post)
{
global $post;
$args = array('post_id' => $post->ID, 'orderby' => 'comment_ID', 'order' => 'DESC', 'approve' => 'approve', 'type' => 'order_note');
remove_filter('comments_clauses', array('WC_Comments', 'exclude_order_comments'), 10, 1);
$notes = get_comments($args);
add_filter('comments_clauses', array('WC_Comments', 'exclude_order_comments'), 10, 1);
echo '<ul class="order_notes">';
if ($notes) {
foreach ($notes as $note) {
$note_classes = get_comment_meta($note->comment_ID, 'is_customer_note', true) ? array('customer-note', 'note') : array('note');
$note_classes = apply_filters('woocommerce_order_note_class', $note_classes, $note);
?>
<li rel="<?php
echo absint($note->comment_ID);
?>
" class="<?php
echo esc_attr(implode(' ', $note_classes));
?>
">
<div class="note_content">
<?php
echo wpautop(wptexturize(wp_kses_post($note->comment_content)));
?>
</div>
<p class="meta">
<abbr class="exact-date" title="<?php
echo $note->comment_date;
?>
"><?php
printf(__('added on %1$s at %2$s', 'woocommerce'), date_i18n(wc_date_format(), strtotime($note->comment_date)), date_i18n(wc_time_format(), strtotime($note->comment_date)));
?>
</abbr>
<?php
if ($note->comment_author !== __('WooCommerce', 'woocommerce')) {
printf(' ' . __('by %s', 'woocommerce'), $note->comment_author);
}
?>
<a href="#" class="delete_note"><?php
_e('Delete note', 'woocommerce');
?>
</a>
</p>
</li>
<?php
}
} else {
echo '<li>' . __('There are no notes yet.', 'woocommerce') . '</li>';
}
echo '</ul>';
?>
<div class="add_note">
<h4><?php
_e('Add note', 'woocommerce');
?>
<?php
echo wc_help_tip(__('Add a note for your reference, or add a customer note (the user will be notified).', 'woocommerce'));
?>
</h4>
<p>
<textarea type="text" name="order_note" id="add_order_note" class="input-text" cols="20" rows="5"></textarea>
</p>
<p>
<select name="order_note_type" id="order_note_type">
<option value=""><?php
_e('Private note', 'woocommerce');
?>
</option>
<option value="customer"><?php
_e('Note to customer', 'woocommerce');
?>
</option>
</select>
<a href="#" class="add_note button"><?php
_e('Add', 'woocommerce');
?>
</a>
</p>
</div>
<?php
}
示例8: color_picker
/**
* Output a colour picker input box.
*
* @param mixed $name
* @param string $id
* @param mixed $value
* @param string $desc (default: '')
*/
public function color_picker($name, $id, $value, $desc = '')
{
echo '<div class="color_box">' . wc_help_tip($desc) . '
<input name="' . esc_attr($id) . '" id="' . esc_attr($id) . '" type="text" value="' . esc_attr($value) . '" class="colorpick" /> <div id="colorPickerDiv_' . esc_attr($id) . '" class="colorpickdiv"></div>
</div>';
}
示例9: esc_attr
echo esc_attr($user_string);
?>
" value="<?php
echo esc_attr($user_id);
?>
" data-allow_clear="true" />
</td>
</tr>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="key_permissions"><?php
_e('Permissions', 'woocommerce');
?>
</label>
<?php
echo wc_help_tip(__('Select the access type of these keys.', 'woocommerce'));
?>
</th>
<td class="forminp">
<select id="key_permissions" class="wc-enhanced-select">
<?php
$permissions = array('read' => __('Read', 'woocommerce'), 'write' => __('Write', 'woocommerce'), 'read_write' => __('Read/Write', 'woocommerce'));
foreach ($permissions as $permission_id => $permission_name) {
?>
<option value="<?php
echo esc_attr($permission_id);
?>
" <?php
selected($key_data['permissions'], $permission_id, true);
?>
><?php
示例10: esc_attr
</th>
<td class="forminp">
<input name="webhook_delivery_url" id="webhook_delivery_url" type="text" class="input-text regular-input" value="<?php
echo esc_attr($webhook->get_delivery_url());
?>
" />
</td>
</tr>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="webhook_secret"><?php
_e('Secret', 'woocommerce');
?>
</label>
<?php
echo wc_help_tip(__('The Secret Key is used to generate a hash of the delivered webhook and provided in the request headers. This will default to the current API user\'s consumer secret if not provided.', 'woocommerce'));
?>
</th>
<td class="forminp">
<input name="webhook_secret" id="webhook_secret" type="text" class="input-text regular-input" value="<?php
echo esc_attr($webhook->get_secret());
?>
" />
</td>
</tr>
</tbody>
</table>
<?php
do_action('woocommerce_webhook_options');
?>
示例11: esc_attr
</th>
<td class="forminp">
<input name="webhook_delivery_url" id="webhook_delivery_url" type="text" class="input-text regular-input" value="<?php
echo esc_attr($webhook->get_delivery_url());
?>
" />
</td>
</tr>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="webhook_secret"><?php
_e('Secret', 'woocommerce');
?>
</label>
<?php
echo wc_help_tip(__('The Secret Key is used to generate a hash of the delivered webhook and provided in the request headers.', 'woocommerce'));
?>
</th>
<td class="forminp">
<input name="webhook_secret" id="webhook_secret" type="text" class="input-text regular-input" value="<?php
echo esc_attr($webhook->get_secret());
?>
" />
</td>
</tr>
</tbody>
</table>
<?php
do_action('woocommerce_webhook_options');
?>
示例12: get_main_chart
/**
* Get the main chart.
*
* @return string
*/
public function get_main_chart()
{
$query_data = array('_order_tax' => array('type' => 'meta', 'function' => 'SUM', 'name' => 'tax_amount'), '_order_shipping_tax' => array('type' => 'meta', 'function' => 'SUM', 'name' => 'shipping_tax_amount'), '_order_total' => array('type' => 'meta', 'function' => 'SUM', 'name' => 'total_sales'), '_order_shipping' => array('type' => 'meta', 'function' => 'SUM', 'name' => 'total_shipping'), 'ID' => array('type' => 'post_data', 'function' => 'COUNT', 'name' => 'total_orders', 'distinct' => true), 'post_date' => array('type' => 'post_data', 'function' => '', 'name' => 'post_date'));
$tax_rows_orders = $this->get_order_report_data(array('data' => $query_data, 'group_by' => $this->group_by_query, 'order_by' => 'post_date ASC', 'query_type' => 'get_results', 'filter_range' => true, 'order_types' => wc_get_order_types('sales-reports'), 'order_status' => array('completed', 'processing', 'on-hold')));
$tax_rows_partial_refunds = $this->get_order_report_data(array('data' => $query_data, 'group_by' => $this->group_by_query, 'order_by' => 'post_date ASC', 'query_type' => 'get_results', 'filter_range' => true, 'order_types' => array('shop_order_refund'), 'parent_order_status' => array('completed', 'processing', 'on-hold')));
// Merge
$tax_rows = array();
foreach ($tax_rows_orders as $tax_row) {
$key = date($this->chart_groupby == 'month' ? 'Ym' : 'Ymd', strtotime($tax_row->post_date));
$tax_rows[$key] = isset($tax_rows[$key]) ? $tax_rows[$key] : (object) array('tax_amount' => 0, 'shipping_tax_amount' => 0, 'total_sales' => 0, 'total_shipping' => 0, 'total_orders' => 0);
$tax_rows[$key]->tax_amount += $tax_row->tax_amount;
$tax_rows[$key]->shipping_tax_amount += $tax_row->shipping_tax_amount;
$tax_rows[$key]->total_sales += $tax_row->total_sales;
$tax_rows[$key]->total_shipping += $tax_row->total_shipping;
$tax_rows[$key]->total_orders += $tax_row->total_orders;
}
foreach ($tax_rows_partial_refunds as $tax_row) {
$key = date($this->chart_groupby == 'month' ? 'Ym' : 'Ymd', strtotime($tax_row->post_date));
$tax_rows[$key] = isset($tax_rows[$key]) ? $tax_rows[$key] : (object) array('tax_amount' => 0, 'shipping_tax_amount' => 0, 'total_sales' => 0, 'total_shipping' => 0, 'total_orders' => 0);
$tax_rows[$key]->tax_amount += $tax_row->tax_amount;
$tax_rows[$key]->shipping_tax_amount += $tax_row->shipping_tax_amount;
$tax_rows[$key]->total_sales += $tax_row->total_sales;
$tax_rows[$key]->total_shipping += $tax_row->total_shipping;
}
?>
<table class="widefat">
<thead>
<tr>
<th><?php
_e('Period', 'woocommerce');
?>
</th>
<th class="total_row"><?php
_e('Number of Orders', 'woocommerce');
?>
</th>
<th class="total_row"><?php
_e('Total Sales', 'woocommerce');
?>
<?php
echo wc_help_tip(__("This is the sum of the 'Order Total' field within your orders.", 'woocommerce'));
?>
</th>
<th class="total_row"><?php
_e('Total Shipping', 'woocommerce');
?>
<?php
echo wc_help_tip(__("This is the sum of the 'Shipping Total' field within your orders.", 'woocommerce'));
?>
</th>
<th class="total_row"><?php
_e('Total Tax', 'woocommerce');
?>
<?php
echo wc_help_tip(__('This is the total tax for the rate (shipping tax + product tax).', 'woocommerce'));
?>
</th>
<th class="total_row"><?php
_e('Net profit', 'woocommerce');
?>
<?php
echo wc_help_tip(__("Total sales minus shipping and tax.", 'woocommerce'));
?>
</th>
</tr>
</thead>
<?php
if (!empty($tax_rows)) {
?>
<tbody>
<?php
foreach ($tax_rows as $date => $tax_row) {
$gross = $tax_row->total_sales - $tax_row->total_shipping;
$total_tax = $tax_row->tax_amount + $tax_row->shipping_tax_amount;
?>
<tr>
<th scope="row"><?php
if ($this->chart_groupby == 'month') {
echo date_i18n('F', strtotime($date . '01'));
} else {
echo date_i18n(get_option('date_format'), strtotime($date));
}
?>
</th>
<td class="total_row"><?php
echo $tax_row->total_orders;
?>
</td>
<td class="total_row"><?php
echo wc_price($gross);
?>
</td>
<td class="total_row"><?php
echo wc_price($tax_row->total_shipping);
?>
//.........这里部分代码省略.........
示例13: _e
</label>
<table class="widefat">
<thead>
<div>
<th><?php
_e('Name', 'woocommerce');
?>
<?php
echo wc_help_tip(__('This is the name of the download shown to the customer.', 'woocommerce'));
?>
</th>
<th colspan="2"><?php
_e('File URL', 'woocommerce');
?>
<?php
echo wc_help_tip(__('This is the URL or absolute path to the file which customers will get access to. URLs entered here should already be encoded.', 'woocommerce'));
?>
</th>
<th> </th>
</div>
</thead>
<tbody>
<?php
if ($downloads = $variation_object->get_downloads('edit')) {
foreach ($downloads as $key => $file) {
include 'html-product-variation-download.php';
}
}
?>
</tbody>
<tfoot>
示例14: wc_help_tip
</span>
<?php
echo wc_help_tip(__('LxWxH in decimal form', 'woocommerce'));
?>
</p><?php
}
do_action('woocommerce_product_options_dimensions');
?>
</div>
<div class="options_group">
<?php
$args = array('taxonomy' => 'product_shipping_class', 'hide_empty' => 0, 'show_option_none' => __('No shipping class', 'woocommerce'), 'name' => 'product_shipping_class', 'id' => 'product_shipping_class', 'selected' => $product_object->get_shipping_class_id('edit'), 'class' => 'select short');
?>
<p class="form-field dimensions_field">
<label for="product_shipping_class"><?php
_e('Shipping class', 'woocommerce');
?>
</label>
<?php
wp_dropdown_categories($args);
?>
<?php
echo wc_help_tip(__('Shipping classes are used by certain shipping methods to group similar products.', 'woocommerce'));
?>
</p><?php
do_action('woocommerce_product_options_shipping');
?>
</div>
</div>
示例15: admin_options
//.........这里部分代码省略.........
<img src="<?php
echo plugins_url('../assets/images/payments/master-card.png', __FILE__);
?>
" />
<img src="<?php
echo plugins_url('../assets/images/payments/discover.png', __FILE__);
?>
" />
<img src="<?php
echo plugins_url('../assets/images/payments/american-express.png', __FILE__);
?>
" />
<img src="<?php
echo plugins_url('../assets/images/payments/paypal.png', __FILE__);
?>
" />
</div>
</div>
<?php
if (empty($this->merchant_access_token)) {
?>
<p class='paypal-braintree-admin-connect-prompt'>
<?php
echo esc_html('Connect with Braintree to start accepting credit and debit card payments in your checkout.', 'woocommerce-gateway-paypal-braintree');
?>
<br/>
<a href="https://www.braintreepayments.com/partners/learn-more" target="_blank">
<?php
echo esc_html('Learn more', 'woocommerce-gateway-paypal-braintree');
?>
</a>
</p>
<?php
}
?>
<table class="form-table">
<tbody>
<tr>
<th>
<?php
_e('Connect/Disconnect', 'woocommerce-gateway-paypal-braintree');
?>
<?php
$connect_help_tip = __('Click button to create an account with Braintree and start transacting.', 'woocommerce-gateway-paypal-braintree');
if (!empty($this->merchant_access_token)) {
$connect_help_tip = sprintf('%s<br><br>%s<br><br>%s', __('You just connected your Braintree account to WooCommerce. You can start taking payments now.', 'woocommerce-gateway-paypal-braintree'), __('Once you have processed a payment, PayPal will review your application for final approval. Before you ship any goods make sure you have received a final approval for your Braintree account.', 'woocommerce-gateway-paypal-braintree'), __('Questions? We are a phone call away: 1-855-489-0345.', 'woocommerce-gateway-paypal-braintree'));
}
echo wc_help_tip($connect_help_tip);
?>
</th>
<td>
<?php
if (!empty($this->merchant_access_token)) {
?>
<a href="<?php
echo esc_attr($disconnect_url);
?>
" class='button-primary'>
<?php
echo esc_html__('Disconnect from PayPal Powered by Braintree', 'woocommerce-gateway-paypal-braintree');
?>
</a>
<?php
} else {
?>
<a href="<?php
echo esc_attr($production_connect_url);
?>
">
<img src="<?php
echo plugins_url('../assets/images/button/connect-braintree.png', __FILE__);
?>
"/>
</a>
<br/>
<br/>
<a href="<?php
echo esc_attr($sandbox_connect_url);
?>
">
<?php
echo esc_html__('Not ready to accept live payments? Click here to connect using sandbox mode.', 'woocommerce-gateway-paypal-braintree');
?>
</a>
<?php
}
?>
</td>
</tr>
</tbody>
</table>
<table class="form-table">
<?php
$this->generate_settings_html();
?>
</table>
<?php
}