{"action":"created","issue":{"url":"https://api.github.com/repos/aristath/kirki/issues/332","labels_url":"https://api.github.com/repos/aristath/kirki/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/aristath/kirki/issues/332/comments","events_url":"https://api.github.com/repos/aristath/kirki/issues/332/events","html_url":"https://github.com/aristath/kirki/issues/332","id":105602469,"number":332,"title":"Not able to remove panels, sections, fields","user":{"login":"patrickedqvist","id":318754,"avatar_url":"https://avatars.githubusercontent.com/u/318754?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickedqvist","html_url":"https://github.com/patrickedqvist","followers_url":"https://api.github.com/users/patrickedqvist/followers","following_url":"https://api.github.com/users/patrickedqvist/following{/other_user}","gists_url":"https://api.github.com/users/patrickedqvist/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickedqvist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickedqvist/subscriptions","organizations_url":"https://api.github.com/users/patrickedqvist/orgs","repos_url":"https://api.github.com/users/patrickedqvist/repos","events_url":"https://api.github.com/users/patrickedqvist/events{/privacy}","received_events_url":"https://api.github.com/users/patrickedqvist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-09T14:00:31Z","updated_at":"2015-09-09T18:43:27Z","closed_at":null,"body":"## The Problem\r\nThe WordPress way of removing panels, sections, settings and controls does not work with panels, sections or fields added with the kirki framework.\r\n\r\n### Background\r\nI am using a set of panels, sections and fields for several themes but i want to remove certain fields for a specific theme. By overriding them with a function in the specifics theme function.php file. \r\n\r\n#### Example\r\nThe file used in every theme\r\n```php\r\nfunction my_customize_register( $wp_customize ) {\r\n\r\nKirki::add_panel( 'theme_event_panel', array(\r\n 'priority'    => 20,\r\n 'title'       => __( 'Event Information', 'textdomain' ),\r\n));\r\n \r\nKirki::add_section( 'theme_event_registration_section', array(\r\n 'title'          => __( 'Registration Button', 'textdomain' ),\r\n 'panel'          => 'theme_event_panel',\r\n 'priority'       => 20,\r\n 'capability'     => 'edit_theme_options',\r\n));\r\n\r\nKirki::add_field( 'theme_config', array(\r\n 'type' => 'text',\r\n 'settings' => 'event_registration_text',\r\n 'label' => __( 'Button text', 'textdomain' ),\r\n 'description' => __('Write what the button should say. Default message is \"Register Now\".', 'textdomain'),\r\n 'default' => __('Register Now', 'textdomain'),\r\n 'section'  => 'theme_event_registration_section',\r\n 'priority' => 10,\r\n));\r\n\r\n}\r\nadd_action('customize_register', 'my_customize_register');\r\n```\r\n\r\nFunction in a specific theme\r\n```php\r\nfunction theme_slug_customize_register( $wp_customize ) {\r\n $wp_customize->remove_panel('theme_event_panel');\r\n $wp_customize->remove_section('theme_event_registration_section');\r\n $wp_customize->remove_setting('event_registration_text');\r\n $wp_customize->remove_control('event_registration_text');\r\n}\r\nadd_action('customize_register', 'theme_slug_customize_register');\r\n```"},"comment":{"url":"https://api.github.com/repos/aristath/kirki/issues/comments/139002450","html_url":"https://github.com/aristath/kirki/issues/332#issuecomment-139002450","issue_url":"https://api.github.com/repos/aristath/kirki/issues/332","id":139002450,"user":{"login":"aristath","id":588688,"avatar_url":"https://avatars.githubusercontent.com/u/588688?v=3","gravatar_id":"","url":"https://api.github.com/users/aristath","html_url":"https://github.com/aristath","followers_url":"https://api.github.com/users/aristath/followers","following_url":"https://api.github.com/users/aristath/following{/other_user}","gists_url":"https://api.github.com/users/aristath/gists{/gist_id}","starred_url":"https://api.github.com/users/aristath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aristath/subscriptions","organizations_url":"https://api.github.com/users/aristath/orgs","repos_url":"https://api.github.com/users/aristath/repos","events_url":"https://api.github.com/users/aristath/events{/privacy}","received_events_url":"https://api.github.com/users/aristath/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T18:43:26Z","updated_at":"2015-09-09T18:43:26Z","body":"Can you please try adding a priority > 99?\r\nSo instead of this:\r\n```php\r\nadd_action('customize_register', 'my_customize_register');\r\n```\r\ntry this:\r\n```php\r\nadd_action( 'customize_register', 'my_customize_register', 100 );\r\n```\r\nThe reason I'm telling to do this is because in order to remove something it must first exist.\r\nWe add panels/sections/fields with a priority of 99, so it should work if you use a greater number than that.\r\n\r\nLet me know if that works!"}}