本文整理汇总了PHP中edd_get_payment_statuses函数的典型用法代码示例。如果您正苦于以下问题:PHP edd_get_payment_statuses函数的具体用法?PHP edd_get_payment_statuses怎么用?PHP edd_get_payment_statuses使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了edd_get_payment_statuses函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_action
<div class="inside">
<div class="edd-admin-box">
<?php
do_action('edd_view_order_details_totals_before', $payment_id);
?>
<div class="edd-admin-box-inside">
<p>
<span class="label"><?php
_e('Status:', 'edd');
?>
</span>
<select name="edd-payment-status" class="medium-text">
<?php
foreach (edd_get_payment_statuses() as $key => $status) {
?>
<option value="<?php
echo esc_attr($key);
?>
"<?php
selected(edd_get_payment_status($item, true), $status);
?>
><?php
echo esc_html($status);
?>
</option>
<?php
}
?>
</select>
示例2: edd_reports_tab_export
//.........这里部分代码省略.........
<input type="submit" value="<?php
_e('Generate CSV', 'easy-digital-downloads');
?>
" class="button-secondary"/>
</form>
</p>
</div><!-- .inside -->
</div><!-- .postbox -->
<div class="postbox edd-export-payment-history">
<h3><span><?php
_e('Export Payment History', 'easy-digital-downloads');
?>
</span></h3>
<div class="inside">
<p><?php
_e('Download a CSV of all payments recorded.', 'easy-digital-downloads');
?>
</p>
<p>
<form id="edd-export-payments" class="edd-export-form" method="post">
<?php
echo EDD()->html->date_field(array('id' => 'edd-payment-export-start', 'name' => 'start', 'placeholder' => __('Choose start date', 'easy-digital-downloads')));
?>
<?php
echo EDD()->html->date_field(array('id' => 'edd-payment-export-end', 'name' => 'end', 'placeholder' => __('Choose end date', 'easy-digital-downloads')));
?>
<select name="status">
<option value="any"><?php
_e('All Statuses', 'easy-digital-downloads');
?>
</option>
<?php
$statuses = edd_get_payment_statuses();
foreach ($statuses as $status => $label) {
echo '<option value="' . $status . '">' . $label . '</option>';
}
?>
</select>
<?php
wp_nonce_field('edd_ajax_export', 'edd_ajax_export');
?>
<input type="hidden" name="edd-export-class" value="EDD_Batch_Payments_Export"/>
<span>
<input type="submit" value="<?php
_e('Generate CSV', 'easy-digital-downloads');
?>
" class="button-secondary"/>
<span class="spinner"></span>
</span>
</form>
</p>
</div><!-- .inside -->
</div><!-- .postbox -->
<div class="postbox edd-export-customers">
<h3><span><?php
_e('Export Customers in CSV', 'easy-digital-downloads');
?>
</span></h3>
<div class="inside">
<p><?php
_e('Download a CSV of customers.', 'easy-digital-downloads');
?>
</p>
<p>
示例3: edd_get_payment_status_keys
/**
* Retrieves keys for all available statuses for payments
*
* @since 2.3
* @return array $payment_status All the available payment statuses
*/
function edd_get_payment_status_keys()
{
$statuses = array_keys(edd_get_payment_statuses());
asort($statuses);
return array_values($statuses);
}
示例4: edd_record_status_change
/**
* Record payment status change
*
* @since 1.4.3
* @param int $payment_id the ID number of the payment
* @param string $new_status the status of the payment, probably "publish"
* @param string $old_status the status of the payment prior to being marked as "complete", probably "pending"
* @return void
*/
function edd_record_status_change($payment_id, $new_status, $old_status)
{
// Get the list of statuses so that status in the payment note can be translated
$stati = edd_get_payment_statuses();
$old_status = isset($stati[$old_status]) ? $stati[$old_status] : $old_status;
$new_status = isset($stati[$new_status]) ? $stati[$new_status] : $new_status;
$status_change = sprintf(__('Status changed from %s to %s', 'edd'), $old_status, $new_status);
edd_insert_payment_note($payment_id, $status_change);
}
示例5: update_status
/**
* Set the payment status
*
* @since 2.5
*
* @param string $status The status to set the payment to
* @return bool Returns if the status was successfully updated
*/
public function update_status($status = false)
{
if ($status == 'completed' || $status == 'complete') {
$status = 'publish';
}
$old_status = !empty($this->old_status) ? $this->old_status : false;
if ($old_status === $status) {
return false;
// Don't permit status changes that aren't changes
}
$do_change = apply_filters('edd_should_update_payment_status', true, $this->ID, $status, $old_status);
$updated = false;
if ($do_change) {
do_action('edd_before_payment_status_change', $this->ID, $status, $old_status);
$update_fields = array('ID' => $this->ID, 'post_status' => $status, 'edit_date' => current_time('mysql'));
$updated = wp_update_post(apply_filters('edd_update_payment_status_fields', $update_fields));
$all_payment_statuses = edd_get_payment_statuses();
$this->status_nicename = array_key_exists($status, $all_payment_statuses) ? $all_payment_statuses[$status] : ucfirst($status);
do_action('edd_update_payment_status', $this->ID, $status, $old_status);
}
return $updated;
}
示例6: edd_get_payment_status
/**
* Get Payment Status
*
* @since 1.0
*
* @param WP_Post $payment
* @param bool $return_label Whether to return the payment status or not
*
* @return bool|mixed if payment status exists, false otherwise
*/
function edd_get_payment_status($payment, $return_label = false)
{
if (!is_object($payment) || !isset($payment->post_status)) {
return false;
}
$statuses = edd_get_payment_statuses();
if (!is_array($statuses) || empty($statuses)) {
return false;
}
if (array_key_exists($payment->post_status, $statuses)) {
if (true === $return_label) {
return $statuses[$payment->post_status];
} else {
return array_search($payment->post_status, $statuses);
}
}
return false;
}
示例7: edd_reports_tab_export
/**
* Renders the 'Export' tab on the Reports Page
*
* @since 1.3
* @return void
*/
function edd_reports_tab_export()
{
?>
<div class="metabox-holder">
<div id="post-body">
<div id="post-body-content">
<?php
do_action('edd_reports_tab_export_content_top');
?>
<div class="postbox">
<h3><span><?php
_e('Export PDF of Sales and Earnings', 'edd');
?>
</span></h3>
<div class="inside">
<p><?php
_e('Download a PDF of Sales and Earnings reports for all products for the current year.', 'edd');
?>
<?php
_e('Date range reports will be coming soon.', 'edd');
?>
</p>
<p><a class="button" href="<?php
echo wp_nonce_url(add_query_arg(array('edd-action' => 'generate_pdf')), 'edd_generate_pdf');
?>
"><?php
_e('Generate PDF', 'edd');
?>
</a></p>
</div><!-- .inside -->
</div><!-- .postbox -->
<div class="postbox">
<h3><span><?php
_e('Export Payment History', 'edd');
?>
</span></h3>
<div class="inside">
<p><?php
_e('Download a CSV of all payments recorded.', 'edd');
?>
</p>
<p>
<form method="post">
<?php
echo EDD()->html->year_dropdown();
?>
<?php
echo EDD()->html->month_dropdown();
?>
<select name="edd_export_payment_status">
<option value="0"><?php
_e('All Statuses', 'edd');
?>
</option>
<?php
$statuses = edd_get_payment_statuses();
foreach ($statuses as $status => $label) {
echo '<option value="' . $status . '">' . $label . '</option>';
}
?>
</select>
<input type="hidden" name="edd-action" value="payment_export"/>
<input type="submit" value="<?php
_e('Generate CSV', 'edd');
?>
" class="button-secondary"/>
</form>
</p>
</div><!-- .inside -->
</div><!-- .postbox -->
<div class="postbox">
<h3><span><?php
_e('Export Customers in CSV', 'edd');
?>
</span></h3>
<div class="inside">
<p><?php
_e('Download a CSV of all customer emails. Optionally export only customers that have purchased a particular product. Note, if you have a large number of customers, exporting the purchase stats may fail.', 'edd');
?>
</p>
<p>
<form method="post" id="edd_customer_export">
<select name="edd_export_download" id="edd_customer_export_download">
<option value="0"><?php
printf(__('All %s', 'edd'), edd_get_label_plural());
?>
</option>
<?php
$downloads = get_posts(array('post_type' => 'download', 'posts_per_page' => -1));
if ($downloads) {
//.........这里部分代码省略.........
示例8: _e
</p>
</td>
</tr>
<tr>
<th scope="row" valign="top">
<span><?php
_e('Payment Status', 'edd');
?>
</span>
</th>
<td>
<select name="edd-payment-status" id="edd_payment_status">
<?php
$status = $payment->post_status;
// current status
$statuses = edd_get_payment_statuses();
foreach ($statuses as $status_id => $label) {
echo '<option value="' . $status_id . '" ' . selected($status, $status_id, false) . '>' . $label . '</option>';
}
?>
</select>
</td>
</tr>
<tr id="edd_payment_notification" style="display:none;">
<th scope="row" valign="top">
<span><?php
_e('Send Purchase Receipt', 'edd');
?>
</span>
</th>
<td>
示例9: payment_creation_form
//.........这里部分代码省略.........
_e('Amount', 'edd-manual-purchases');
?>
</label>
</th>
<td class="edd-mp-downloads">
<input type="text" class="small-text" id="edd-mp-amount" name="amount" style="width: 180px;"/>
<?php
if (edd_item_quantities_enabled()) {
?>
<div class="description"><?php
_e('Enter the total purchase amount, or leave blank to auto calculate price based on the selected items and quantities above. Use 0.00 for 0.', 'edd-manual-purchases');
?>
</div>
<?php
} else {
?>
<div class="description"><?php
_e('Enter the total purchase amount, or leave blank to auto calculate price based on the selected items above. Use 0.00 for 0.', 'edd-manual-purchases');
?>
</div>
<?php
}
?>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top">
<?php
_e('Payment status', 'edd-manual-purchases');
?>
</th>
<td class="edd-mp-status">
<?php
echo EDD()->html->select(array('name' => 'status', 'options' => edd_get_payment_statuses(), 'selected' => 'publish', 'show_option_all' => false, 'show_option_none' => false));
?>
<label for="edd-mp-status" class="description"><?php
_e('Select the status of this payment.', 'edd-manual-purchases');
?>
</label>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top">
<label for="edd-mp-payment-method"><?php
_e('Payment Method', 'edd-manual-purchases');
?>
</label>
</th>
<td class="edd-mp-gateways">
<select name="gateway" id="edd-mp-payment-method">
<option value="manual_purchases"><?php
esc_html_e('Manual Payment', 'edd-manual-purchases');
?>
</option>
<?php
foreach (edd_get_payment_gateways() as $gateway_id => $gateway) {
?>
<option value="<?php
echo esc_attr($gateway_id);
?>
"><?php
echo esc_html($gateway['admin_label']);
?>
</option>
<?php
}
示例10: edd_csau_reports_export_upsells
/**
* Adds metabox for exporting upsells from the reports -> export page
*
* @since 1.1
*/
function edd_csau_reports_export_upsells()
{
?>
<div class="postbox">
<h3><span><?php
_e('Export Upsell History', 'edd-csau');
?>
</span></h3>
<div class="inside">
<p><?php
_e('Download a CSV of all upsells recorded.', 'edd-csau');
?>
</p>
<p>
<form method="post">
<?php
echo EDD()->html->year_dropdown();
?>
<?php
echo EDD()->html->month_dropdown();
?>
<select name="edd_export_payment_status">
<option value="0"><?php
_e('All Statuses', 'edd-csau');
?>
</option>
<?php
$statuses = edd_get_payment_statuses();
foreach ($statuses as $status => $label) {
echo '<option value="' . $status . '">' . $label . '</option>';
}
?>
</select>
<input type="hidden" name="edd-action" value="upsells_export" />
<input type="submit" value="<?php
_e('Generate CSV', 'edd-csau');
?>
" class="button-secondary" />
</form>
</p>
</div><!-- .inside -->
</div><!-- .postbox -->
<?php
}
示例11: payment_creation_form
//.........这里部分代码省略.........
?>
</div>
</td>
</tr>
<?php
if (edd_use_taxes()) {
?>
<tr class="form-field">
<th scope="row" valign="top">
<label for="edd-mp-tax"><?php
_e('Tax', 'edd-manual-purchases');
?>
</label>
</th>
<td class="edd-mp-downloads">
<input type="text" class="small-text" id="edd-mp-tax" name="tax" value="0" style="width: 180px;"/>
<div class="description"><?php
_e('Enter the total tax charged on the purchase.', 'edd-manual-purchases');
?>
</div>
</td>
</tr>
<?php
}
?>
<tr class="form-field">
<th scope="row" valign="top">
<?php
_e('Payment status', 'edd-manual-purchases');
?>
</th>
<td class="edd-mp-status">
<?php
echo EDD()->html->select(array('name' => 'status', 'options' => edd_get_payment_statuses(), 'selected' => 'publish', 'show_option_all' => false, 'show_option_none' => false));
?>
<label for="edd-mp-status" class="description"><?php
_e('Select the status of this payment.', 'edd-manual-purchases');
?>
</label>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top">
<?php
_e('Send Receipt', 'edd-manual-purchases');
?>
</th>
<td class="edd-mp-receipt">
<label for="edd-mp-receipt">
<input type="checkbox" id="edd-mp-receipt" name="receipt" style="width: auto;" checked="1" value="1"/>
<?php
_e('Send the purchase receipt to the buyer?', 'edd-manual-purchases');
?>
</label>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top">
<label for="edd-mp-date"><?php
_e('Date', 'edd-manual-purchases');
?>
</label>
</th>
<td class="edd-mp-downloads">
<input type="text" class="small-text edd_datepicker" id="edd-mp-date" name="date" style="width: 180px;"/>
<div class="description"><?php