{"id":887,"date":"2012-11-13T14:09:45","date_gmt":"2012-11-13T22:09:45","guid":{"rendered":"http:\/\/blog.portnumber53.com\/?p=887"},"modified":"2012-11-13T14:09:45","modified_gmt":"2012-11-13T22:09:45","slug":"wordpress-allowing-contributors-to-upload-media","status":"publish","type":"post","link":"https:\/\/blog.portnumber53.com\/index.php\/2012\/11\/13\/wordpress-allowing-contributors-to-upload-media\/","title":{"rendered":"WordPress: Allowing contributors to upload media"},"content":{"rendered":"<p>&nbsp;<\/p>\n<div>This is the simplest way I found to allow for contributors to upload media on your WordPress blog:<\/div>\n<div>&nbsp;<\/div>\n<div>Add this to the functions.php file in your current theme:<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>if ( current_user_can(&#39;contributor&#39;) &amp;&amp; !current_user_can(&#39;upload_files&#39;) )<\/div>\n<div>add_action(&#39;admin_init&#39;, &#39;allow_contributor_uploads&#39;);<\/div>\n<div>&nbsp;<\/div>\n<div>function allow_contributor_uploads() {<\/div>\n<div>$contributor = get_role(&#39;contributor&#39;);<\/div>\n<div>$contributor-&gt;add_cap(&#39;upload_files&#39;);<\/div>\n<div>}<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>source: http:\/\/wordpress.org\/support\/topic\/allow-contributor-to-upload-media<\/div>\n<div>&nbsp;<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; This is the simplest way I found to allow for contributors to upload media on your WordPress blog: &nbsp; Add this to the functions.php file in your current theme: &nbsp; &nbsp; &nbsp; if ( current_user_can(&#39;contributor&#39;) &amp;&amp; !current_user_can(&#39;upload_files&#39;) ) add_action(&#39;admin_init&#39;, &#39;allow_contributor_uploads&#39;); &nbsp; function allow_contributor_uploads() { $contributor = get_role(&#39;contributor&#39;); $contributor-&gt;add_cap(&#39;upload_files&#39;); }&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/blog.portnumber53.com\/index.php\/2012\/11\/13\/wordpress-allowing-contributors-to-upload-media\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,27],"tags":[],"class_list":["post-887","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-wordpress"],"_links":{"self":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/comments?post=887"}],"version-history":[{"count":0,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/887\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/media?parent=887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/categories?post=887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/tags?post=887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}