Even though extending your custom search would be the proper WP way to solve your problem, the answer to your workaround question would be the below function:
function change_content_on_save($post_id, $post, $update) {
if ($_SERVER['REQUEST_METHOD'] !== 'POST' || empty($_POST))
return;
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return;
if (!current_user_can('edit_post', $post_id))
return;
// create your terms list and insert to content here:
$post->post_content = $terms_list;
// Delete hook to avoid endless loop
remove_action('save_post', 'change_content_on_save', 10);
wp_update_post($post);
}
add_action( 'save_post', 'change_content_on_save', 10, 3 );
save_post
is an action triggered whenever a post or page is created or updated
https://developer.wordpress.org/reference/hooks/save_post/
Related Posts:
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Assign posts to taxonomy terms instead of the taxonomy terms to posts?
- How to completely disable a taxonomy archive on the frontend?
- Custom Comment Types
- Not Able to Insert Taxonomy Term Using wp_insert_post()
- Restrict taxonomy dropdown to post type
- array_pop() expects array, boolean given for $event_type_term ->slug
- custom post type permalinks with category and tags
- Get template part based on custom taxonomy term
- WordPress returns 404 on custom rewrite rule conflict in parameters
- How to show a tag archive of one post type only
- Conditional two level dropdown filter for custom post type
- Show all custom post type posts sorted by custom taxonomy then by another custom taxonomy
- Custom Post Type Category List & Post Count
- Custom taxonomy archive page not working
- Custom Taxonomy archive returns 404
- Custom edit post column – category not showing
- How to show multiple post types on taxonomy archive?
- Custom post type / custom fields
- using custom taxonomies on non wp table?
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Custom Taxonomy Not Showing Up on Post Page
- Custom permalink – append taxonomy name and term name at the end of permalink
- Get the posttype of a taxonomy/term
- Taxonomy Templates
- Custom Taxonomy Creates Unwanted Integer Terms on Post Save
- Add hierarchical taxonomy to permalink for custom post type
- Custom Posts Hierarchy? (State/City/Restaurant)
- How to get posts from multiple custom post types according to it’s custom taxonomy terms?
- Is it possible to create a shortcode that will query a post based on taxonomies?
- get_template_part for each level of taxonomy term
- Displaying a custom post types custom taxonomy value?
- Podcast Guest List
- custom permalinks based on taxonomies for custom post type
- Update post terms with custom taxonomy
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- Deleting Custom Taxonomy Term only increments tag_ID
- Get custom post type list for every category shortcode
- Custom Post Type Taxonomy Filters
- Listing tags from a custom post type
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- Display Custom Toxonomy In WordPress and theme Widgets category selection dropdown list
- Custom post URL 404 error
- How do I require the specification of term in a custom post type and custom taxonomy?
- Custom Post Type Pagination Paginates Only in URL Structure
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Hierarchial Custom Post Types/Taxonomies
- Hierarchical permalinks for custom post type and taxonomy
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Best way to specify “article type” in URL
- Rename a slug label
- Dynamically insert an article at the top of a taxonomy archive – or?
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- Migrating Hierarchal Taxonomy Categories Between Post Types
- How to show list of taxonomy terms associated with specific post?
- Exclude latest post from WP_Query taxonomy term loop
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- How can I get 3 different taxonomy type terms in a div class element?
- Use different categories for a custom post
- Filter posts by specific custom category and current tag
- Help on Custom Post Types
- Custom Post Type URL doesn’t work anymore
- using custom taxonomies with custom post types: display list of posts by ‘category’
- Custom category URL not displaying posts
- Display featured posts for a custom post type by taxonomy
- What is the most efficient way to execute recursive complex queries?
- 2 custom post type paging in 1 custom taxonomy
- WordPress REST API V2: “{CUSTOM_POST_TYPE} matches Term ID List and Term ID Taxonomy Query, but should match only one.”
- Duplicate slug/permalink issue while adding same post name
- display post count in archive page that have relation with another taxonomy term
- Remove custom permalink base from CPT custom category and custom tags
- Pretty Permalinks with CTP and Taxonomies / Hierarchical
- Change Search display for Custom Post Type
- WooCommerce – Custom related product (Spareparts)
- Automatically add CPT UI categories to the menu
- Custom category taxonomy – archive page not showing up
- tax_query not working?
- Issue with Custom Post Types and Permalinks
- Get list of all Topics in use by a custom post type
- Adding Custom Taxonomy Along-with Post Name in Post Type Permalink
- I want to display my custom post type arranged by taxonomy
- Connect 8 Taxonomies to One (Main) taxonomy. How to?
- Display posts grouped by post type in taxonomy.php
- Advice on Categorization for a Custom Post Type
- Pods pagination erases my sub menu
- How to have permalink structure based on taxonomy terms
- Checking Taxonomy Terms for a Custom Post Type With get_the_terms Not Working
- How to List CPTs Under One Tax Term
- Displaying or Hiding Metadata on Page from WP CPanel
- Get posts that have custom post type value
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Listing custom post type items from a couple of custom taxonomies
- Invalid Taxonomy in template
- Permalink for Custom Post Types
- Function not working on live server but every thing is fine on localhost
- How to change custom post type slug without damage seo? [closed]
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Hide custom post type slug url from search engine [closed]
- Create a WordPress loop that shows posts from a custom post type + filters the posts by taxonomies while hiding empty taxonomies
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template