Created
March 26, 2020 17:49
-
-
Save jchristopher/38f9528194a3b2c0bb4417939ee861af to your computer and use it in GitHub Desktop.
Customize available Engine Source Attribute weights in SearchWP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Customize available Engine Source Attribute weights in SearchWP. | |
add_filter( 'searchwp\weights', function( $weights ) { | |
// Make available only two weight choices. | |
return [ | |
1 => 'Lowest', | |
1000 => 'Highest', | |
]; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Ok, if we put this code in, what does it do? Does it add a field in the search engine where weights can be assigned? Please give further details / explanation. For example, if I wanted to give the following weights to the following, how would I do that?
100 - pages
90 - blog posts
80 - custom posts
Thanks.