BuddyDev

Search

mpp_register_media_size ( $args )

Register a new media size.

Description

This function is used to register a new media size.

Parameters

$args

  • Name (string) (Required) the name for the media size.
  • Width (int) (Required) the width of the image.
  • Height (int) (Required ) the height of the image.
  • Crop (boolean) (Optional)whether to crop or resize.
  • Type (string) (Required ) the type of media.

Returns

Return true if registered successfully.

Examples

The code shows how we can register a new custom image size.

In the above code, we have registered a new media size of ratio 1000×1000.

Changelog

  • Since 1.0.0

Source

medisapress/core/api/mpp-api.php