BuddyDev

Search

mpp_register_component( $args )

Register a new component type.

Description

This function is used to register new component types. In core, we use it to register “sitewide”, “members” and “groups” component.

Parameters

$args

  • key (string) (Required) Unique identifier for this component. Example “sitewide”, “members”,”groups”, “events” etc.
  • label (string) (Required) A name for this component. Example:- “Sitewide Gallery”, “User Gallery”, “Group Gallery”
  • labels (array) (Required ) An associative array with two keys, “singular_name”, “plural_name” the values represent labels.
  • description (string) (Optional) A textual description of this component.

Returns

It does not return anything.

 Examples

The code shows how we register the Sitewide gallery component

 

please note that a component dictates the url permalink for a gallery/media and the url handling needs additional code not covered here.

Note:-

It must be used on or after “mpp_setup_core” action.

See also:-

mpp_deregister_component

 Changelog

  • Since 1.0.0

Source

medisapress/core/api/mpp-api.php