{"action":"created","issue":{"url":"https://api.github.com/repos/Rarst/advanced-hooks-api/issues/1","labels_url":"https://api.github.com/repos/Rarst/advanced-hooks-api/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Rarst/advanced-hooks-api/issues/1/comments","events_url":"https://api.github.com/repos/Rarst/advanced-hooks-api/issues/1/events","html_url":"https://github.com/Rarst/advanced-hooks-api/issues/1","id":42387210,"number":1,"title":"Any examples ??","user":{"login":"bryanwillis","id":4042621,"avatar_url":"https://avatars.githubusercontent.com/u/4042621?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanwillis","html_url":"https://github.com/bryanwillis","followers_url":"https://api.github.com/users/bryanwillis/followers","following_url":"https://api.github.com/users/bryanwillis/following{/other_user}","gists_url":"https://api.github.com/users/bryanwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanwillis/subscriptions","organizations_url":"https://api.github.com/users/bryanwillis/orgs","repos_url":"https://api.github.com/users/bryanwillis/repos","events_url":"https://api.github.com/users/bryanwillis/events{/privacy}","received_events_url":"https://api.github.com/users/bryanwillis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Rarst/advanced-hooks-api/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-09-10T08:00:26Z","updated_at":"2015-10-29T03:34:20Z","closed_at":"2014-11-07T13:58:52Z","body":"Hey Rarst this looks sweet. I'm surprised it's two years old and I haven't noticed it.\r\n\r\nThe readme seems simple enough, you got any examples by chance?"},"comment":{"url":"https://api.github.com/repos/Rarst/advanced-hooks-api/issues/comments/152064535","html_url":"https://github.com/Rarst/advanced-hooks-api/issues/1#issuecomment-152064535","issue_url":"https://api.github.com/repos/Rarst/advanced-hooks-api/issues/1","id":152064535,"user":{"login":"bryanwillis","id":4042621,"avatar_url":"https://avatars.githubusercontent.com/u/4042621?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanwillis","html_url":"https://github.com/bryanwillis","followers_url":"https://api.github.com/users/bryanwillis/followers","following_url":"https://api.github.com/users/bryanwillis/following{/other_user}","gists_url":"https://api.github.com/users/bryanwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanwillis/subscriptions","organizations_url":"https://api.github.com/users/bryanwillis/orgs","repos_url":"https://api.github.com/users/bryanwillis/repos","events_url":"https://api.github.com/users/bryanwillis/events{/privacy}","received_events_url":"https://api.github.com/users/bryanwillis/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T03:34:20Z","updated_at":"2015-10-29T03:34:20Z","body":"Hey Rarst! I just came back to this plugin. Forgot I asked this question awhile back... Thanks for the response!\r\n\r\nSo I guess I was wondering do we use these the same way we use normal actions and filters? I'm really interested in the run once function \r\n\r\nadd_action_once('admin_init', 'my_run_once_function_name');\r\n\r\n\r\nFor example, things like the below that someone would want to do on a lot of their sites. I used to use Drupal back in the day and miss having the ability to automate setups. I know it's probably just laziness when it's really not that hard to comment things out after they run, but it'd still be convenient!\r\n\r\n\r\n```php\r\n   function brw_insert_new_user() {\r\n    $user_data = array(\r\n    'ID' => '',\r\n    'user_pass' => '@sdfsdfsdfai$t(CePy&g',\r\n    'user_login' => 'JohnSmith',\r\n    'user_nicename' => 'John Smith',\r\n    'user_email' => 'johnsmith@example.com',\r\n    'display_name' => 'John Smith',\r\n    'nickname' => 'John',\r\n    'first_name' => 'John',\r\n    'last_name' => 'Smith',\r\n    'user_url' => '',\r\n    'user_registered' => '',\r\n    'role' => 'editor '\r\n    );\r\n    $user_id = wp_insert_user( $user_data );\r\n    }\r\n\r\n\r\nfunction brw_add_capability() {\r\n    $role = get_role( 'author' );\r\n    $role->add_cap( 'edit_users' ); \r\n}\r\n\r\n\r\nfunction brw_theme_setup() {\r\n                $core_settings = array(\r\n                        'avatar_default'                                => 'mystery',                                   // Comment Avatars should be using mystery by default\r\n                        'avatar_rating'                                 => 'G',                                                 // Avatar rating\r\n                        'comment_max_links'                             => 0,                                                   // We do not allow links from comments\r\n                        'comments_per_page'                             => 20                                                   // Default to 20 comments per page\r\n                );\r\n                foreach ( $core_settings as $k => $v ) {\r\n                        update_option( $k, $v );\r\n                }\r\n                wp_delete_post( 1, true );\r\n                wp_delete_post( 2, true );\r\n                wp_delete_comment( 1 );\r\n\r\n}\r\n```"}}