Add filter for additional html in settings
- # 2 months, 2 weeks ago
Hello,
to allow additional html, would it be possible to add a filter :
wpsolr-pro/wpsolr/core/dashboard/dashboard_settings/inc.php
line @686-689/**
* Load additional setting html.
*/
echo apply_filters(“wpsolr_content_after_label”, ”, $selected_val);# 2 months, 2 weeks agoThe UI is quite complex and I would like to configure multiple searches
Instead of recreating the whole UI for integration with some custom fields
the filter makes it possible to add another setting for filters
A filter for sort and search would also be helpful
# 2 months, 2 weeks agoWhat I want is to use the UI you have made but add a couple options.
If I don’t have a filter then I will have to rebuild the whole UI or modify core to add the filter myself as in the example above.
# 2 months, 2 weeks agook.
Then please follow these instructions:
1) Install the latest version 21.6
2) Update wpsolr-pro/wpsolr/core/dashboard/dashboard_settings_inc.php with your new hook
3) Send me a download link containing a zip with the updated file, and a separate file containing a code example of how you use the hookI’ll then check if it fits with WPSOLR’s design.
# 2 months agoHello,
I have added 2 filters
Purpose:
Add additional markup for includung fields in custom search
File: wpsolr/core/dashboard/dashboard_settings.inc.php
Filter added:
Line no: 742
echo apply_filters(“wpsolr_content_after_label”, ”, $selected_val);Screenshot:
http://prntscr.com/pe8efwPurpose:
Add additional field information on the search results page and in a map like latitude and custom fields.
File: wpsolr/core/classes/engines/class-wpsolr-abstractsearchclient.php
Filter added:
Line no: 2903
$data_result[‘additional_fields’] = apply_filters(‘wpsolr_filter_solr_results_additional_fields’, array(), $document, $wpsolr_query);Screenshot:
http://prntscr.com/pe8g7h
http://prntscr.com/pe8fsu
http://prntscr.com/pe8f89Link to files
https://drive.google.com/file/d/1jrIIRHeKqW2oAi4BXzTLCIgSNWpMTkuc/view?usp=sharing
# 1 month, 4 weeks agoYes.
Add additional markup for including fields in custom search
Your solution is to inject html in the facets admin page, to be able to add a custom option, here a checkbox.
But your code needs to know the internals of the page options data structure (at least the options name for the page), which is bad if the plugins data structure must evolve (and it will soon in fact!).
In your case, I do not think you need something as sophisticated. Just build an array in your code that associates the facet name with your option value.
But I recognise it would be nice, even for the plugin’s extension, to be able to extend the facets.
Something that would send the data, rather than the HTML, like:[ 'facet_name' => [ 'my-custom-field-name-1' => [ 'type' => 'checkbox', 'default_value' => false ], 'my-custom-field-name-2' => [ 'type' => 'edit', 'default_value' => '' ] ] ]
Add additional field information on the search results page and in a map like latitude and custom fields.
– Already existing: https://www.wpsolr.com/guide/actions-and-filters/search-results-modify-posts/
– Already existing: https://www.wpsolr.com/guide/actions-and-filters/search-results-append-html/- This reply was modified 1 month, 4 weeks ago by
wpsolr.
- This reply was modified 1 month, 4 weeks ago by
You must be logged in to reply to this topic.