To add your shortcode to MotoPress Content Editor interface you need to “describe” it first. To do that, create an instance of MPCEObject like this:
$youShortcodeObj = new MPCEObject( $id, $name, $icon, $attributes, $position, $closeType, $resize );
(string) (required) The $id should match with your shortcode tag name.
(string) (required) Specifies the name of the object in the MotoPress Content Editor interface.
(string) (required) path to the object icon within the wp-content folder.
Default: empty string
(string) (required) It defines enclosing or self-closing shortcode type. The value should be one of these constants:
- MPCEObject::SELF_CLOSED – if your shortcode is self-closed.
- MPCEObject::ENCLOSED – if your shortcode is enclosed.
Read more about enclosing & self-closing shortcodes.
Position of the object.
(string) Sets the ability to resize your object. List of the available options:
- MPCEObject::RESIZE_NONE – doesn’t allow to resize
- MPCEObject::RESIZE_HORIZONTAL – allows to resize horizontally
- MPCEObject::RESIZE_VERTICAL – allows to resize vertically
- MPCEObject::RESIZE_ALL – allows to resize horizontally and vertically
When your shortcode is completely described you can add it to the one of available groups within the addObject method.
$motopressCELibrary->addObject($youShortcodeObj, $group = 'other');
List of available groups: