{"id":550,"date":"2016-06-21T01:06:50","date_gmt":"2016-06-21T01:06:50","guid":{"rendered":"https:\/\/buddydev.com\/mediapress\/?p=550"},"modified":"2016-06-21T15:57:28","modified_gmt":"2016-06-21T15:57:28","slug":"mpp_register_media_size","status":"publish","type":"post","link":"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/","title":{"rendered":"mpp_register_media_size"},"content":{"rendered":"<h3>mpp_register_media_size ( $args )<\/h3>\n<p>Register a new media size.<\/p>\n<h3>Description<\/h3>\n<p>This function is used to register a new media size.<\/p>\n<h3>Parameters<\/h3>\n<p><strong>$args<\/strong><\/p>\n<ul>\n<li>Name (string) (Required) the name for the media size.<\/li>\n<li>Width (int) (Required) the width of the image.<\/li>\n<li>Height (int) (Required ) the height of the image.<\/li>\n<li>Crop (boolean) (Optional)whether to crop or resize.<\/li>\n<li>Type (string) (Required ) the type of media.<\/li>\n<\/ul>\n<h3>Returns<\/h3>\n<p>Return true if registered successfully.<\/p>\n<h3>Examples<\/h3>\n<p>The code shows how we can register a new custom image size.<\/p>\n<pre class=\"lang:default decode:true \">function mpp_custom_setup_custom_image_size() {\r\n    \r\n        mpp_register_media_size( array(\r\n            'name'   =&gt; 'large',\r\n            'height' =&gt; 1000, \/\/change it\r\n            'width'  =&gt; 1000,\r\n            'crop'   =&gt; false,\r\n            'type'   =&gt; 'default'\/\/ can be photo\/video\/audio\/doc, default applies to all media type\r\n    ) );\r\n        \r\n}\r\nadd_action( 'mpp_setup_core', 'mpp_custom_setup_custom_image_size' );\r\n<\/pre>\n<p>In the above code, we have registered a new media size of ratio 1000&#215;1000.<\/p>\n<h3>Changelog<\/h3>\n<ul>\n<li>Since 1.0.0<\/li>\n<\/ul>\n<h3>Source<\/h3>\n<p>medisapress\/core\/api\/mpp-api.php<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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. &#8230;<\/p>\n","protected":false},"author":19070,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8211],"tags":[],"class_list":["clearfix","post-550","post","type-post","status-publish","format-standard","hentry","category-media-size"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>mpp_register_media_size &#8226; MediaPress | BuddyDev<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"mpp_register_media_size &#8226; MediaPress | BuddyDev\" \/>\n<meta property=\"og:description\" content=\"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. ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/\" \/>\n<meta property=\"og:site_name\" content=\"MediaPress | BuddyDev\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/bpdev\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-21T01:06:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-06-21T15:57:28+00:00\" \/>\n<meta name=\"author\" content=\"Ravi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@buddydev\" \/>\n<meta name=\"twitter:site\" content=\"@buddydev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ravi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/\",\"url\":\"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/\",\"name\":\"mpp_register_media_size &#8226; MediaPress | BuddyDev\",\"isPartOf\":{\"@id\":\"https:\/\/buddydev.com\/mediapress\/#website\"},\"datePublished\":\"2016-06-21T01:06:50+00:00\",\"dateModified\":\"2016-06-21T15:57:28+00:00\",\"author\":{\"@id\":\"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/01d5e7f6ed8de773cc82a4114293bbb4\"},\"breadcrumb\":{\"@id\":\"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/buddydev.com\/mediapress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"mpp_register_media_size\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/buddydev.com\/mediapress\/#website\",\"url\":\"https:\/\/buddydev.com\/mediapress\/\",\"name\":\"MediaPress | BuddyDev\",\"description\":\"The Best Media Gallery Plugin For BuddyPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/buddydev.com\/mediapress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/01d5e7f6ed8de773cc82a4114293bbb4\",\"name\":\"Ravi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/buddydev.com\/wp-content\/blogs.dir\/1\/files\/avatars\/19070\/debd52370a38cd6cd21dbbbb19c424c2-bpfull.jpg\",\"contentUrl\":\"https:\/\/buddydev.com\/wp-content\/blogs.dir\/1\/files\/avatars\/19070\/debd52370a38cd6cd21dbbbb19c424c2-bpfull.jpg\",\"caption\":\"Ravi\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"mpp_register_media_size &#8226; MediaPress | BuddyDev","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/","og_locale":"en_US","og_type":"article","og_title":"mpp_register_media_size &#8226; MediaPress | BuddyDev","og_description":"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. ...","og_url":"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/","og_site_name":"MediaPress | BuddyDev","article_publisher":"https:\/\/www.facebook.com\/bpdev","article_published_time":"2016-06-21T01:06:50+00:00","article_modified_time":"2016-06-21T15:57:28+00:00","author":"Ravi","twitter_card":"summary_large_image","twitter_creator":"@buddydev","twitter_site":"@buddydev","twitter_misc":{"Written by":"Ravi","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/","url":"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/","name":"mpp_register_media_size &#8226; MediaPress | BuddyDev","isPartOf":{"@id":"https:\/\/buddydev.com\/mediapress\/#website"},"datePublished":"2016-06-21T01:06:50+00:00","dateModified":"2016-06-21T15:57:28+00:00","author":{"@id":"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/01d5e7f6ed8de773cc82a4114293bbb4"},"breadcrumb":{"@id":"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/buddydev.com\/mediapress\/media-size\/mpp_register_media_size\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/buddydev.com\/mediapress\/"},{"@type":"ListItem","position":2,"name":"mpp_register_media_size"}]},{"@type":"WebSite","@id":"https:\/\/buddydev.com\/mediapress\/#website","url":"https:\/\/buddydev.com\/mediapress\/","name":"MediaPress | BuddyDev","description":"The Best Media Gallery Plugin For BuddyPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buddydev.com\/mediapress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/01d5e7f6ed8de773cc82a4114293bbb4","name":"Ravi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/image\/","url":"https:\/\/buddydev.com\/wp-content\/blogs.dir\/1\/files\/avatars\/19070\/debd52370a38cd6cd21dbbbb19c424c2-bpfull.jpg","contentUrl":"https:\/\/buddydev.com\/wp-content\/blogs.dir\/1\/files\/avatars\/19070\/debd52370a38cd6cd21dbbbb19c424c2-bpfull.jpg","caption":"Ravi"}}]}},"_links":{"self":[{"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/users\/19070"}],"replies":[{"embeddable":true,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":6,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":556,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/posts\/550\/revisions\/556"}],"wp:attachment":[{"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}