Skip to content

Commit

Permalink
Merge pull request #2490 from raftaar1191/issues-2353
Browse files Browse the repository at this point in the history
Add Page Status #2353
  • Loading branch information
ravinderk committed Dec 11, 2017
2 parents edf9c4e + 685a67f commit 5773aa0
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion includes/admin/admin-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,4 +456,35 @@ function give_set_default_tab_form_tools_page( $default_tab ) {
function give_set_default_tab_form_reports_page( $default_tab ) {
return 'earnings';
}
add_filter( 'give_default_setting_tab_give-reports', 'give_set_default_tab_form_reports_page', 10, 1 );
add_filter( 'give_default_setting_tab_give-reports', 'give_set_default_tab_form_reports_page', 10, 1 );

/**
* Add a page display state for special Give pages in the page list table.
*
* @since 1.8.18
*
* @param array $post_states An array of post display states.
* @param WP_Post $post The current post object.
*/
function give_add_display_page_states( $post_states, $post ) {

// Checks if it's a Success Page.
if ( $post->ID === absint( give_get_option( 'success_page' ) ) ) {
$post_states['give_successfully_page'] = __( 'Donation Successfully Page', 'give' );
}

// Checks if it's a Failure Page.
if ( $post->ID === absint( give_get_option( 'failure_page' ) ) ) {
$post_states['give_failure_page'] = __( 'Donation Failed Page', 'give' );
}

// Checks if it's a History Page.
if ( $post->ID === absint( give_get_option( 'history_page' ) ) ) {
$post_states['give_history_page'] = __( 'Donation History Page', 'give' );
}

return $post_states;
}

// Add a post display state for special Give pages.
add_filter( 'display_post_states', 'give_add_display_page_states', 10, 2 );

0 comments on commit 5773aa0

Please sign in to comment.