{"id":128816,"date":"2020-09-18T13:28:31","date_gmt":"2020-09-18T13:28:31","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/wp-isadmin\/"},"modified":"2022-05-16T18:25:05","modified_gmt":"2022-05-16T18:25:05","slug":"wp-isadmin","status":"publish","type":"plugin","link":"https:\/\/sq.wordpress.org\/plugins\/wp-isadmin\/","author":8606618,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.1","stable_tag":"trunk","tested":"6.0.0","requires":"4.7","requires_php":"7.0","requires_plugins":"","header_name":"WP isAdmin","header_author":"Blaine Moore","header_description":"This plugin provides provides a simple short code to add or hide custom content to your posts and pages based on whether a user is an administrator or not.","assets_banners_color":"","last_updated":"2022-05-16 18:25:05","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.charitynavigator.org\/index.cfm?bay=search.summary&orgid=7614","header_plugin_uri":"https:\/\/github.com\/BlaineMoore\/wp-isadmin","header_author_uri":"https:\/\/blainemoore.com","rating":0,"author_block_rating":0,"active_installs":0,"downloads":798,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","faq","changelog"],"tags":{"1.0.1":{"tag":"1.0.1","author":"Blaine Moore","date":"2020-09-18 13:29:41"}},"upgrade_notice":{"1.0.1":"<p>This is the initial version. You need this for any functionality at all.<\/p>"},"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1"],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":2384469,"resolution":"1","location":"assets","locale":""},"screenshot-2.jpg":{"filename":"screenshot-2.jpg","revision":2384469,"resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"A simple example for how to use the shortcodes.","2":"An example that includes a javascript redirect for WishListMember private tags, which still allows the admin user to stay on the page."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[80],"plugin_category":[43],"plugin_contributors":[191005],"plugin_business_model":[],"class_list":["post-128816","plugin","type-plugin","status-publish","hentry","plugin_tags-shortcode","plugin_category-customization","plugin_contributors-blaine-moore","plugin_committers-blaine-moore"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-isadmin.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-isadmin\/assets\/screenshot-1.jpg?rev=2384469","caption":"A simple example for how to use the shortcodes."},{"src":"https:\/\/ps.w.org\/wp-isadmin\/assets\/screenshot-2.jpg?rev=2384469","caption":"An example that includes a javascript redirect for WishListMember private tags, which still allows the admin user to stay on the page."}],"raw_content":"<!--section=description-->\n<p>This plugin provides provides a simple short code to add or hide custom content to your posts and pages based on whether a user is an administrator (or other role) or not.<\/p>\n\n<p>This started as a way around having an automatic redirect if somebody belonged to a specific WishListMember membership level but not wanting to redirect <em>off<\/em> of the page \nif I was an admin (who always has access to all membership levels.)<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id='what%20shortcodes%20are%20available%3F'><h3>What shortcodes are available?<\/h3><\/dt>\n<dd><p>[isAdmin][\/isAdmin] and [isNotAdmin][\/isNotAdmin] are both supported, and will only show or hide the content (respectively) if the user is logged in and has an administrator \nrole (by default).<\/p><\/dd>\n<dt id='can%20i%20specify%20other%20roles%20than%20just%20the%20administrator%20role%3F'><h3>Can I specify other roles than just the administrator role?<\/h3><\/dt>\n<dd><p>Yes, you can set the <em>role<\/em> or <em>roles<\/em> attribute. So if you'd like content that can only be seen by users with the \"editor\" role, you would use: [isAdmin roles=\"editor\"][\/isAdmin].<\/p><\/dd>\n<dt id='can%20i%20specify%20more%20than%20one%20role%3F'><h3>Can I specify more than one role?<\/h3><\/dt>\n<dd><p>Yes, just provide a comma-separated list to the <em>roles<\/em> attribute. For example: [isAdmin roles=\"editor,administrator\"][\/isAdmin]<\/p><\/dd>\n<dt id='what%20is%20the%20difference%20between%20the%20%2Arole%2A%20and%20%2Aroles%2A%20attributes%3F'><h3>What is the difference between the *role* and *roles* attributes?<\/h3><\/dt>\n<dd><p>There is no difference; both are available as a convenience as I expected that if I wanted to change it I wouldn't remember if I needed it to be plural or not and it would seem \nodd to specify a plural attribute for a singular condition (and vice versa.) Basically, choose one or the other (if you want something other than checking for administrator) and\nit will work as expected. If you specify both, then the <em>roles<\/em> attribute takes precedence unless you set it to the default, in which case it will use the <em>role<\/em> attribute.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<p>= 1.0.1 (2020-09-17)=\n* Initial Version<\/p>","raw_excerpt":"This plugin provides provides a simple short code to add or hide custom content to your posts and pages based on whether a user is an administrator (o &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/128816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=128816"}],"author":[{"embeddable":true,"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/blaine-moore"}],"wp:attachment":[{"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=128816"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=128816"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=128816"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=128816"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=128816"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/sq.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=128816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}