{"action":"created","issue":{"url":"https://api.github.com/repos/nash-ye/WP-Conditional-Themes/issues/2","labels_url":"https://api.github.com/repos/nash-ye/WP-Conditional-Themes/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/nash-ye/WP-Conditional-Themes/issues/2/comments","events_url":"https://api.github.com/repos/nash-ye/WP-Conditional-Themes/issues/2/events","html_url":"https://github.com/nash-ye/WP-Conditional-Themes/issues/2","id":101989412,"number":2,"title":"How do I switch to a theme based on role and page URI pattern?","user":{"login":"beatelite","id":3364230,"avatar_url":"https://avatars.githubusercontent.com/u/3364230?v=3","gravatar_id":"","url":"https://api.github.com/users/beatelite","html_url":"https://github.com/beatelite","followers_url":"https://api.github.com/users/beatelite/followers","following_url":"https://api.github.com/users/beatelite/following{/other_user}","gists_url":"https://api.github.com/users/beatelite/gists{/gist_id}","starred_url":"https://api.github.com/users/beatelite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beatelite/subscriptions","organizations_url":"https://api.github.com/users/beatelite/orgs","repos_url":"https://api.github.com/users/beatelite/repos","events_url":"https://api.github.com/users/beatelite/events{/privacy}","received_events_url":"https://api.github.com/users/beatelite/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-19T20:20:29Z","updated_at":"2015-08-22T01:00:53Z","closed_at":null,"body":"For example,\r\n\r\nShow theme X if the viewer has a user role of \"administrator\", Contributor\" and \"editor\" and the page URI pattern is page-name or page-name-2 or page-name-3\"\r\n\r\nOtherwise, show original theme.\r\n\r\nAlso, are there wildcards allowed for URI? so instead of saying page-name-1 and page-name-2 we could just say:\r\n\r\nShow x theme for page-name/*\r\n\r\nThis would help in keeping us from having to type out all the page names to switch the theme on based on a certain pattern.\r\n\r\nLet me know - great idea for a plugin."},"comment":{"url":"https://api.github.com/repos/nash-ye/WP-Conditional-Themes/issues/comments/133621144","html_url":"https://github.com/nash-ye/WP-Conditional-Themes/issues/2#issuecomment-133621144","issue_url":"https://api.github.com/repos/nash-ye/WP-Conditional-Themes/issues/2","id":133621144,"user":{"login":"beatelite","id":3364230,"avatar_url":"https://avatars.githubusercontent.com/u/3364230?v=3","gravatar_id":"","url":"https://api.github.com/users/beatelite","html_url":"https://github.com/beatelite","followers_url":"https://api.github.com/users/beatelite/followers","following_url":"https://api.github.com/users/beatelite/following{/other_user}","gists_url":"https://api.github.com/users/beatelite/gists{/gist_id}","starred_url":"https://api.github.com/users/beatelite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beatelite/subscriptions","organizations_url":"https://api.github.com/users/beatelite/orgs","repos_url":"https://api.github.com/users/beatelite/repos","events_url":"https://api.github.com/users/beatelite/events{/privacy}","received_events_url":"https://api.github.com/users/beatelite/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T01:00:53Z","updated_at":"2015-08-22T01:00:53Z","body":"I am trying to figure this out. I'm attempting to use the is_page() tag to see if I can switch based on page id or name:\r\n\r\nfunction my_conditional_themes_setup() {\r\n\r\n    Conditional_Themes_Manager::register( 'mythemename', function() {\r\n        \r\n        return is_page( '111' );\r\n\r\n    } );\r\n\r\n\r\n}\r\n\r\n\r\nadd_action( 'plugins_loaded', 'my_conditional_themes_setup', 100 );\r\n\r\n\r\nHowever, this doesn't work. I even tried the page name but that doesn't work either. \r\n\r\nDoes it work with is_page() ?\r\n\r\nIf it did work, I assume I could easily use:\r\n\r\nfunction my_conditional_themes_setup() {\r\n\r\n    //Switch to admin theme if the user has administrator role.\r\n    Conditional_Themes_Manager::register( 'mythemename', function() {\r\n        \r\n       return current_user_can( 'administrator' ) || is_page( 'my-page-test' );\r\n     } );\r\n\r\n\r\n }\r\nadd_action( 'plugins_loaded', 'my_conditional_themes_setup', 100 );\r\n\r\n\r\nBut it looks like switching on page isn't available?\r\n\r\n"}}