Skip to content

Instantly share code, notes, and snippets.

@g-maclean
Last active September 8, 2025 06:56
Show Gist options
  • Save g-maclean/0cf5318346e3f25bf35b38fcdcc4cb28 to your computer and use it in GitHub Desktop.
Save g-maclean/0cf5318346e3f25bf35b38fcdcc4cb28 to your computer and use it in GitHub Desktop.
Property Hive - add view shortlist button to results page
add_action('propertyhive_before_search_results_loop', 'add_view_shortlist_button', 50);
function add_view_shortlist_button() {
if ( isset($_GET['shortlisted']) && $_GET['shortlisted'] == '1' ) {
echo '<div class="view-shortlist-container" style="clear: both;">
<a href="/search/" class="button view-shortlist-button">Back to Search</a>
</div>';
}
echo '<div class="view-shortlist-container" style="clear: both;">
<a href="/search/?shortlisted=1" class="button view-shortlist-button">View Shortlist</a>
</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment