WordPress.org

Forums

Advanced Custom Fields
Is there a way to use acf on widgets_init hook ? (1 post)

  1. Mihail Semjonov
    Member
    Posted 1 year ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.