Support

Account

Home Forums ACF PRO oddities with field key in repeater Reply To: oddities with field key in repeater

  • So my problem was a function I had setup. It was supposed to update the posts slug on save and it seems it was updating the field_key as a title slug as well.

    This is the code, if you have any suggestions how to make it only update posts and page slugs I’d love to hear it.

    // Updates slug from post title on Save
    function myplugin_update_slug( $data, $postarr ) {
        if ( !in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) ) {
            $data['post_name'] = sanitize_title( $data['post_title'] );
        }
        return $data;
    }
    add_filter( 'wp_insert_post_data', 'myplugin_update_slug', 99, 2 );