Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Last active September 17, 2015 02:48
Show Gist options
  • Save SeanChDavis/4fbc38fbc7aea4aaee9f to your computer and use it in GitHub Desktop.
Save SeanChDavis/4fbc38fbc7aea4aaee9f to your computer and use it in GitHub Desktop.
EDD Add Custom Payment Statuses
<?php // DO NOT COPY THIS LINE
// add custom payment statuses
function sd_extra_payment_statuses( $statuses ) {
$statuses = array(
'pending' => __( 'Pending', 'edd' ),
'publish' => __( 'Complete', 'edd' ),
'refunded' => __( 'Refunded', 'edd' ),
'failed' => __( 'Failed', 'edd' ),
'abandoned' => __( 'Abandoned', 'edd' ),
'revoked' => __( 'Revoked', 'edd' ),
'retouched' => __( 'Retouched', 'edd' ), //new status
'pendingretouch' => __( 'Pending Retouch', 'edd' ), //new status
'revokedretouch' => __( 'Revoked Retouch', 'edd' ) //new status
);
return $statuses;
}
add_filter( 'edd_payment_statuses', 'sd_extra_payment_statuses' );
// register custom payment statuses with WordPress
function sd_edd_register_post_type_statuses() {
// Payment Statuses
register_post_status( 'retouched', array(
'label' => _x( 'Retouched', 'Retouched payment status', 'edd' ),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Retouched <span class="count">(%s)</span>', 'Retouched <span class="count">(%s)</span>', 'edd' )
) );
register_post_status( 'pendingretouch', array(
'label' => _x( 'Pending Retouch', 'Pending Retouch payment status', 'edd' ),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Pending Retouch <span class="count">(%s)</span>', 'Pending Retouch <span class="count">(%s)</span>', 'edd' )
) );
register_post_status( 'revokedretouch', array(
'label' => _x( 'Revoked Retouch', 'Revoked Retouch payment status', 'edd' ),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Revoked Retouch <span class="count">(%s)</span>', 'Revoked Retouch <span class="count">(%s)</span>', 'edd' )
) );
}
add_action( 'init', 'sd_edd_register_post_type_statuses', 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment