WordPress.org

Support

Support » Plugins and Hacks » Is there a way to use acf on widgets_init hook ?

Is there a way to use acf on widgets_init hook ?

  • Mihail Semjonov
    Participant

    @muxahuk1214

    Hi there,
    I’m triyng to make something like “sidebar creation” from acf (options page and repeater field)..
    The problem is that in functions.php get_field returns false and i can’t get the values from options page and repeater field..
    Mey be there’s anothere solution on how to get repeater field from options page ?
    I’m trying:

    function unit_widgets_init() {
            echo '<pre>';
            var_dump(get_field('repeater_field','options'));
            echo '</pre>';
        }
        add_action( 'widgets_init', 'unit_widgets_init' );

    and it gives false
    On front end everithing is working fine.
    Is there a solution ?

    http://wordpress.org/plugins/advanced-custom-fields/

  • The topic ‘Is there a way to use acf on widgets_init hook ?’ is closed to new replies.