Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter douglasfloresnic

    (@douglasfloresnic)

    I still have the same problem, if you know of any solution please let me know.

    Thanks greetings.

    I found this code here, maybe it can help you.

    I wanted to change the post title (post-title) to a value defined in a CPT called custom_title.

    Here is the code, maybe this is what you are looking for:

    // 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;
    
    }

    Hello, I want to change the names, because in my region it is not used: villa, office, but they are called: land, commercial modules and I want to add one called: beach house.
    Are these changes also made from the database? Is there a way to do it from wordpress?

    Now, I want to delete and create some new Features, is it possible to do it from WordPress or do I have to do it from the Database? In case of doing it from the database, how is it done?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)