Skip to content

Commit

Permalink
more indenting formatting tweaks for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
helgatheviking committed Feb 20, 2024
1 parent 4d0ac3e commit fa36fba
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 36 deletions.
35 changes: 17 additions & 18 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Add the following to your theme's functions.php:
// Switch the WP_User_Query args to a meta search
function kia_meta_search( $args ) {

// This $_GET is the name field of the custom input in search-author.php.
// This $_GET is the name field of the custom input in search-author.php.
$search = ( isset($_GET['as']) ) ? sanitize_text_field($_GET['as']) : false ;

if ( $search ) {
Expand Down Expand Up @@ -196,24 +196,23 @@ And then in your theme's `functions.php` or a site-specific plugin, you could fi
add_filter( 'sul_user_query_args', 'sul_custom_meta_query', 10, 2 );

function sul_custom_meta_query( $args, $query_id ) {
// Checking the query ID allows us to only target a specific shortcode.
// Checking the query ID allows us to only target a specific shortcode.
if ( $query_id === 'my_custom_meta_query' ) {
$args['meta_query'] = array(
'relation' => 'OR',
array(
'key' => 'billing_city',
'value' => 'oslo',
'compare' => '=',
'type' => 'CHAR',
),
array(
'key' => 'first_name',
'value' => 'bobby',
'compare' => '=',
'type' => 'CHAR',
)
);

$args['meta_query'] = array(
'relation' => 'OR',
array(
'key' => 'billing_city',
'value' => 'oslo',
'compare' => '=',
'type' => 'CHAR',
),
array(
'key' => 'first_name',
'value' => 'bobby',
'compare' => '=',
'type' => 'CHAR',
)
);
}
return $args;
}
Expand Down
35 changes: 17 additions & 18 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Add the following to your theme's functions.php:
// Switch the WP_User_Query args to a meta search
function kia_meta_search( $args ) {

// This $_GET is the name field of the custom input in search-author.php.
// This $_GET is the name field of the custom input in search-author.php.
$search = ( isset($_GET['as']) ) ? sanitize_text_field($_GET['as']) : false ;

if ( $search ) {
Expand Down Expand Up @@ -196,24 +196,23 @@ And then in your theme's `functions.php` or a site-specific plugin, you could fi
add_filter( 'sul_user_query_args', 'sul_custom_meta_query', 10, 2 );

function sul_custom_meta_query( $args, $query_id ) {
// Checking the query ID allows us to only target a specific shortcode.
// Checking the query ID allows us to only target a specific shortcode.
if ( $query_id === 'my_custom_meta_query' ) {
$args['meta_query'] = array(
'relation' => 'OR',
array(
'key' => 'billing_city',
'value' => 'oslo',
'compare' => '=',
'type' => 'CHAR',
),
array(
'key' => 'first_name',
'value' => 'bobby',
'compare' => '=',
'type' => 'CHAR',
)
);

$args['meta_query'] = array(
'relation' => 'OR',
array(
'key' => 'billing_city',
'value' => 'oslo',
'compare' => '=',
'type' => 'CHAR',
),
array(
'key' => 'first_name',
'value' => 'bobby',
'compare' => '=',
'type' => 'CHAR',
)
);
}
return $args;
}
Expand Down

0 comments on commit fa36fba

Please sign in to comment.