Home Forums General Issues ACF widget dont save data. Reply To: ACF widget dont save data.

  • + The ID in the frontend differs to the widget ID in backend:

    class custom_Media_Widget extends WP_Widget
         * @param string $idBase
         * @param string $name
         * @param array  $widgetOptions
         * @param array  $controlOptions
        public function __construct(
            string $idBase = 'media_widget',
            string $name = 'Media Asset Widget',
            array $widgetOptions = [],
            array $controlOptions = []
        ) {
            $widgetOptions ['classname']   = 'media_widget';
            $widgetOptions ['description'] = 'Widget for Media Assets';
            parent::__construct($idBase, $name, $widgetOptions, $controlOptions);
        public function widget($args, $instance)

    will output: string 'media_widget-3' (length=14)

    Edit: The id/number which is set in the backend isn’t relevant anymore.
    I test it on the meta widget and it show the same behaviour.

    ID: meta-13 on save
    ID: meta-2 in frontend