{"action":"created","issue":{"url":"https://api.github.com/repos/sheabunge/code-snippets/issues/37","labels_url":"https://api.github.com/repos/sheabunge/code-snippets/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/sheabunge/code-snippets/issues/37/comments","events_url":"https://api.github.com/repos/sheabunge/code-snippets/issues/37/events","html_url":"https://github.com/sheabunge/code-snippets/issues/37","id":79695947,"number":37,"title":"Hook after snippet execution","user":{"login":"signo","id":944774,"avatar_url":"https://avatars.githubusercontent.com/u/944774?v=3","gravatar_id":"","url":"https://api.github.com/users/signo","html_url":"https://github.com/signo","followers_url":"https://api.github.com/users/signo/followers","following_url":"https://api.github.com/users/signo/following{/other_user}","gists_url":"https://api.github.com/users/signo/gists{/gist_id}","starred_url":"https://api.github.com/users/signo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signo/subscriptions","organizations_url":"https://api.github.com/users/signo/orgs","repos_url":"https://api.github.com/users/signo/repos","events_url":"https://api.github.com/users/signo/events{/privacy}","received_events_url":"https://api.github.com/users/signo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-23T02:30:36Z","updated_at":"2015-05-24T11:34:22Z","closed_at":"2015-05-24T11:34:22Z","body":"There are certain snippets that should only run once like transients clean up, permalink structure reset or database handling, i suggest to add an action named code_snippets/after_execute_snippet allowing the developer to do any stuff he/she likes after the snippet executes, this way for example i could just write my own code to disable the snippet, bellow is a suggestion for the hook implementation, btw i noticed that you return the snippet eval result in execute_snippet() so i added it to the hook too.\r\n\r\n```\r\n        foreach ( $active_snippets as $snippet_id => $snippet ) {\r\n\r\n            if ( apply_filters( 'code_snippets/allow_execute_snippet', true, $snippet_id ) ) {\r\n                /* Execute the PHP code */\r\n                $result = execute_snippet( $snippet->code );\r\n                do_action( 'code_snippets/after_execute_snippet', $result, $snippet_id );\r\n            }\r\n        }\r\n\r\n```\r\n\r\nOne last note: semantically i think it sounds better 'allow_snippet_execute' and 'after_snippet_execute', i am not completely sure since English is not my primary language.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/sheabunge/code-snippets/issues/comments/105003695","html_url":"https://github.com/sheabunge/code-snippets/issues/37#issuecomment-105003695","issue_url":"https://api.github.com/repos/sheabunge/code-snippets/issues/37","id":105003695,"user":{"login":"sheabunge","id":1170783,"avatar_url":"https://avatars.githubusercontent.com/u/1170783?v=3","gravatar_id":"","url":"https://api.github.com/users/sheabunge","html_url":"https://github.com/sheabunge","followers_url":"https://api.github.com/users/sheabunge/followers","following_url":"https://api.github.com/users/sheabunge/following{/other_user}","gists_url":"https://api.github.com/users/sheabunge/gists{/gist_id}","starred_url":"https://api.github.com/users/sheabunge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheabunge/subscriptions","organizations_url":"https://api.github.com/users/sheabunge/orgs","repos_url":"https://api.github.com/users/sheabunge/repos","events_url":"https://api.github.com/users/sheabunge/events{/privacy}","received_events_url":"https://api.github.com/users/sheabunge/received_events","type":"User","site_admin":false},"created_at":"2015-05-24T11:34:22Z","updated_at":"2015-05-24T11:34:22Z","body":"Thanks! Keep these new filter suggestions coming. :+1: "}}