{"action":"created","issue":{"url":"https://api.github.com/repos/justintadlock/hybrid-core/issues/103","labels_url":"https://api.github.com/repos/justintadlock/hybrid-core/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/justintadlock/hybrid-core/issues/103/comments","events_url":"https://api.github.com/repos/justintadlock/hybrid-core/issues/103/events","html_url":"https://github.com/justintadlock/hybrid-core/issues/103","id":75245131,"number":103,"title":"Layouts API testing","user":{"login":"justintadlock","id":1816309,"avatar_url":"https://avatars.githubusercontent.com/u/1816309?v=3","gravatar_id":"","url":"https://api.github.com/users/justintadlock","html_url":"https://github.com/justintadlock","followers_url":"https://api.github.com/users/justintadlock/followers","following_url":"https://api.github.com/users/justintadlock/following{/other_user}","gists_url":"https://api.github.com/users/justintadlock/gists{/gist_id}","starred_url":"https://api.github.com/users/justintadlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justintadlock/subscriptions","organizations_url":"https://api.github.com/users/justintadlock/orgs","repos_url":"https://api.github.com/users/justintadlock/repos","events_url":"https://api.github.com/users/justintadlock/events{/privacy}","received_events_url":"https://api.github.com/users/justintadlock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-05-11T14:41:13Z","updated_at":"2015-05-16T18:29:33Z","closed_at":null,"body":"This is something I've been wanting to do for about a year now.  I wanted to pull Theme Layouts from the `/extensions` folder and integrate it more directly in the framework.  I wanted to have a good, robust API for working with layouts.  And, I knew that doing all that registering in the `add_theme_support()` call would get messy.\r\n\r\nIf you grab the latest code, at least from commit https://github.com/justintadlock/hybrid-core/commit/9b942ed13828cc50848505d51ed903050f7258cb, you can see the changes.\r\n\r\nHere's the new usage:\r\n\r\n\t// In theme setup\r\n\tadd_theme_support( 'theme-layouts', array( 'default' => '2c-l' ) );\r\n\r\n\tadd_action( 'hybrid_register_layouts', 'my_register_layouts' );\r\n\r\n\tfunction my_register_layouts() {\r\n\t\r\n\t\thybrid_register_layout(\r\n\t\t\t'2c-l',\r\n\t\t\tarray(\r\n\t\t\t\t'label'              => _x( '2 Columns: Content / Sidebar', 'theme layout', 'hybrid-core' ),\r\n\t\t\t\t'show_in_customizer' => true,\r\n\t\t\t\t'show_in_meta_box'   => true,\r\n\t\t\t\t'image'              => '', // Image URL. Doesn't do anything yet.\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\thybrid_register_layout(\r\n\t\t\t'2c-r',\r\n\t\t\tarray(\r\n\t\t\t\t'label'              => _x( '2 Columns: Sidebar / Content', 'theme layout', 'hybrid-core' ),\r\n\t\t\t\t'show_in_customizer' => true,\r\n\t\t\t\t'show_in_meta_box'   => true,\r\n\t\t\t\t'image'              => '', // Image URL. Doesn't do anything yet.\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\nThis change will effectively fix #45 with a little code like this:\r\n\r\n\thybrid_get_layout_object( 'default' )->show_in_meta_box = false;"},"comment":{"url":"https://api.github.com/repos/justintadlock/hybrid-core/issues/comments/102664463","html_url":"https://github.com/justintadlock/hybrid-core/issues/103#issuecomment-102664463","issue_url":"https://api.github.com/repos/justintadlock/hybrid-core/issues/103","id":102664463,"user":{"login":"justintadlock","id":1816309,"avatar_url":"https://avatars.githubusercontent.com/u/1816309?v=3","gravatar_id":"","url":"https://api.github.com/users/justintadlock","html_url":"https://github.com/justintadlock","followers_url":"https://api.github.com/users/justintadlock/followers","following_url":"https://api.github.com/users/justintadlock/following{/other_user}","gists_url":"https://api.github.com/users/justintadlock/gists{/gist_id}","starred_url":"https://api.github.com/users/justintadlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justintadlock/subscriptions","organizations_url":"https://api.github.com/users/justintadlock/orgs","repos_url":"https://api.github.com/users/justintadlock/repos","events_url":"https://api.github.com/users/justintadlock/events{/privacy}","received_events_url":"https://api.github.com/users/justintadlock/received_events","type":"User","site_admin":false},"created_at":"2015-05-16T18:29:33Z","updated_at":"2015-05-16T18:29:33Z","body":"In https://github.com/justintadlock/hybrid-core/commit/c8ea289db4222c4adfaae6a4dd4f1b5b9a34ff46, you can pass an array of layouts to the customizer control like so:\r\n\r\n\t$wp_customize->add_control(\r\n\t    new Hybrid_Customize_Control_Theme_Layout(\r\n\t\t$wp_customize,\r\n\t\t'category_layout',\r\n\t\tarray(\r\n\t\t    'label'    => esc_html__( 'Category Layout', 'hybrid-core' ),\r\n\t\t    'section'  => 'layout',\r\n\t\t    'layouts'  => array( '2c-l', '2c-r' )\r\n\t\t)\r\n\t    )\r\n\t);\r\n\r\nIf not set, it'll fall back to all layouts."}}