Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter John Huebner

    (@hube2)

    In your main plugin file you need to change this

    
    add_action( 'init', 'register_fields_font_awesome' );
    

    to this

    
    add_action('acf/include_field_types', 'register_fields_font_awesome');
    add_action('acf/register_fields', 'register_fields_font_awesome');
    
    Plugin Author Matt Keys

    (@mattkeys)

    I used to initiate the plugin on those hooks as recently as 1.7

    https://plugins.svn.wordpress.org/advanced-custom-fields-font-awesome/tags/1.7/

    There were incompatibilities with my plugin alongside the Better Font Awesome plugin (whose library is used in this plugin) that precipitated the switch to using init.

    Does 1.7 fix your problems?

    Thread Starter John Huebner

    (@hube2)

    I think I might be looking at a conflict with another plugin. I’m digging into it now and will get back to you

    Thread Starter John Huebner

    (@hube2)

    So, I tracked down the problem. I have another plugin has an action on acf/init. This action is used to check for the existence of other types of fields and if they don’t exist then parts of the plugin are disabled.

    I believe it’s running on this hook because, well it does not run if acf is not installed. The parts of the plugin that are disabled are disabled by default and only enabled if the field types are found. Changing the other plugin to init instead of acf/init does correct the problem.

    I’m guessing that this has something to do with the order that the ‘init’ actions are fired. If your init was before acf’s init then more than likely the problems would not exist.

    I’m going to change the other plugin, because I can and then check for the existence of the acf function instead of depending on acf’s hook.

    My problem is resolved for now. I’m sure that I only did it this way because I found other plugins doing it this way, so other people may run into the same thing if they also use this plugin.

    I would suggest that you either set a priority less than ACF’s (which is 5) or change the hook to your filter to acf/init. I tried both of these options and they both worked, but I’m not sure if there’s anything in the library that you’re using that would cause other issues by doing this.

    Plugin Author Matt Keys

    (@mattkeys)

    Thank you for the thorough debug John.

    I am using ACF Pro v5.5.9 with ACF font awesome v1.7.3 and I have the same issue, Font awesome is not appearing in the list of available field types.

    Any help appreciated.
    Thanks.

    Thread Starter John Huebner

    (@hube2)

    Out of curiosity, what other ACF addons are you using?

    Only other add-on i’m using is by some guy called Job Huebner, ACF User Role Field Setting 🙂

    Edit: Disabling that does bring the field type back.

    • This reply was modified 9 years, 5 months ago by adejones. Reason: further detail
    Thread Starter John Huebner

    (@hube2)

    I’ve made an alteration in my plugin to deal with ACF add ons that initialize their fields on non-standard hooks.

    Works a treat, many thanks to you.

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

The topic ‘Error Field type does not exist’ is closed to new replies.