Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: prevent PHP notice
When `post_type` does not exist in query_vars

fixes #3981
  • Loading branch information
ravinderk committed Feb 4, 2019
1 parent 85b1c83 commit 6fae187
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/admin/forms/dashboard-columns.php
Expand Up @@ -465,9 +465,13 @@ function give_form_search_query_filter( $wp ) {

function give_search_form_by_id( $query ) {
// Verify that we are on the give forms list page.
if ( 'give_forms' !== $query->query_vars['post_type'] ) {
if (
empty( $query->query_vars['post_type'] )
|| 'give_forms' !== $query->query_vars['post_type']
) {
return;
}

if ( '' !== $query->query_vars['s'] && is_search() ) {
if ( absint( $query->query_vars['s'] ) ) {
// Set the post id value
Expand Down

0 comments on commit 6fae187

Please sign in to comment.