{"id":267,"date":"2016-01-16T00:20:36","date_gmt":"2016-01-16T00:20:36","guid":{"rendered":"http:\/\/buddydev.com\/mediapress\/?p=267"},"modified":"2016-01-16T00:20:36","modified_gmt":"2016-01-16T00:20:36","slug":"mpp_register_type","status":"publish","type":"post","link":"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/","title":{"rendered":"mpp_register_type"},"content":{"rendered":"<h3>\u00a0mpp_register_type ( $args )<\/h3>\n<p>Register a new media\/gallery\u00a0type.<\/p>\n<h3>Description<\/h3>\n<p>This\u00a0function is used to register new gallery or media type.<\/p>\n<h3>Parameters<\/h3>\n<p><strong>$args<\/strong><\/p>\n<ul>\n<li>key (string) (Required)\u00a0Unique identifier for this type. Example &#8220;photo&#8221;, &#8220;audio&#8221;,&#8221;video&#8221; etc.<\/li>\n<li>label (string) (Required)\u00a0A name for this status. Example:- &#8220;Photo&#8221;, &#8220;Audio&#8221;, &#8220;Video&#8221;<\/li>\n<li>labels (array) (Required\u00a0)\u00a0An associative array with two keys, &#8220;singular_name&#8221;, &#8220;plural_name&#8221; the values represent labels.<\/li>\n<li>description (string) (Optional)\u00a0A textual description of this status<\/li>\n<li>extensions (array) (Required )\u00a0An array of file extensions allowed for the media of this type.<\/li>\n<\/ul>\n<h3>Returns<\/h3>\n<p>It does not return anything.<\/p>\n<h3>\u00a0Examples<\/h3>\n<p>The code shows\u00a0how we register the Friends only privacy<\/p>\n<pre class=\"lang:default decode:true\">function mpp_custom_register_presentation_type() {\r\n\t\t\r\n    \/\/video\r\n    mpp_register_type( array(\r\n            'key'           =&gt; 'presentation',\r\n            'label'         =&gt; __( 'Presentation', 'mediapress' ),\r\n\t\t\t'labels'\t\t=&gt; array(\r\n\t\t\t\t\t\t\t\t'singular_name'\t=&gt; __( 'Presentation', 'mediapress' ),\r\n\t\t\t\t\t\t\t\t'plural_name'\t=&gt; __( 'Presentations', 'mediapress' )\r\n\t\t\t),\r\n            'description'   =&gt; __( 'Presentation media type taxonomy', 'mediapress' ),\r\n\t\t\t'extensions'\t=&gt; array( 'ppt', 'pps', 'pptx', 'odp' )\r\n    ) );\r\n\t\t\r\n}\r\n\r\nadd_action( 'mpp_setup', 'mpp_custom_register_presentation_type', 11 );<\/pre>\n<p>In the above code, we have created a new media\/gallery type called presentation and have allowed file types with extensions &#8220;ppt&#8221;, &#8220;pps&#8221;, &#8220;pptx&#8221;, &#8220;odp&#8221; to be uploadable to this type of gallery.<\/p>\n<p>To make this media type available to a component, we need to tell the system that this type is supported for a component type. We can use the following code to make presentations available to sitewide and user component.<\/p>\n<pre class=\"lang:default decode:true \">function mpp_custom_register_presentation_type_support() {\r\n\r\n\t\r\n\tmpp_component_add_type_support( 'sitewide', 'presentation');\r\n\tmpp_component_add_type_support( 'members', 'presentation');\r\n\t\t\r\n}\r\n\r\nadd_action( 'mpp_setup', 'mpp_custom_register_presentation_type', 12 );\r\n<\/pre>\n<p>The above code lets the system know that this type is available for the sitewide and members component. MediaPress will let admin choose whether to allow users to use this type or not.<\/p>\n<p>&nbsp;<\/p>\n<h3>Note:-<\/h3>\n<p>It must be used on or after &#8220;mpp_setup_core&#8221; action.<\/p>\n<h3>See also:-<\/h3>\n<p><a href=\"https:\/\/buddydev.com\/mediapress\/topics\/api-reference\/core\/status\/mpp_deregister_type\/\">mpp_deregister_type<\/a><\/p>\n<h3>\u00a0Changelog<\/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>\u00a0mpp_register_type ( $args ) Register a new media\/gallery\u00a0type. Description This\u00a0function is used to register new gallery or media type. Parameters $args key (string) (Required)\u00a0Unique identifier for this type. Example &#8220;photo&#8221;, &#8220;audio&#8221;,&#8221;video&#8221; etc. label (string) (Required)\u00a0A name for this status. Example:- &#8220;Photo&#8221;, &#8220;Audio&#8221;, &#8220;Video&#8221; labels (array) (Required\u00a0)\u00a0An associative array with two keys, &#8220;singular_name&#8221;, &#8220;plural_name&#8221; the values &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7428],"tags":[],"class_list":["clearfix","post-267","post","type-post","status-publish","format-standard","hentry","category-media-type"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>mpp_register_type &#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-type\/mpp_register_type\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"mpp_register_type &#8226; MediaPress | BuddyDev\" \/>\n<meta property=\"og:description\" content=\"\u00a0mpp_register_type ( $args ) Register a new media\/gallery\u00a0type. Description This\u00a0function is used to register new gallery or media type. Parameters $args key (string) (Required)\u00a0Unique identifier for this type. Example &#8220;photo&#8221;, &#8220;audio&#8221;,&#8221;video&#8221; etc. label (string) (Required)\u00a0A name for this status. Example:- &#8220;Photo&#8221;, &#8220;Audio&#8221;, &#8220;Video&#8221; labels (array) (Required\u00a0)\u00a0An associative array with two keys, &#8220;singular_name&#8221;, &#8220;plural_name&#8221; the values ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/\" \/>\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-01-16T00:20:36+00:00\" \/>\n<meta name=\"author\" content=\"Brajesh Singh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sbrajesh\" \/>\n<meta name=\"twitter:site\" content=\"@buddydev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brajesh Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/\",\"url\":\"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/\",\"name\":\"mpp_register_type &#8226; MediaPress | BuddyDev\",\"isPartOf\":{\"@id\":\"https:\/\/buddydev.com\/mediapress\/#website\"},\"datePublished\":\"2016-01-16T00:20:36+00:00\",\"author\":{\"@id\":\"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb\"},\"breadcrumb\":{\"@id\":\"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/buddydev.com\/mediapress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"mpp_register_type\"}]},{\"@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\/4ebf5f3e519f8cbddc6583e182dbe4fb\",\"name\":\"Brajesh Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/image\/\",\"url\":\"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon\",\"contentUrl\":\"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon\",\"caption\":\"Brajesh Singh\"},\"sameAs\":[\"http:\/\/buddydev.com\/members\/sbrajesh\/\",\"https:\/\/x.com\/sbrajesh\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"mpp_register_type &#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-type\/mpp_register_type\/","og_locale":"en_US","og_type":"article","og_title":"mpp_register_type &#8226; MediaPress | BuddyDev","og_description":"\u00a0mpp_register_type ( $args ) Register a new media\/gallery\u00a0type. Description This\u00a0function is used to register new gallery or media type. Parameters $args key (string) (Required)\u00a0Unique identifier for this type. Example &#8220;photo&#8221;, &#8220;audio&#8221;,&#8221;video&#8221; etc. label (string) (Required)\u00a0A name for this status. Example:- &#8220;Photo&#8221;, &#8220;Audio&#8221;, &#8220;Video&#8221; labels (array) (Required\u00a0)\u00a0An associative array with two keys, &#8220;singular_name&#8221;, &#8220;plural_name&#8221; the values ...","og_url":"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/","og_site_name":"MediaPress | BuddyDev","article_publisher":"https:\/\/www.facebook.com\/bpdev","article_published_time":"2016-01-16T00:20:36+00:00","author":"Brajesh Singh","twitter_card":"summary_large_image","twitter_creator":"@sbrajesh","twitter_site":"@buddydev","twitter_misc":{"Written by":"Brajesh Singh","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/","url":"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/","name":"mpp_register_type &#8226; MediaPress | BuddyDev","isPartOf":{"@id":"https:\/\/buddydev.com\/mediapress\/#website"},"datePublished":"2016-01-16T00:20:36+00:00","author":{"@id":"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb"},"breadcrumb":{"@id":"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/buddydev.com\/mediapress\/media-type\/mpp_register_type\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/buddydev.com\/mediapress\/"},{"@type":"ListItem","position":2,"name":"mpp_register_type"}]},{"@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\/4ebf5f3e519f8cbddc6583e182dbe4fb","name":"Brajesh Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buddydev.com\/mediapress\/#\/schema\/person\/image\/","url":"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon","contentUrl":"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon","caption":"Brajesh Singh"},"sameAs":["http:\/\/buddydev.com\/members\/sbrajesh\/","https:\/\/x.com\/sbrajesh"]}]}},"_links":{"self":[{"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/posts\/267","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/comments?post=267"}],"version-history":[{"count":1,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/posts\/267\/revisions"}],"predecessor-version":[{"id":268,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/posts\/267\/revisions\/268"}],"wp:attachment":[{"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/media?parent=267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/categories?post=267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buddydev.com\/mediapress\/wp-json\/wp\/v2\/tags?post=267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}