K
K
Knowledge Base - Ajax Search Pro for WordPress
Buy Ajax Search Pro!
Documentation
Get Support
Search…
Knowledge Base
Safe Coding Guideline
Hooks
Filters
Query & Output
Search Results
CSS & JS
Index Table Related
asp_index_on_save_stop
asp_indexing_keywords
asp_indexing_string_pre_process
asp_indexing_string_post_process
asp_post_content_before_tokenize_clear
asp_post_content_before_tokenize
asp_post_excerpt_before_tokenize
asp_post_title_before_tokenize
asp_file_contents_before_tokenize
asp_post_permalink_before_tokenize
asp_index_terms
asp_post_custom_field_before_tokenize
asp_index_cf_contents_before_tokenize
asp_index_before_shortcode_execution
asp_index_after_shortcode_execution
Templating
Constants
Frontend Filters
Taxonomy Filters
Frontend filters API
Tips & Miscellaneous
Tutorials
Post Types
Taxonomy Terms
WooCommerce
Compatibility
Other
Other
ASP_Query
REST API
Building a custom REST API
Javascript API
Javascript Hooks
Changelog
Powered By
GitBook
asp_post_custom_field_before_tokenize
Gives access to each selected custom field related to post, before they are merged to tokenization
apply_filters('asp_post_custom_field_before_tokenize', $values, $post, $field);
Parameters
$values
(array)
- array of custom field values. Even if the field has a single value, it is converted to array.
$post
(WP_Post) - post type object
$field
(string) - custom field name
The return value should always be an
array
Sample usage
add_filter
(
'asp_post_custom_field_before_tokenize'
,
'asp_change_cf_index'
,
10
,
3
);
function
asp_change_cf_index
(
$values
,
$post
,
$field
)
{
if
(
$field
==
'my_field_name'
)
{
return
array
(
'my custom value'
);
// Always as array!
}
else
{
return
$values
;
}
}
Previous
asp_index_terms
Next
asp_index_cf_contents_before_tokenize
Last modified
1yr ago
Copy link
Outline
Parameters
Sample usage