Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Naif Amoodi

    (@naifamoodi)

    Hi Marie.

    There are four actions which you can hook to. Hopefully these will take care of what you are after. The actions are as follows:

    ff_section_before
    ff_section_after

    ff_field_before
    ff_field_after

    The first two receive a section_uid argument and the last two receive a field_uid argument. So you can hook to them using something like this:

    function action_ff_section_before($section_uid) {
    	echo $section_uid;
    
    	exit;
    }
    
    add_action('ff_section_before', 'action_ff_section_before');
    Thread Starter Marie-Aude

    (@marie-aude)

    Thank you so much. And for the quick answer. This is perfect for creating content in the admin pages. And it even gives me the possibility to use datalists for text fields !

    One last question 🙂 (the more you give to users, the more they want)

    I would like to create the content of a checkbox field programatically, is there a hook for that also ? The data is very specific, and would be the result of a query, or an array taken from the option table. It should appear as a list with multiple levels. I “could” use a custom taxonomy for that, but again, it’s not a very nice workaround.

    Plugin Author Naif Amoodi

    (@naifamoodi)

    Fields can be accessed using the FF_Registry::$fields array. So if you have a field named ‘my-name’ you can access it using FF_Registry::$fields[‘my-name’]. Using the ff_field_before action, try modifying the values of FF_Registry::$fields[‘my-name’]->options

    I haven’t tested this so please give it a shot and let me know if it works.

    Thread Starter Marie-Aude

    (@marie-aude)

    I’ll do so by the end of the week and I’ll post a feedback.
    Thank you again !!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Callback function’ is closed to new replies.