• Resolved ace0930

    (@ace0930)


    What is the difference between wp_add_dashboard_widget and add_meta_boxes?

    I can see that wp_add_dashboard_widget uses add_meta_boxes in the source.

    So why not just use the add_meta_boxes?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    ˉ\_(ツ)_/ˉ

    There are numerous other “wrapper” functions that are essentially alternative names to another function. Sometimes they are literally aliases for the same thing. For convenience, other ones will set specific default args before calling the more generic function, so we don’t need to be so concerned with every single arg required by the generic function.

    For example, wp_add_dashboard_widget() sets a certain default control callback and its args that are unique to the dashboard so we needn’t be concerned with those aspects if they work for us. Or we can override them if not.

    You’re always free to use the more generic function if you prefer ??

Viewing 1 replies (of 1 total)
  • The topic ‘add_meta_boxes vs wp_add_dashboard_widget’ is closed to new replies.