Saving custom post title built from custom fields
-
Hi.
I’ve spent many hours experimenting with filters and actions trying to achieve what I expected to be a simple task.All I want to do is have the post_title, when saved in the db, defined by custom fields in the post, as I’ve hidden the title input box.
I’ve tried:
add_filter('title_save_pre','my_function'); add_action('save_post','my_function'); add_action('insert_post','my_function');
all with no success.
The only thing I’ve found that works somewhat was when I tried:
add_filter('title_save_pre','my_function'); function my_function($title) { $title_mod = $title(with some string modification done to it) return $title_mod; }
But this isn’t enough as I can’t succeed in finding and using values of the post’s custom fields properly, with which I need to build the post’s title for it to be saved in the db.
Can someone please suggest the best solution?
Thanks, I appreciate help anyone can give.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Saving custom post title built from custom fields’ is closed to new replies.