Support

Account

Home Forums General Issues Migrating from V3 to V4 Confusion

Solved

Migrating from V3 to V4 Confusion

  • Hi Elliot

    I’ve tried to update 3 times now from V3 to V4 over the last 6 months. But each time I’ve not managed as I can’t allow my site’s functionality to go down more than one night. I think there are holes in my php knowledge that are not helping so could you clarify a few points.

    1) When you say in the documentation . . .

    “Creating your own field type has never been easier! Unfortunately, version 3 field types are not compatible with version 4.
    Migrating your field types is easy, please follow this tutorial to learn more.”

    Are the ‘field types’ the same as ‘field names’ ? i.e. do I have to change my ‘field names’ – or – is it only ‘field types’ that need to be changed/edited and that ‘field names’ are left alone?

    2) Re the Repeater add-on . . .

    I understand that I now have to download it as a separate plugin and use my registration number to activate it. However, in the Read Me file included in the acf-repeater plugin folder it says . . .

    add_action('acf/register_fields', 'my_register_fields');
    
    function my_register_fields()
    {
    include_once('acf-repeater/repeater.php');
    }

    Am I right in thinking that I paste this to my theme’s functions file?
    Also, do I paste it from the text “add_action – or – do I paste it from “function my_register_fields()”?
    And finally, is that the only extra piece of code I need to put in to make the new repeater plugin work correctly?

    Many thanks

    Phil

  • Hi @Phil Futureproof

    1. No. A field type is ‘text’, ‘textarea’, ‘image’, etc. You do not need to change your field names. If you website uses any custom field types, you will need to re-create these

    2. No. The repeater field needs to be used as a normal plugin unless you are including it within a premium theme to be distributed. Please read the readme carefuly – there are 2 ways to activate the add-on. The easiest and most popular is to use it like a normal plugin

    3. No. No new code is needed. You can use the same functions as before

    Hope that helps.
    Cheers
    E

  • Many thanks Elliot.

    I’ve now managed to convert all my websites to V4. Again – a marvellous plugin

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

The topic ‘Migrating from V3 to V4 Confusion’ is closed to new replies.