About Set as post title function
-
There is a function in the Advanced Custom Fields: Extended plugin
ACF: FIELDS ==>Field Image: Use as Featured Thumbnail(Choose if an image field should be considered as post featured thumbnail),
, Can you add another function Set as post title?? That title in the new article, thank you.
-
Hello,
Thanks for the feedback. Post fields like Title, Content, Slug etc… are quite different from the featured thumbnil (which is a simple post meta).
I plan to add it in the furure, there is already a Feature request in the Trello Board about that feature: https://trello.com/c/n9plUHs0/36-new-fields-native-wp-editor-move-native-wp-elements-in-acf
Have a nice day!
Regards.
BTW, you can achieve that feature by yourself using that code:
// Update Post Title Value add_filter('acf/update_value/name=my_field', 'my_acf_post_title_save_value', 10, 3); function my_acf_post_title_save_value($value, $post_id, $field){ // Retrieve Post ID Info $data = acf_get_post_id_info($post_id); // Bail early if not Post if($data['type'] !== 'post') return $value; wp_update_post(array( 'ID' => $data['id'], 'post_title' => $value, )); return $value; } // Load Post Title Value add_filter('acf/load_value/name=my_field', 'my_acf_post_title_load_value', 10, 3); function my_acf_post_title_load_value($value, $post_id, $field){ // Retrieve Post ID Info $data = acf_get_post_id_info($post_id); // Bail early if not Post if($data['type'] !== 'post') return $value; // Retrieve current Post Title $value = get_post_field('post_title', $data['id']); return $value; }Documentation:
- https://www.advancedcustomfields.com/resources/acf-update_value/
- https://www.advancedcustomfields.com/resources/acf-load_value/
Regards.
Hi hwk-fr Thank you for your reply, but…
1. The function “Moving WP elements” you refer to has nothing to do with the “POST TITLE” I want?2. The code you gave, I tried it, it didn’t work. I used ACF Frontend Form before. As long as it is installed, “Set as post title Save” will appear in Text and Image in Custom Fields. “value as post title.” and “Set as post image Save value as post featured image.”, this Set as post image is exactly the same as your company, so there is no Set as post title, and because ACF Frontend Form is dedicated to Elementor, there is no It is not possible to install elementor, and I want to give up elementor now, I very much hope that Advanced Custom Fields: Extended can add this feature, thank you.
3. I want to replace the grid value of Add Title in the Add New article with my own custom field value. I have already searched Google and tried countless ways, but it has never been It came in, I hope the experts can help me, I need this feature very much, thank you.
Hello,
1. It is a very similar feature which will let you customize post title, within ACF fields.
2. The code is working. Please read the documentation in order to customize the field name. In the code example, the field must be named
my_field.ACF Frontend Form is a native feature of ACF: https://www.advancedcustomfields.com/resources/create-a-front-end-form/
It looks like you’re talking about ACF Frontend Form for Elementor, which is a plugin. I didn’t understand exactly what you’re saying, but I don’t want to add the “Save as post title” setting in all ACF Text fields in the backend, as 99% of the time it won’t be used. For front-end forms, ACF Extended: Forms let you load/save a field as post title already.
3. I didn’t understand. Please provide screenshots to explain the feature request.
Regards.
1。
I am very, very sorry, because my English is not good, so use Google to translate, please bear with me, thank you.2。
In addition, the code you provided is feasible, thank you, but again, if I have multiple Post Types to modify, how should I modify them?
Copy multiple add_filter(‘acf/update_value/key=field_5ecdc9fbee466′,’my_acf_post_title_save_value’, 10, 3);
Then modify key=1, key=2, right?3、
I don’t understand how to set the tutorial (How the bidirectional field setting works?). Are there screenshots or videos you can refer to? Thank you.Hello,
Yes you can use the same filter, and simply change keys. Regarding the bidirectional field setting, please read the Readme, there’s also an usage example in the plugin’s FAQ.
Regards.
The topic ‘About Set as post title function’ is closed to new replies.