{"id":315,"date":"2020-03-11T08:02:33","date_gmt":"2020-03-11T08:02:33","guid":{"rendered":"https:\/\/stockpack.co\/blog\/?p=315"},"modified":"2020-06-11T16:24:15","modified_gmt":"2020-06-11T16:24:15","slug":"stockpack-settings-capability-filter","status":"publish","type":"post","link":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/","title":{"rendered":"StockPack settings capability filter"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you are looking to restrict the users that are allowed to edit StockPack settings, you can update the capability for which the settings page will be loaded. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a sample code that restricts the StockPack settings page to only users that are allowed to upload files. <\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"php\" data-theme=\"monokai\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"false\">&lt;?php\n\nadd_filter( 'stockpack_settings_capability', 'stockpack_settings' );\n\nfunction stockpack_settings( $capability ) {\n   return 'upload_files';\n}<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">If you have any questions, feel free to contact us via <a href=\"https:\/\/stockpack.co\/contact\">https:\/\/stockpack.co\/contact<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are looking to restrict the users that are allowed to edit StockPack settings, you can update the capability for which the settings page will be loaded.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,11],"tags":[],"class_list":["post-315","post","type-post","status-publish","format-standard","hentry","category-documentation","category-help"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>StockPack settings capability filter - StockPack Blog<\/title>\n<meta name=\"description\" content=\"If you are looking to restrict the users that are allowed to edit StockPack settings, you can update the capability for which the settings page will be loaded.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"StockPack settings capability filter - StockPack Blog\" \/>\n<meta property=\"og:description\" content=\"If you are looking to restrict the users that are allowed to edit StockPack settings, you can update the capability for which the settings page will be loaded.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/\" \/>\n<meta property=\"og:site_name\" content=\"StockPack Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-11T08:02:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-11T16:24:15+00:00\" \/>\n<meta name=\"author\" content=\"Ionut Calara\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ionut_calara\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ionut Calara\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/\"},\"author\":{\"name\":\"Ionut Calara\",\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#\\\/schema\\\/person\\\/9112129d4a5ac02fa752ed0bd3227095\"},\"headline\":\"StockPack settings capability filter\",\"datePublished\":\"2020-03-11T08:02:33+00:00\",\"dateModified\":\"2020-06-11T16:24:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/\"},\"wordCount\":67,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#organization\"},\"articleSection\":[\"Documentation\",\"Help\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/\",\"url\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/\",\"name\":\"StockPack settings capability filter - StockPack Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#website\"},\"datePublished\":\"2020-03-11T08:02:33+00:00\",\"dateModified\":\"2020-06-11T16:24:15+00:00\",\"description\":\"If you are looking to restrict the users that are allowed to edit StockPack settings, you can update the capability for which the settings page will be loaded.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/stockpack-settings-capability-filter\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"StockPack settings capability filter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/\",\"name\":\"StockPack Blog\",\"description\":\"Stock images in WordPress\",\"publisher\":{\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#organization\",\"name\":\"StockPack Blog\",\"url\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/12\\\/logo-white.png\",\"contentUrl\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/12\\\/logo-white.png\",\"width\":230,\"height\":58,\"caption\":\"StockPack Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/#\\\/schema\\\/person\\\/9112129d4a5ac02fa752ed0bd3227095\",\"name\":\"Ionut Calara\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6de78df9383e3b7860eb9bed449329458a447ac1eb1281fa8cb1925cbbd27cf7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6de78df9383e3b7860eb9bed449329458a447ac1eb1281fa8cb1925cbbd27cf7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6de78df9383e3b7860eb9bed449329458a447ac1eb1281fa8cb1925cbbd27cf7?s=96&d=mm&r=g\",\"caption\":\"Ionut Calara\"},\"description\":\"Ionut is a full stack developer with a lot of love for well-built things. He loves products that have the user in mind and strives to build good UX. When he isn't coding, he'll spend as much time as possible with family and friends.\",\"sameAs\":[\"https:\\\/\\\/ionutcalara.me\",\"Calara Ionut\",\"https:\\\/\\\/x.com\\\/ionut_calara\"],\"url\":\"https:\\\/\\\/stockpack.co\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"StockPack settings capability filter - StockPack Blog","description":"If you are looking to restrict the users that are allowed to edit StockPack settings, you can update the capability for which the settings page will be loaded.","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:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/","og_locale":"en_US","og_type":"article","og_title":"StockPack settings capability filter - StockPack Blog","og_description":"If you are looking to restrict the users that are allowed to edit StockPack settings, you can update the capability for which the settings page will be loaded.","og_url":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/","og_site_name":"StockPack Blog","article_published_time":"2020-03-11T08:02:33+00:00","article_modified_time":"2020-06-11T16:24:15+00:00","author":"Ionut Calara","twitter_card":"summary_large_image","twitter_creator":"@ionut_calara","twitter_misc":{"Written by":"Ionut Calara"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/#article","isPartOf":{"@id":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/"},"author":{"name":"Ionut Calara","@id":"https:\/\/stockpack.co\/blog\/#\/schema\/person\/9112129d4a5ac02fa752ed0bd3227095"},"headline":"StockPack settings capability filter","datePublished":"2020-03-11T08:02:33+00:00","dateModified":"2020-06-11T16:24:15+00:00","mainEntityOfPage":{"@id":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/"},"wordCount":67,"commentCount":0,"publisher":{"@id":"https:\/\/stockpack.co\/blog\/#organization"},"articleSection":["Documentation","Help"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/","url":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/","name":"StockPack settings capability filter - StockPack Blog","isPartOf":{"@id":"https:\/\/stockpack.co\/blog\/#website"},"datePublished":"2020-03-11T08:02:33+00:00","dateModified":"2020-06-11T16:24:15+00:00","description":"If you are looking to restrict the users that are allowed to edit StockPack settings, you can update the capability for which the settings page will be loaded.","breadcrumb":{"@id":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/stockpack.co\/blog\/stockpack-settings-capability-filter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/stockpack.co\/blog\/"},{"@type":"ListItem","position":2,"name":"StockPack settings capability filter"}]},{"@type":"WebSite","@id":"https:\/\/stockpack.co\/blog\/#website","url":"https:\/\/stockpack.co\/blog\/","name":"StockPack Blog","description":"Stock images in WordPress","publisher":{"@id":"https:\/\/stockpack.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/stockpack.co\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/stockpack.co\/blog\/#organization","name":"StockPack Blog","url":"https:\/\/stockpack.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stockpack.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/stockpack.co\/blog\/wp-content\/uploads\/2019\/12\/logo-white.png","contentUrl":"https:\/\/stockpack.co\/blog\/wp-content\/uploads\/2019\/12\/logo-white.png","width":230,"height":58,"caption":"StockPack Blog"},"image":{"@id":"https:\/\/stockpack.co\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/stockpack.co\/blog\/#\/schema\/person\/9112129d4a5ac02fa752ed0bd3227095","name":"Ionut Calara","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6de78df9383e3b7860eb9bed449329458a447ac1eb1281fa8cb1925cbbd27cf7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6de78df9383e3b7860eb9bed449329458a447ac1eb1281fa8cb1925cbbd27cf7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6de78df9383e3b7860eb9bed449329458a447ac1eb1281fa8cb1925cbbd27cf7?s=96&d=mm&r=g","caption":"Ionut Calara"},"description":"Ionut is a full stack developer with a lot of love for well-built things. He loves products that have the user in mind and strives to build good UX. When he isn't coding, he'll spend as much time as possible with family and friends.","sameAs":["https:\/\/ionutcalara.me","Calara Ionut","https:\/\/x.com\/ionut_calara"],"url":"https:\/\/stockpack.co\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/posts\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":4,"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"predecessor-version":[{"id":341,"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions\/341"}],"wp:attachment":[{"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockpack.co\/blog\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}