本文整理汇总了PHP中edd_get_label_plural函数的典型用法代码示例。如果您正苦于以下问题:PHP edd_get_label_plural函数的具体用法?PHP edd_get_label_plural怎么用?PHP edd_get_label_plural使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了edd_get_label_plural函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edd_show_download_sales_graph
/**
* Show Download Sales Graph
*
* @access public
* @since 1.0
* @return void
*/
function edd_show_download_sales_graph($bgcolor = 'white')
{
$downloads = get_posts(array('post_type' => 'download', 'posts_per_page' => -1));
if ($downloads) {
ob_start();
?>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
// sales chart
google.setOnLoadCallback(drawSalesChart);
function drawSalesChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', '<?php
echo edd_get_label_plural();
?>
');
data.addColumn('number', '<?php
_e("Sales", "edd");
?>
');
data.addRows([
<?php
foreach ($downloads as $download) {
?>
['<?php
echo html_entity_decode(get_the_title($download->ID), ENT_COMPAT, 'UTF-8');
?>
',
<?php
echo edd_get_download_sales_stats($download->ID);
?>
,
],
<?php
}
?>
]);
var options = {
title: "<?php
echo sprintf(__('%s Performance in Sales', 'edd'), edd_get_label_singular());
?>
",
colors:['#a3bcd3'],
fontSize: 12,
backgroundColor: '<?php
echo $bgcolor;
?>
'
};
var chart = new google.visualization.ColumnChart(document.getElementById('sales_chart_div'));
chart.draw(data, options);
}
</script>
<div id="sales_chart_div"></div>
<?php
echo ob_get_clean();
}
}
示例2: __construct
/**
* Get things started
*
* @access private
* @since 1.4
* @return void
*/
function __construct()
{
global $status, $page;
//Set parent defaults
parent::__construct(array('singular' => edd_get_label_singular(), 'plural' => edd_get_label_plural(), 'ajax' => false));
$this->get_payment_counts();
}
示例3: edd_csau_download_filters
/**
* Add Download Filters
*
* Adds cross-sell/upsell drop down filters for downloads.
*
* @since 1.0
* @return void
*/
function edd_csau_download_filters()
{
global $typenow;
// Checks if the current post type is 'download'
if ($typenow == 'download') {
$types = array('cross_sells' => sprintf(__('%s with cross-sells', 'edd-csau'), edd_get_label_plural()), 'upsells' => sprintf(__('%s with upsells', 'edd-csau'), edd_get_label_plural()), 'both' => sprintf(__('%s with cross-sells or upsells', 'edd-csau'), edd_get_label_plural()));
echo "<select name='edd_csau' id='edd_csau' class='postform'>";
echo "<option value=''>" . sprintf(__('Show all %s', 'edd-csau'), strtolower(edd_get_label_plural())) . "</option>";
foreach ($types as $key => $label) {
$args = array('post_type' => 'download', 'post_status' => 'publish');
if ('upsells' == $key) {
$args['meta_key'] = '_edd_csau_upsell_products';
} elseif ('cross_sells' == $key) {
$args['meta_key'] = '_edd_csau_cross_sell_products';
} elseif ('both' == $key) {
$args['meta_query'] = array('relation' => 'OR', array('key' => '_edd_csau_cross_sell_products'), array('key' => '_edd_csau_upsell_products'));
} else {
$meta_key = '';
}
$type = get_posts($args);
$count = count($type);
$selected = isset($_GET['edd_csau']) && $_GET['edd_csau'] == $key ? ' selected="selected"' : '';
echo '<option value="' . esc_attr($key) . '"' . $selected . '>' . esc_html($label) . ' (' . $count . ')</option>';
}
echo "</select>";
}
}
示例4: edd_setup_edd_post_types
/**
* Setup Download Post Type
*
* Registers the Downloads CPT.
*
* @access private
* @since 1.0
* @return void
*/
function edd_setup_edd_post_types()
{
$archives = true;
if (defined('EDD_DISABLE_ARCHIVE') && EDD_DISABLE_ARCHIVE == true) {
$archives = false;
}
$slug = 'downloads';
if (defined('EDD_SLUG')) {
$slug = EDD_SLUG;
}
$rewrite = array('slug' => $slug, 'with_front' => false);
if (defined('EDD_DISABLE_REWRITE') && EDD_DISABLE_REWRITE == true) {
$rewrite = false;
}
$download_labels = apply_filters('edd_download_labels', array('name' => '%2$s', 'singular_name' => '%1$s', 'add_new' => __('Add New', 'edd'), 'add_new_item' => __('Add New %1$s', 'edd'), 'edit_item' => __('Edit %1$s', 'edd'), 'new_item' => __('New %1$s', 'edd'), 'all_items' => __('All %2$s', 'edd'), 'view_item' => __('View %1$s', 'edd'), 'search_items' => __('Search %2$s', 'edd'), 'not_found' => __('No %2$s found', 'edd'), 'not_found_in_trash' => __('No %2$s found in Trash', 'edd'), 'parent_item_colon' => '', 'menu_name' => __('%2$s', 'edd')));
foreach ($download_labels as $key => $value) {
$download_labels[$key] = sprintf($value, edd_get_label_singular(), edd_get_label_plural());
}
$download_args = array('labels' => $download_labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => $rewrite, 'capability_type' => 'post', 'has_archive' => $archives, 'hierarchical' => false, 'supports' => apply_filters('edd_download_supports', array('title', 'editor', 'thumbnail')));
register_post_type('download', apply_filters('edd_download_post_type_args', $download_args));
/* payment post type */
$payment_labels = array('name' => _x('Payments', 'post type general name', 'edd'), 'singular_name' => _x('Payment', 'post type singular name', 'edd'), 'add_new' => __('Add New', 'edd'), 'add_new_item' => __('Add New Payment', 'edd'), 'edit_item' => __('Edit Payment', 'edd'), 'new_item' => __('New Payment', 'edd'), 'all_items' => __('All Payments', 'edd'), 'view_item' => __('View Payment', 'edd'), 'search_items' => __('Search Payments', 'edd'), 'not_found' => __('No Payments found', 'edd'), 'not_found_in_trash' => __('No Payments found in Trash', 'edd'), 'parent_item_colon' => '', 'menu_name' => __('Payment History', 'edd'));
$payment_args = array('labels' => apply_filters('edd_payment_labels', $payment_labels), 'public' => false, 'query_var' => false, 'rewrite' => false, 'capability_type' => 'post', 'supports' => array('title'), 'can_export' => true);
register_post_type('edd_payment', $payment_args);
/* discounts post type */
$discount_args = array('public' => false, 'query_var' => false, 'rewrite' => false, 'show_ui' => false, 'capability_type' => 'post', 'supports' => array('title'), 'can_export' => true);
register_post_type('edd_discount', $discount_args);
}
示例5: __construct
/**
* Get things started
*
* @since 1.4
* @see WP_List_Table::__construct()
*/
public function __construct()
{
global $status, $page;
// Set parent defaults
parent::__construct(array('singular' => edd_get_label_singular(), 'plural' => edd_get_label_plural(), 'ajax' => false));
add_action('edd_log_view_actions', array($this, 'downloads_filter'));
}
示例6: edd_add_download_meta_box
/**
* Add Download Meta Box
*
* @access private
* @since 1.0
* @return void
*/
function edd_add_download_meta_box()
{
add_meta_box('downloadinformation', sprintf(__('%1$s Configuration', 'edd'), edd_get_label_singular(), edd_get_label_plural()), 'edd_render_download_meta_box', 'download', 'normal', 'default');
add_meta_box('edd_download_stats', sprintf(__('%1$s Stats', 'edd'), edd_get_label_singular(), edd_get_label_plural()), 'edd_render_stats_meta_box', 'download', 'side', 'high');
add_meta_box('edd_purchase_log', __('Purchase Log', 'edd'), 'edd_render_purchase_log_meta_box', 'download', 'normal', 'default');
add_meta_box('edd_file_download_log', __('File Download Log', 'edd'), 'edd_render_download_log_meta_box', 'download', 'normal', 'default');
}
示例7: __construct
/**
* Get things started
*
* @since 1.5
* @see WP_List_Table::__construct()
*/
public function __construct()
{
global $status, $page;
// Set parent defaults
parent::__construct(array('singular' => edd_get_label_singular(), 'plural' => edd_get_label_plural(), 'ajax' => false));
add_action('edd_report_view_actions', array($this, 'category_filter'));
$this->query();
}
示例8: __construct
/**
* Constructor
*/
public function __construct()
{
$this->widget_cssclass = 'marketify_widget_featured_popular';
$this->widget_description = sprintf(__('Display featured and popular %s in sliding grid.', 'marketify'), edd_get_label_plural());
$this->widget_id = 'marketify_widget_featured_popular';
$this->widget_name = sprintf(__('Marketify - Home: Featured & Popular %s', 'marketify'), edd_get_label_plural());
$this->settings = array('featured-title' => array('type' => 'text', 'std' => 'Featured', 'label' => __('Featured Title:', 'marketify')), 'popular-title' => array('type' => 'text', 'std' => 'Popular', 'label' => __('Popular Title:', 'marketify')), 'number' => array('type' => 'number', 'step' => 1, 'min' => 1, 'max' => '', 'std' => 6, 'label' => __('Number to display:', 'marketify')), 'timeframe' => array('type' => 'select', 'std' => 'week', 'label' => __('Based on the current:', 'marketify'), 'options' => array('day' => __('Day', 'marketify'), 'week' => __('Week', 'marketify'), 'month' => __('Month', 'marketify'), 'year' => __('Year', 'marketify'))), 'scroll' => array('type' => 'checkbox', 'std' => 1, 'label' => __('Automatically scroll items', 'marketify')), 'speed' => array('type' => 'text', 'std' => 7000, 'label' => __('Slideshow Speed (ms)', 'marketify')));
parent::__construct();
}
示例9: __construct
/**
* Constructor
*/
public function __construct()
{
$this->widget_cssclass = 'marketify_widget_curated_downloads';
$this->widget_description = sprintf(__('Display curated %s in a grid.', 'marketify'), edd_get_label_plural());
$this->widget_id = 'marketify_widget_curated_downloads';
$this->widget_name = sprintf(__('Marketify - Home: Curated %s', 'marketify'), edd_get_label_plural());
$this->settings = array('title' => array('type' => 'text', 'std' => edd_get_label_plural(), 'label' => __('Title:', 'marketify')), 'ids' => array('type' => 'text', 'std' => '', 'label' => sprintf(__('%s IDs:', 'marketify'), edd_get_label_singular())), 'columns' => array('type' => 'number', 'step' => 1, 'min' => 1, 'max' => 4, 'std' => 4, 'label' => __('Number of columns:', 'marketify')), 'description' => array('type' => 'textarea', 'std' => '', 'label' => __('Description:', 'marketify')));
parent::__construct();
}
示例10: edd_cr_render_meta_box
/**
* Render metabox
*
* @since 2.0
* @global object $post The post/page we are editing
* @return void
*/
function edd_cr_render_meta_box($post_id)
{
global $post;
$downloads = get_posts(array('post_type' => 'download', 'posts_per_page' => -1));
$restricted_to = get_post_meta($post->ID, '_edd_cr_restricted_to', true);
if ($downloads) {
?>
<div id="edd-cr-options" class="edd_meta_table_wrap">
<p><strong><?php
echo sprintf(__('Restrict this content to buyers of one or more %s.', 'edd-cr'), strtolower(edd_get_label_plural()));
?>
</strong></p>
<table class="widefat edd_repeatable_table" width="100%" cellpadding="0" cellspacing="0">
<thead>
<th><?php
echo edd_get_label_singular();
?>
</th>
<th><?php
echo sprintf(__('%s Variation', 'edd-cr'), edd_get_label_singular());
?>
</th>
<?php
do_action('edd_cr_table_head', $post_id);
?>
<th style="width: 2%"></th>
</thead>
<tbody>
<?php
if (!empty($restricted_to) && is_array($restricted_to)) {
foreach ($restricted_to as $key => $value) {
echo '<tr class="edd-cr-option-wrapper edd_repeatable_row" data-key="' . absint($key) . '">';
do_action('edd_cr_render_option_row', $key, $post_id);
echo '</tr>';
}
} else {
echo '<tr class="edd-cr-option-wrapper edd_repeatable_row">';
do_action('edd_cr_render_option_row', 0, $post_id);
echo '</tr>';
}
?>
<tr>
<td class="submit" colspan="4" style="float: none; clear:both; background:#fff;">
<a class="button-secondary edd_add_repeatable" style="margin: 6px 0;"><?php
_e('Add New Download', 'edd-cr');
?>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<?php
}
}
示例11: edd_add_download_meta_box
/**
* Register all the meta boxes for the Download custom post type
*
* @since 1.0
* @return void
*/
function edd_add_download_meta_box()
{
/** Download Configuration */
add_meta_box('downloadinformation', sprintf(__('%1$s Configuration', 'edd'), edd_get_label_singular(), edd_get_label_plural()), 'edd_render_download_meta_box', 'download', 'normal', 'default');
/** Product Notes */
add_meta_box('edd_product_notes', __('Product Notes', 'edd'), 'edd_render_product_notes_meta_box', 'download', 'normal', 'default');
if (current_user_can('edit_product', get_the_ID())) {
/** Download Stats */
add_meta_box('edd_download_stats', sprintf(__('%1$s Stats', 'edd'), edd_get_label_singular(), edd_get_label_plural()), 'edd_render_stats_meta_box', 'download', 'side', 'high');
}
}
示例12: edd_email_purchase_receipt
/**
* Email Download Purchase Receipt
*
* Email the download link(s) and payment confirmation to the buyer.
*
* @access private
* @since 1.0
* @return void
*/
function edd_email_purchase_receipt($payment_id, $admin_notice = true)
{
global $edd_options;
$payment_data = edd_get_payment_meta($payment_id);
$user_info = maybe_unserialize($payment_data['user_info']);
if (isset($user_info['id']) && $user_info['id'] > 0) {
$user_data = get_userdata($user_info['id']);
$name = $user_data->display_name;
} elseif (isset($user_info['first_name']) && isset($user_info['last_name'])) {
$name = $user_info['first_name'] . ' ' . $user_info['last_name'];
} else {
$name = $user_info['email'];
}
$message = edd_get_email_body_header();
$message .= edd_get_email_body_content($payment_id, $payment_data);
$message .= edd_get_email_body_footer();
$from_name = isset($edd_options['from_name']) ? $edd_options['from_name'] : get_bloginfo('name');
$from_email = isset($edd_options['from_email']) ? $edd_options['from_email'] : get_option('admin_email');
$subject = isset($edd_options['purchase_subject']) && strlen(trim($edd_options['purchase_subject'])) > 0 ? edd_email_template_tags($edd_options['purchase_subject'], $payment_data, $payment_id) : __('Purchase Receipt', 'edd');
$headers = "From: " . stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8')) . " <{$from_email}>\r\n";
$headers .= "Reply-To: " . $from_email . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=utf-8\r\n";
// allow add-ons to add file attachments
$attachments = apply_filters('edd_receipt_attachments', array(), $payment_id, $payment_data);
wp_mail($payment_data['email'], $subject, $message, $headers, $attachments);
if ($admin_notice) {
/* send an email notification to the admin */
$admin_email = edd_get_admin_notice_emails();
$admin_subject = apply_filters('edd_admin_purchase_notification_subject', __('New download purchase', 'edd'), $payment_id, $payment_data);
$admin_message = __('Hello', 'edd') . "\n\n" . sprintf(__('A %s purchase has been made', 'edd'), edd_get_label_plural()) . ".\n\n";
$admin_message .= sprintf(__('%s sold:', 'edd'), edd_get_label_plural()) . "\n\n";
$download_list = '';
$downloads = maybe_unserialize($payment_data['downloads']);
if (is_array($downloads)) {
foreach ($downloads as $download) {
$id = isset($payment_data['cart_details']) ? $download['id'] : $download;
$download_list .= html_entity_decode(get_the_title($id), ENT_COMPAT, 'UTF-8') . "\n";
}
}
$gateway = edd_get_gateway_admin_label(get_post_meta($payment_id, '_edd_payment_gateway', true));
$admin_message .= $download_list . "\n";
$admin_message .= __('Purchased by: ', 'edd') . " " . html_entity_decode($name, ENT_COMPAT, 'UTF-8') . "\n";
$admin_message .= __('Amount: ', 'edd') . " " . html_entity_decode(edd_currency_filter(edd_format_amount($payment_data['amount'])), ENT_COMPAT, 'UTF-8') . "\n\n";
$admin_message .= __('Payment Method: ', 'edd') . " " . $gateway . "\n\n";
$admin_message .= __('Thank you', 'edd');
$admin_message = apply_filters('edd_admin_purchase_notification', $admin_message, $payment_id, $payment_data);
$admin_headers = apply_filters('edd_admin_purchase_notification_headers', array(), $payment_id, $payment_data);
$admin_attachments = apply_filters('edd_admin_purchase_notification_attachments', array(), $payment_id, $payment_data);
wp_mail($admin_email, $admin_subject, $admin_message, $admin_headers, $admin_attachments);
}
}
示例13: marketify_downloads_section_title
/**
* Custom template tags for this theme.
*
* If the function is called directly in the theme or via
* another function, it is wrapped to check if a child theme has
* redefined it. Otherwise a child theme can unhook what is being attached.
*
* @package Marketify
*/
function marketify_downloads_section_title()
{
if (is_page_template('page-templates/popular.php')) {
$cat = get_term(get_query_var('popular_cat'), 'download_category');
if (is_wp_error($cat)) {
$base = '';
} else {
$base = $cat->name;
}
printf(__('Popular %s', 'marketify'), $base);
} else {
$base = is_tax() ? single_term_title('', false) : edd_get_label_plural();
$order = get_query_var('m-orderby') ? sprintf(' ' . __('by %s', 'marketify'), marketify_edd_sorting_options(get_query_var('m-orderby'))) : '';
printf(__('All %s%s', 'marketify'), $base, $order);
}
}
示例14: kjm_render_products_field
function kjm_render_products_field($post_id)
{
$type = edd_get_download_type($post_id);
$display = $type == 'bundle' ? '' : ' style="display:none;"';
$products = edd_get_bundled_products($post_id);
?>
<div id="edd_products"<?php
echo $display;
?>
>
<div id="edd_file_fields" class="edd_meta_table_wrap">
<table class="widefat" width="100%" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th><?php
printf(__('Bundled %s:', 'easy-digital-downloads'), edd_get_label_plural());
?>
</th>
<?php
do_action('edd_download_products_table_head', $post_id);
?>
</tr>
</thead>
<tbody>
<tr class="edd_repeatable_product_wrapper">
<td>
<?php
echo EDD()->html->product_dropdown(array('name' => '_edd_bundled_products[]', 'id' => 'edd_bundled_products', 'selected' => $products, 'multiple' => true, 'chosen' => true, 'bundles' => false, 'number' => 2));
?>
</td>
<?php
do_action('edd_download_products_table_row', $post_id);
?>
</tr>
</tbody>
</table>
</div>
</div>
<?php
}
示例15: edd_wl_add_meta_box
/**
* Metabox
*
* @since 1.0
*/
function edd_wl_add_meta_box()
{
if (current_user_can('view_shop_reports') || current_user_can('edit_product', get_the_ID())) {
add_meta_box('edd_wish_list_products', sprintf(__('%1$s', 'edd'), edd_get_label_plural()), 'edd_wl_items_in_list_meta_box', 'edd_wish_list', 'normal', 'high');
}
}