Last active
August 29, 2015 14:03
-
-
Save jchristopher/635c8a849cc469be6719 to your computer and use it in GitHub Desktop.
SearchWP 2.3 will make available all of the weights that dictated the order of search results
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 | |
print_r( SWP()->results_weights ); | |
/* ===================== OUTPUT ===================== | |
Primary array key is the $post->ID, each primary value contains the overall | |
weight for that $post in addition to the weight for each post type | |
Array | |
( | |
[1778] => Array | |
( | |
[post_id] => 1778 | |
[weight] => 100 | |
[post_types] => Array | |
( | |
[post] => 100 | |
[page] => 0 | |
[cpt1] => 0 | |
[attachment] => 0 | |
) | |
) | |
[801] => Array | |
( | |
[post_id] => 801 | |
[weight] => 80 | |
[post_types] => Array | |
( | |
[post] => 80 | |
[page] => 0 | |
[cpt1] => 0 | |
[attachment] => 0 | |
) | |
) | |
[2424] => Array | |
( | |
[post_id] => 2424 | |
[weight] => 60 | |
[post_types] => Array | |
( | |
[post] => 60 | |
[page] => 0 | |
[cpt1] => 0 | |
[attachment] => 0 | |
) | |
) | |
) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment