WordPress/wp-admin
Scott Taylor 4694c477d3 Custom Post Types:
* Introduce `is_post_type_viewable( $post_type_object )`
* Separate the HTML bits from the translatable bits in the `post` messages array in `edit-form-advanced.php`
* Don't show certain UI pieces when a post is not viewable on the front end

When a custom post type item is not viewable on the front end, we don't want to show links to View it (on the front end) all over the admin. We also want to hide the Preview link, et al. We also want our admin messages to not contain said links.

Custom post types with `public_queryable` set to `false` are not viewable on the front end. 
`'page'` is viewable on the front end, but `'page'` is a `_builtin` type, and `public_queryable` is set to `false` when it is registered - see `WP::parse_request()` for when `public_queryable` gets used.

This is confusing, but also somewhat straightforward: to determine if a post type is viewable on the front end, we can check one way for `_builtin => true` and another way for `_builtin => false`:

`$post_type->publicly_queryable || ( $post_type->_builtin && $post_type->public )`

If a post type is `publicly_queryable`, it's viewable. If that value is `false`, it is viewable if it's a `_builtin` type that is also `public`.

I am in search of edge cases, so this shall land.

Props wonderboymusic, DrewAPicture.
See #17609.

Built from https://develop.svn.wordpress.org/trunk@33666


git-svn-id: http://core.svn.wordpress.org/trunk@33633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-20 19:40:25 +00:00
..
css Themes: Prevent short descriptions from wrapping version info. 2015-08-19 19:10:24 +00:00
images Squish that .png a bit more. See [32994]. 2015-06-30 22:04:25 +00:00
includes Custom Post Types: 2015-08-20 19:40:25 +00:00
js After [33662], remove unused var. 2015-08-20 17:19:25 +00:00
maint Improve the tone of key/salts recommendation message. 2015-07-01 15:39:26 +00:00
network Replace some hyphens with —s in admin help tabs. 2015-08-19 04:53:25 +00:00
user
about.php About: Use actual locale and not subtitle debug cruft. 2015-08-18 17:07:26 +00:00
admin-ajax.php Pinking shears. 2015-08-17 21:39:25 +00:00
admin-footer.php
admin-functions.php
admin-header.php
admin-post.php
admin.php
async-upload.php Correct punctuation/case for inline comment in async-upload.php 2015-08-18 23:35:25 +00:00
comment.php Comment string tweaks: 2015-07-26 23:36:24 +00:00
credits.php About: Third pass at 4.3 about page: 2015-08-13 22:11:35 +00:00
custom-background.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
custom-header.php Site Icon: Improve a11y in Settings. 2015-07-12 19:43:24 +00:00
customize.php Customizer: Remove obsolete .control-panel-back and .customize-overlay-close buttons. 2015-08-09 19:00:24 +00:00
edit-comments.php Comments: Update help text for new comment bubbles. 2015-08-06 08:03:26 +00:00
edit-form-advanced.php Custom Post Types: 2015-08-20 19:40:25 +00:00
edit-form-comment.php Pinking shears. 2015-08-17 21:39:25 +00:00
edit-link-form.php Use a less element-specific class name for links within page titles. 2015-07-03 16:42:24 +00:00
edit-tag-form.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
edit-tags.php Replace some hyphens with —s in admin help tabs. 2015-08-19 04:53:25 +00:00
edit.php Use a less element-specific class name for links within page titles. 2015-07-03 16:42:24 +00:00
export.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
freedoms.php About: Third pass at 4.3 about page: 2015-08-13 22:11:35 +00:00
import.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
index.php Replace some hyphens with —s in admin help tabs. 2015-08-19 04:53:25 +00:00
install-helper.php
install.php Persist (and mask) the password on the install screen if the install does not proceed due to errors. 2015-07-29 19:22:26 +00:00
link-add.php
link-manager.php Use a less element-specific class name for links within page titles. 2015-07-03 16:42:24 +00:00
link-parse-opml.php
link.php
load-scripts.php
load-styles.php
media-new.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
media-upload.php
media.php Use a less element-specific class name for links within page titles. 2015-07-03 16:42:24 +00:00
menu-header.php
menu.php
moderation.php
ms-admin.php
ms-delete-site.php Trim trailing space from string in site delete confirmation 2015-07-01 16:31:25 +00:00
ms-edit.php
ms-options.php
ms-sites.php
ms-themes.php
ms-upgrade-network.php
ms-users.php
my-sites.php Merge two similar strings about insufficient permissions. 2015-07-27 13:25:25 +00:00
nav-menus.php When splitting a shared 'nav_menu' term, ensure that nav items and theme locations are retained. 2015-08-12 14:07:26 +00:00
network.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
options-discussion.php Use default parameter when getting the default avatar type. 2015-07-14 15:39:25 +00:00
options-general.php Site Icon: Add crop preview to the media modal. 2015-07-20 15:57:25 +00:00
options-head.php
options-media.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
options-permalink.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
options-reading.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
options-writing.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
options.php Site icon: Remove option name from $whitelist_options for the general options screen. 2015-07-01 21:41:26 +00:00
plugin-editor.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
plugin-install.php Use a less element-specific class name for links within page titles. 2015-07-03 16:42:24 +00:00
plugins.php Don't capitalize words in a sentence after comma. 2015-07-04 00:50:25 +00:00
post-new.php
post.php Heartbeat: Ensure post locks are released. 2015-08-04 04:54:34 +00:00
press-this.php
profile.php
revision.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
setup-config.php
theme-editor.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
theme-install.php Customizer: Use a <button> for the collapse sidebar … button. 2015-07-10 21:22:26 +00:00
themes.php Themes: Remove legacy theme preview. 2015-07-29 18:36:26 +00:00
tools.php Proper heading for admin screens. 2015-06-27 15:41:25 +00:00
update-core.php Updates: Select All should not be a column header. 2015-07-08 20:38:25 +00:00
update.php
upgrade-functions.php
upgrade.php
upload.php Merge some similar media-related strings. 2015-07-26 23:24:24 +00:00
user-edit.php Passwords UI: clean up the new JS in wp-admin/js/user-profile.js. 2015-07-27 21:25:25 +00:00
user-new.php Passwords UI: clean up the new JS in wp-admin/js/user-profile.js. 2015-07-27 21:25:25 +00:00
users.php Multisite: Introduce a singular string for user removal (we already have one for deletion). 2015-07-26 23:19:24 +00:00
widgets.php Use a less element-specific class name for links within page titles. 2015-07-03 16:42:24 +00:00