Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Could you share the code you’re using for this?

    For clarification, are you trying to integrate the metaboxes into the widget itself? or just trying to fetch saved values to a metabox for display in the widget?

    Thread Starter CptCompiler

    (@cptcompiler)

    I am trying to integrate the metaboxes into the widget (backend).
    I just got it working. The save button of the metabox is working but the default save button from the widget is not.
    In the form()-function of the widget I call the cmb2_metabox_form()-function.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I had never thought of integrating a metabox into a widget before, so this is actually a very new area for me.

    I do know that widgets use a lot of ajax, so I’m curious if you have some sort of js console error going on when you’re using either of the save buttons.

    Plugin Author Justin Sternberg

    (@jtsternberg)

    This would have to be custom implementation of CMB2 that we wouldn’t necessarily support. You won’t want to use the cmb2_metabox_form function because that’s going to add <form> markup which is already provided by the widget. And you’ll have to handle the saving part using the widget API.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CMB in custom widget’ is closed to new replies.