当前位置: 首页>>代码示例>>PHP>>正文


PHP edd_get_total_earnings函数代码示例

本文整理汇总了PHP中edd_get_total_earnings函数的典型用法代码示例。如果您正苦于以下问题:PHP edd_get_total_earnings函数的具体用法?PHP edd_get_total_earnings怎么用?PHP edd_get_total_earnings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了edd_get_total_earnings函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: heartbeat_received

 /**
  * Tie into the heartbeat and append our stats
  *
  * @access public
  * @since 1.8
  * @return array
  */
 public static function heartbeat_received($response, $data)
 {
     if (!current_user_can('view_shop_reports')) {
         return $response;
         // Only modify heartbeat if current user can view show reports
     }
     // Make sure we only run our query if the edd_heartbeat key is present
     if (isset($data['edd_heartbeat']) && $data['edd_heartbeat'] == 'dashboard_summary') {
         // Instantiate the stats class
         $stats = new EDD_Payment_Stats();
         $earnings = edd_get_total_earnings();
         // Send back the number of complete payments
         $response['edd-total-payments'] = edd_format_amount(edd_get_total_sales(), false);
         $response['edd-total-earnings'] = html_entity_decode(edd_currency_filter(edd_format_amount($earnings)), ENT_COMPAT, 'UTF-8');
         $response['edd-payments-month'] = edd_format_amount($stats->get_sales(0, 'this_month', false, array('publish', 'revoked')), false);
         $response['edd-earnings-month'] = html_entity_decode(edd_currency_filter(edd_format_amount($stats->get_earnings(0, 'this_month'))), ENT_COMPAT, 'UTF-8');
         $response['edd-payments-today'] = edd_format_amount($stats->get_sales(0, 'today', false, array('publish', 'revoked')), false);
         $response['edd-earnings-today'] = html_entity_decode(edd_currency_filter(edd_format_amount($stats->get_earnings(0, 'today'))), ENT_COMPAT, 'UTF-8');
     }
     return $response;
 }
开发者ID:Balamir,项目名称:Easy-Digital-Downloads,代码行数:28,代码来源:class-edd-heartbeat.php

示例2: get_default_earnings_stats

 /**
  * Generate the default earnings stats returned by the 'stats' endpoint
  *
  * @access private
  * @since 1.5.3
  * @return array default earnings statistics
  */
 private function get_default_earnings_stats()
 {
     // Default earnings return
     $earnings = array();
     $earnings['earnings']['today'] = $this->stats->get_earnings(0, 'today');
     $earnings['earnings']['current_month'] = $this->stats->get_earnings(0, 'this_month');
     $earnings['earnings']['last_month'] = $this->stats->get_earnings(0, 'last_month');
     $earnings['earnings']['totals'] = edd_get_total_earnings();
     return $earnings;
 }
开发者ID:jplhomer,项目名称:Easy-Digital-Downloads,代码行数:17,代码来源:class-edd-api.php

示例3: edd_load_dashboard_sales_widget


//.........这里部分代码省略.........
							<?php 
    _e('Sales', 'edd');
    ?>
						</td>
						<td class="last b b-sales">
							<?php 
    $sales_today = $stats->get_sales(0, 'today', false, array('publish', 'revoked'));
    ?>
							<?php 
    echo edd_format_amount($sales_today, false);
    ?>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="table table_right table_totals">
			<table>
				<thead>
					<tr>
						<td colspan="2"><?php 
    _e('Totals', 'edd');
    ?>
</td>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="t earnings"><?php 
    _e('Total Earnings', 'edd');
    ?>
</td>
						<td class="last b b-earnings"><?php 
    echo edd_currency_filter(edd_format_amount(edd_get_total_earnings()));
    ?>
</td>
					</tr>
					<tr>
						<td class="t sales"><?php 
    _e('Total Sales', 'edd');
    ?>
</td>
						<td class="last b b-sales"><?php 
    echo edd_format_amount(edd_get_total_sales(), false);
    ?>
</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div style="clear: both"></div>
		<?php 
    do_action('edd_sales_summary_widget_after_stats', $stats);
    ?>
		<?php 
    $p_query = new EDD_Payments_Query(array('number' => 5, 'status' => 'publish'));
    $payments = $p_query->get_payments();
    if ($payments) {
        ?>
		<div class="table recent_purchases">
			<table>
				<thead>
					<tr>
						<td colspan="2">
							<?php 
        _e('Recent Purchases', 'edd');
开发者ID:nitun,项目名称:Easy-Digital-Downloads,代码行数:67,代码来源:dashboard-widgets.php

示例4: edd_decrease_total_earnings

/**
 * Decrease the Total Earnings
 *
 * @since 1.8.4
 * @param $amount int The amount you would like to decrease the total earnings by.
 * @return float $total Total earnings
 */
function edd_decrease_total_earnings($amount = 0)
{
    $total = edd_get_total_earnings();
    $total -= $amount;
    if ($total < 0) {
        $total = 0;
    }
    update_option('edd_earnings_total', $total);
    return $total;
}
开发者ID:ankitpokhrel,项目名称:Easy-Digital-Downloads,代码行数:17,代码来源:functions.php

示例5: edd_dashboard_sales_widget

/**
 * Sales Summary Dashboard Widget
 *
 * Builds and renders the Sales Summary dashboard widget. This widget displays
 * the current month's sales and earnings, total sales and earnings best selling
 * downloads as well as recent purchases made on your EDD Store.
 *
 * @author Sunny Ratilal
 * @since 1.2.2
 * @return void
 */
function edd_dashboard_sales_widget()
{
    $top_selling_args = array('post_type' => 'download', 'posts_per_page' => 1, 'post_status' => 'publish', 'meta_key' => '_edd_download_sales', 'meta_compare' => '>', 'meta_value' => 0, 'orderby' => 'meta_value_num', 'update_post_term_cache' => false, 'order' => 'DESC');
    $top_selling = get_posts($top_selling_args);
    ?>
	<div class="edd_dashboard_widget">
		<div class="table table_left table_current_month">
			<p class="sub"><?php 
    _e('Current Month', 'edd');
    ?>
</p>
			<table>
				<tbody>
					<tr class="first">
						<td class="first b"><?php 
    echo edd_currency_filter(edd_format_amount(edd_get_earnings_by_date(null, date('n'), date('Y'))));
    ?>
</td>
						<td class="t monthly_earnings"><?php 
    _e('Earnings', 'edd');
    ?>
</td>
					</tr>
					<tr>
						<?php 
    $monthly_sales = edd_get_sales_by_date(null, date('n'), date('Y'));
    ?>
						<td class="first b"><?php 
    echo $monthly_sales;
    ?>
</td>
						<td class="t monthly_sales"><?php 
    echo _n('Sale', 'Sales', $monthly_sales, 'edd');
    ?>
</td>
					</tr>
				</tbody>
			</table>
			<p class="label_heading"><?php 
    _e('Last Month', 'edd');
    ?>
</p>
			<?php 
    $previous_month = date('n') == 1 ? 12 : date('n') - 1;
    $previous_year = $previous_month == 12 ? date('Y') - 1 : date('Y');
    ?>
			<div>
				<?php 
    echo __('Earnings', 'edd') . ':&nbsp;<span class="edd_price_label">' . edd_currency_filter(edd_format_amount(edd_get_earnings_by_date(null, $previous_month, $previous_year))) . '</span>';
    ?>
			</div>
			<div>
				<?php 
    $last_month_sales = edd_get_sales_by_date(null, $previous_month, $previous_year);
    ?>
				<?php 
    echo _n('Sale', 'Sales', $last_month_sales, 'edd') . ':&nbsp;' . '<span class="edd_price_label">' . $last_month_sales . '</span>';
    ?>
			</div>
		</div>
		<div class="table table_right table_totals">
			<p class="sub"><?php 
    _e('Totals', 'edd');
    ?>
</p>
			<table>
				<tbody>
					<tr class="first">
						<td class="b b-earnings"><?php 
    echo edd_currency_filter(edd_format_amount(edd_get_total_earnings()));
    ?>
</td>
						<td class="last t earnings"><?php 
    _e('Total Earnings', 'edd');
    ?>
</td>
					</tr>
					<tr>
						<td class="b b-sales"><?php 
    echo edd_get_total_sales();
    ?>
</td>
						<td class="last t sales"><?php 
    _e('Total Sales', 'edd');
    ?>
</td>
					</tr>
				</tbody>
			</table>
//.........这里部分代码省略.........
开发者ID:bangtienmanh,项目名称:Easy-Digital-Downloads,代码行数:101,代码来源:dashboard-widgets.php

示例6: get_default_earnings_stats

 /**
  * Generate the default earnings stats returned by the 'stats' endpoint
  *
  * @access private
  * @since 1.5.3
  * @return array default eranings statistics
  */
 private function get_default_earnings_stats()
 {
     // Default earnings return
     $previous_month = date('n') == 1 ? 12 : date('n') - 1;
     $previous_year = date('n') == 1 ? date('Y') - 1 : date('Y');
     $earnings['earnings']['current_month'] = edd_get_earnings_by_date(null, date('n'), date('Y'));
     $earnings['earnings']['last_month'] = edd_get_earnings_by_date(null, $previous_month, $previous_year);
     $earnings['earnings']['totals'] = edd_get_total_earnings();
     return $earnings;
 }
开发者ID:bangtienmanh,项目名称:Easy-Digital-Downloads,代码行数:17,代码来源:class-edd-api.php

示例7: edd_dashboard_sales_widget

/**
 * Sales Summary Dashboard Widget
 *
 * @access      private
 * @author      Sunny Ratilal
 * @since       1.2.2
*/
function edd_dashboard_sales_widget()
{
    $top_selling_args = array('post_type' => 'download', 'posts_per_page' => 1, 'post_status' => 'publish', 'meta_key' => '_edd_download_sales', 'meta_compare' => '>', 'meta_value' => 0, 'orderby' => 'meta_value_num', 'cache_results' => false, 'update_post_term_cache' => false, 'no_found_rows' => true, 'order' => 'DESC');
    $top_selling = get_posts($top_selling_args);
    ?>
	<div class="table table_current_month">
		<p class="sub"><?php 
    _e('Current Month', 'edd');
    ?>
</p>
		<table>
			<tbody>
				<tr class="first">
					<td class="first b"><?php 
    echo edd_currency_filter(edd_format_amount(edd_get_earnings_by_date(null, date('n'), date('Y'))));
    ?>
</td>
					<td class="t monthly_earnings"><?php 
    _e('Earnings', 'edd');
    ?>
</td>
				</tr>
				<tr>
					<?php 
    $monthly_sales = edd_get_sales_by_date(null, date('n'), date('Y'));
    ?>
					<td class="first b"><?php 
    echo $monthly_sales;
    ?>
</td>
					<td class="t monthly_sales"><?php 
    echo _n('Sale', 'Sales', $monthly_sales, 'edd');
    ?>
</td>
				</tr>
			</tbody>
		</table>
		<p class="label_heading"><?php 
    _e('Last Month', 'edd');
    ?>
</p>
		<div>
			<?php 
    echo __('Earnings', 'edd') . ':&nbsp;<span class="edd_price_label">' . edd_currency_filter(edd_format_amount(edd_get_earnings_by_date(null, date('n') - 1, date('Y')))) . '</span>';
    ?>
		</div>
		<div>
			<?php 
    $last_month_sales = edd_get_sales_by_date(null, date('n') - 1, date('Y'));
    ?>
			<?php 
    echo _n('Sale', 'Sales', $last_month_sales, 'edd') . ':&nbsp;' . '<span class="edd_price_label">' . $last_month_sales . '</span>';
    ?>
		</div>
	</div>
	<div class="table table_totals">
		<p class="sub"><?php 
    _e('Totals', 'edd');
    ?>
</p>
		<table>
			<tbody>
				<tr class="first">
					<td class="b b-earnings"><?php 
    echo edd_currency_filter(edd_format_amount(edd_get_total_earnings()));
    ?>
</td>
					<td class="last t earnings"><?php 
    _e('Total Earnings', 'edd');
    ?>
</td>
				</tr>
				<tr>
					<td class="b b-sales"><?php 
    echo edd_get_total_sales();
    ?>
</td>
					<td class="last t sales"><?php 
    _e('Total Sales', 'edd');
    ?>
</td>
				</tr>
			</tbody>
		</table>
		<?php 
    if ($top_selling) {
        foreach ($top_selling as $list) {
            ?>
				<p class="lifetime_best_selling label_heading"><?php 
            _e('Lifetime Best Selling', 'edd');
            ?>
</p>
				<p><span class="lifetime_best_selling_label"><?php 
//.........这里部分代码省略.........
开发者ID:vheidari,项目名称:Easy-Digital-Downloads,代码行数:101,代码来源:dashboard-widgets.php

示例8: _e

		
			<div class="last-widget">
				<?php 
if (fundify_is_crowdfunding()) {
    ?>
				<h3><?php 
    _e('Get the Stats', 'fundify');
    ?>
</h3>
				<ul>
					<li><?php 
    printf('<strong>%s</strong> %s', wp_count_posts('download')->publish, _n(edd_get_label_singular(), edd_get_label_plural(), wp_count_posts('download')->publish));
    ?>
</li>
					<li><?php 
    printf(__('<strong>%s</strong> Funded', 'fundify'), edd_currency_filter(edd_format_amount(edd_get_total_earnings())));
    ?>
</li>
				</ul>
				<?php 
}
?>

				<div class="copy">
					<a href="<?php 
echo home_url();
?>
">
						<img src="<?php 
echo esc_url(fundify_theme_mod('footer_logo_image'));
?>
开发者ID:ajeremias,项目名称:fundify-child,代码行数:30,代码来源:footer.php

示例9: edd_payment_history_page


//.........这里部分代码省略.........
                ?>
											<div class="purchase-key-wrap">
												<h4><?php 
                _e('Purchase Key', 'edd');
                ?>
</h4>
												<span class="purchase-key"><?php 
                echo $payment_meta['key'];
                ?>
</span>
											</div>
											<p><a id="edd-close-purchase-details" class="button-secondary" onclick="tb_remove();" title="<?php 
                _e('Close', 'edd');
                ?>
"><?php 
                _e('Close', 'edd');
                ?>
</a></p>
										</div>
									</td>
									<td style="text-transform:uppercase;"><?php 
                echo edd_currency_filter($payment_meta['amount']);
                ?>
</td>
									<td><?php 
                echo date(apply_filters('edd_payments_page_date_format', get_option('date_format')), strtotime($payment->post_date));
                ?>
</td>
									<td>
										<?php 
                $user_id = isset($user_info['id']) && $user_info['id'] != -1 ? $user_info['id'] : $user_info['email'];
                ?>
										<a href="<?php 
                echo remove_query_arg('p', add_query_arg('user', $user_id));
                ?>
">
											<?php 
                if (is_numeric($user_id)) {
                    $user = get_user_by('id', $user_id);
                    echo is_object($user) ? $user->display_name : __('guest', 'edd');
                } else {
                    echo __('guest', 'edd');
                }
                ?>
										</a>
									</td>
									<td><?php 
                echo edd_get_payment_status($payment, true);
                ?>
</td>
								</tr>
							<?php 
                $i++;
            }
        } else {
            ?>
						<tr><td colspan="7"><?php 
            _e('No payments recorded yet', 'edd');
            ?>
</td></tr>
					<?php 
        }
        ?>
				</table>
				<div class="tablenav">

					<div class="left edd-total-earnings">
						<p><?php 
        _e('Total Earnings:', 'edd');
        ?>
&nbsp;<strong><?php 
        echo edd_get_total_earnings();
        ?>
</strong></p>
						<?php 
        do_action('edd_payments_page_earnings');
        ?>
					</div>
					<?php 
        if ($total_pages > 1) {
            ?>
						<div class="tablenav-pages alignright">
							<?php 
            $query_string = $_SERVER['QUERY_STRING'];
            $base = 'edit.php?' . remove_query_arg('p', $query_string) . '%_%';
            echo paginate_links(array('base' => $base, 'format' => '&p=%#%', 'prev_text' => '&laquo; ' . __('Previous', 'edd'), 'next_text' => __('Next', 'edd') . ' &raquo;', 'total' => $total_pages, 'current' => $page, 'end_size' => 1, 'mid_size' => 5));
            ?>
	
						</div>
					<?php 
        }
        ?>
				</div><!--end .tablenav-->
				<?php 
        do_action('edd_payments_page_bottom');
        ?>
		</div><!--end wrap-->
		<?php 
    }
}
开发者ID:ryannmicua,项目名称:Easy-Digital-Downloads,代码行数:101,代码来源:payments-history.php


注:本文中的edd_get_total_earnings函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。