{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/11392","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11392/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11392/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11392/events","html_url":"https://github.com/WordPress/gutenberg/issues/11392","id":376713813,"node_id":"MDU6SXNzdWUzNzY3MTM4MTM=","number":11392,"title":"Where to add JavaScript code for registerBlockStyle()","user":{"login":"dgwyer","id":1482075,"node_id":"MDQ6VXNlcjE0ODIwNzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1482075?v=4","gravatar_id":"","url":"https://api.github.com/users/dgwyer","html_url":"https://github.com/dgwyer","followers_url":"https://api.github.com/users/dgwyer/followers","following_url":"https://api.github.com/users/dgwyer/following{/other_user}","gists_url":"https://api.github.com/users/dgwyer/gists{/gist_id}","starred_url":"https://api.github.com/users/dgwyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgwyer/subscriptions","organizations_url":"https://api.github.com/users/dgwyer/orgs","repos_url":"https://api.github.com/users/dgwyer/repos","events_url":"https://api.github.com/users/dgwyer/events{/privacy}","received_events_url":"https://api.github.com/users/dgwyer/received_events","type":"User","site_admin":false},"labels":[{"id":567484057,"node_id":"MDU6TGFiZWw1Njc0ODQwNTc=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/Documentation","name":"Documentation","color":"bfd4f2","default":false},{"id":1020812022,"node_id":"MDU6TGFiZWwxMDIwODEyMDIy","url":"https://api.github.com/repos/WordPress/gutenberg/labels/Needs%20Technical%20Feedback","name":"Needs Technical Feedback","color":"67dff7","default":false},{"id":808238501,"node_id":"MDU6TGFiZWw4MDgyMzg1MDE=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Help%20Request","name":"[Type] Help Request","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/WordPress/gutenberg/milestones/50","html_url":"https://github.com/WordPress/gutenberg/milestone/50","labels_url":"https://api.github.com/repos/WordPress/gutenberg/milestones/50/labels","id":3261822,"node_id":"MDk6TWlsZXN0b25lMzI2MTgyMg==","number":50,"title":"Documentation & Handbook","description":"","creator":{"login":"karmatosed","id":253067,"node_id":"MDQ6VXNlcjI1MzA2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/253067?v=4","gravatar_id":"","url":"https://api.github.com/users/karmatosed","html_url":"https://github.com/karmatosed","followers_url":"https://api.github.com/users/karmatosed/followers","following_url":"https://api.github.com/users/karmatosed/following{/other_user}","gists_url":"https://api.github.com/users/karmatosed/gists{/gist_id}","starred_url":"https://api.github.com/users/karmatosed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karmatosed/subscriptions","organizations_url":"https://api.github.com/users/karmatosed/orgs","repos_url":"https://api.github.com/users/karmatosed/repos","events_url":"https://api.github.com/users/karmatosed/events{/privacy}","received_events_url":"https://api.github.com/users/karmatosed/received_events","type":"User","site_admin":false},"open_issues":38,"closed_issues":11,"state":"open","created_at":"2018-04-12T11:18:47Z","updated_at":"2018-11-22T10:07:56Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2018-11-02T08:32:26Z","updated_at":"2018-11-23T08:52:03Z","closed_at":null,"author_association":"NONE","body":"The docs for `registerBlockStyle()` explain what the function does and it's parameters but not _how_ to add the function to your own code.\r\n\r\nhttps://wordpress.org/gutenberg/handbook/extensibility/extending-blocks/#modifying-blocks\r\n\r\nFor now I'm just using the jQuery document ready callback function:\r\n```\r\njQuery( document ).ready( function( $ ) {\r\n\twp.blocks.registerBlockStyle( 'core/button', { name: 'custom-btn1', label: 'Custom 1' });\r\n} );\r\n```\r\n\r\nIs there an officially recommended way to use `registerBlockStyle()`? I'm currently writing a Tuts+ tutorial on this so I'd prefer to use the correct method to call this function."},"comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments/441183006","html_url":"https://github.com/WordPress/gutenberg/issues/11392#issuecomment-441183006","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11392","id":441183006,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTE4MzAwNg==","user":{"login":"mario-neuhold","id":29606929,"node_id":"MDQ6VXNlcjI5NjA2OTI5","avatar_url":"https://avatars3.githubusercontent.com/u/29606929?v=4","gravatar_id":"","url":"https://api.github.com/users/mario-neuhold","html_url":"https://github.com/mario-neuhold","followers_url":"https://api.github.com/users/mario-neuhold/followers","following_url":"https://api.github.com/users/mario-neuhold/following{/other_user}","gists_url":"https://api.github.com/users/mario-neuhold/gists{/gist_id}","starred_url":"https://api.github.com/users/mario-neuhold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mario-neuhold/subscriptions","organizations_url":"https://api.github.com/users/mario-neuhold/orgs","repos_url":"https://api.github.com/users/mario-neuhold/repos","events_url":"https://api.github.com/users/mario-neuhold/events{/privacy}","received_events_url":"https://api.github.com/users/mario-neuhold/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T08:52:03Z","updated_at":"2018-11-23T08:52:03Z","author_association":"NONE","body":"According to #11338 we're still experiencing timing issues fo runregisterBlockStyle() - it's not working in our plugins, but e.g. via Chrome Dev Console the function is working fine. Should we open a dedicated issue on that?"}}
{"actor":{"display_login":"mario-neuhold"}}