{"action":"created","issue":{"url":"https://api.github.com/repos/justintadlock/content-type-standards/issues/24","labels_url":"https://api.github.com/repos/justintadlock/content-type-standards/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/justintadlock/content-type-standards/issues/24/comments","events_url":"https://api.github.com/repos/justintadlock/content-type-standards/issues/24/events","html_url":"https://github.com/justintadlock/content-type-standards/issues/24","id":50412643,"number":24,"title":"register_meta usage","user":{"login":"franz-josef-kaiser","id":387666,"avatar_url":"https://avatars.githubusercontent.com/u/387666?v=3","gravatar_id":"","url":"https://api.github.com/users/franz-josef-kaiser","html_url":"https://github.com/franz-josef-kaiser","followers_url":"https://api.github.com/users/franz-josef-kaiser/followers","following_url":"https://api.github.com/users/franz-josef-kaiser/following{/other_user}","gists_url":"https://api.github.com/users/franz-josef-kaiser/gists{/gist_id}","starred_url":"https://api.github.com/users/franz-josef-kaiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franz-josef-kaiser/subscriptions","organizations_url":"https://api.github.com/users/franz-josef-kaiser/orgs","repos_url":"https://api.github.com/users/franz-josef-kaiser/repos","events_url":"https://api.github.com/users/franz-josef-kaiser/events{/privacy}","received_events_url":"https://api.github.com/users/franz-josef-kaiser/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-11-29T02:27:41Z","updated_at":"2015-05-29T13:25:59Z","closed_at":"2015-05-13T19:08:16Z","body":"I know that this has been discussed in #5 already, but I think the assumptions made are kinda off from a UX perspective.\r\n\r\nAfter reviewing the issue with a friend, I see the following two use cases for the function:\r\n\r\n * Turn off visibility in the admin UI in the _Custom Fields_ MetaBox\r\n * Restrict access to MetaData handling based on capability\r\n\r\nThe first thing is that using `__return_false` will restrict the Custom Fields visibility for everyone - when you _do not_ use an underscore/`_` prefix. That's ok as you are probably already handling all the things like capability checks, nonces, etc. and building a custom MetaBox with a sophisticated UI yourself. This helps _not_ confusing the user by having two meta boxes where s/he can add/update the same data. But when your plugin gets uninstalled or deactivated this will be reversed and access to altering the data would be possible again via the _Custom Fields_ MetaBox. \r\n\r\n> I suggest to add a note that the `auth_callback` should be set to `__return_false` when there's a MetaBox added. I also suggest to _drop_ the underscore to make it \"invisible\". This will in all cases leave the user with no access to his own data - unless s/he can handle Adminer or phpMyAdmin or the CLI and  `mysql` command.\r\n\r\nWhen there's _no_ MetaBox added, but you want to restrict access to the field, then the `auth_callback` is nice to have as well. Just [look at the source of `register_meta()`](https://github.com/WordPress/WordPress/blob/f6fd6e09b19d01c6342f0df39ff4fa35983bed8e/wp-includes/meta.php#L1610-L1611) and then at [`~/wp-includes/capabilities.php`](https://github.com/WordPress/WordPress/blob/f6fd6e09b19d01c6342f0df39ff4fa35983bed8e/wp-includes/capabilities.php#L1203-L1221) to see that there's more to it than adding/removing meta data access from a core UI. It's actually offering access to alter the needed capabilities on the fly. This allows very fine grained access to meta data. May it be access for (example) authors with a completed user profile and no access for those who haven't completed it, to stuff depending on post type or another meta key, user votes, some kind of points, etc. This part imo is missing from the documentation."},"comment":{"url":"https://api.github.com/repos/justintadlock/content-type-standards/issues/comments/106801815","html_url":"https://github.com/justintadlock/content-type-standards/issues/24#issuecomment-106801815","issue_url":"https://api.github.com/repos/justintadlock/content-type-standards/issues/24","id":106801815,"user":{"login":"jjeaton","id":835509,"avatar_url":"https://avatars.githubusercontent.com/u/835509?v=3","gravatar_id":"","url":"https://api.github.com/users/jjeaton","html_url":"https://github.com/jjeaton","followers_url":"https://api.github.com/users/jjeaton/followers","following_url":"https://api.github.com/users/jjeaton/following{/other_user}","gists_url":"https://api.github.com/users/jjeaton/gists{/gist_id}","starred_url":"https://api.github.com/users/jjeaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjeaton/subscriptions","organizations_url":"https://api.github.com/users/jjeaton/orgs","repos_url":"https://api.github.com/users/jjeaton/repos","events_url":"https://api.github.com/users/jjeaton/events{/privacy}","received_events_url":"https://api.github.com/users/jjeaton/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T13:25:59Z","updated_at":"2015-05-29T13:25:59Z","body":"The README needs to be updated for this change as well (still recommends `_` prefix for post metadata)"}}