Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Page Status #2353 #2490

Merged
merged 3 commits into from
Dec 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 );