WordPress/wp-admin/includes
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
..
admin-filters.php Move media hooks out of admin-filters.php as sometimes editors are used on the front end. 2015-08-06 20:40:26 +00:00
admin.php Use existing nomenclature pattern for Site Icon class. 2015-06-30 14:37:27 +00:00
ajax-actions.php Comment List Tables: 2015-08-20 16:36:25 +00:00
bookmark.php Add missing doc blocks to wp-admin/includes/*. 2015-05-29 20:17:26 +00:00
class-ftp-pure.php Deprecate php4 style constructors 2015-06-28 15:27:24 +00:00
class-ftp-sockets.php Deprecate php4 style constructors 2015-06-28 15:27:24 +00:00
class-ftp.php Deprecate php4 style constructors 2015-06-28 15:27:24 +00:00
class-pclzip.php Deprecate php4 style constructors 2015-06-28 15:27:24 +00:00
class-wp-comments-list-table.php Comment List Tables: 2015-08-20 16:36:25 +00:00
class-wp-filesystem-base.php In WP_Filesystem_Base::chdir|chgrp|chmod() (all mock abstract methods), modify @return to include string so that subclass @returns match. 2015-06-27 00:43:24 +00:00
class-wp-filesystem-direct.php
class-wp-filesystem-ftpext.php Upgrades: When upgrading via FTP, use LIST -a to detect if a file exists. 2015-08-19 12:38:25 +00:00
class-wp-filesystem-ftpsockets.php Upgrades: When upgrading via FTP, use LIST -a to detect if a file exists. 2015-08-19 12:38:25 +00:00
class-wp-filesystem-ssh2.php SSH2 Upgrade transport: Use ssh2_sftp_realpath() instead of shell commands to determine the current directory on the remote server. This should allow it to be used on chrooted SSH sessions. 2015-06-12 06:31:28 +00:00
class-wp-importer.php Remove unnecessary feedback message from WP_Importer::is_user_over_quota(). 2015-06-30 20:32:25 +00:00
class-wp-links-list-table.php List Tables: 2015-07-14 17:47:24 +00:00
class-wp-list-table.php Comment List Tables: 2015-08-20 16:36:25 +00:00
class-wp-media-list-table.php The 'restrict_manage_posts' hook currently fires on the Post and Media list tables, but is passed zero arguments. Pass $post_type. 2015-08-19 06:23:25 +00:00
class-wp-ms-sites-list-table.php List Tables: 2015-07-14 17:47:24 +00:00
class-wp-ms-themes-list-table.php Add missing summaries to new methods added to WP_MS_Themes_List_Table in 4.3. 2015-07-13 16:13:26 +00:00
class-wp-ms-users-list-table.php List Tables: 2015-07-14 17:47:24 +00:00
class-wp-plugin-install-list-table.php Add @access annotations to methods that have no doc block in wp-admin/includes/*. 2015-05-29 21:32:24 +00:00
class-wp-plugins-list-table.php Fix the DocBlock summary for WP_Plugins_List_Table->get_primary_column_name(), added in 4.3. 2015-07-13 17:46:26 +00:00
class-wp-posts-list-table.php Custom Post Types: 2015-08-20 19:40:25 +00:00
class-wp-press-this.php Press This: properly add Open Sans to the editor, using the mce_css filter. 2015-07-29 19:38:25 +00:00
class-wp-site-icon.php Site Icon: Minor cleanup for WP_Site_Icon after [33329]. 2015-07-27 16:09:25 +00:00
class-wp-terms-list-table.php List Tables: 2015-07-14 17:47:24 +00:00
class-wp-theme-install-list-table.php Customizer: Use a <button> for the collapse sidebar … button. 2015-07-10 21:22:26 +00:00
class-wp-themes-list-table.php Themes: Remove legacy theme preview. 2015-07-29 18:36:26 +00:00
class-wp-upgrader-skins.php Fix PHP notice after [33492] when updating themes. 2015-08-19 10:35:25 +00:00
class-wp-upgrader.php Upgrade: Lowercase the "s" in remove_all_filters(). 2015-07-29 14:57:25 +00:00
class-wp-users-list-table.php Fix the summary for the WP_Users_List_Table->get_default_primary_column_name() method added in 4.3. 2015-07-13 19:48:25 +00:00
comment.php Add doc blocks to functions that are missing them. 2015-05-31 03:18:25 +00:00
continents-cities.php
dashboard.php Capabilities: When creating an auto-draft, ensure that the current user still has permission to do so. 2015-07-22 04:02:25 +00:00
deprecated.php Deprecate php4 style constructors 2015-06-28 15:27:24 +00:00
export.php For doc block types, favor bool over the few remaining booleans 2015-06-27 01:03:25 +00:00
file.php For doc block types, favor bool over the few remaining booleans 2015-06-27 01:03:25 +00:00
image-edit.php For doc block types, favor bool over the few remaining booleans 2015-06-27 01:03:25 +00:00
image.php Add @global annotations for wp-admin/*. 2015-05-28 21:41:30 +00:00
import.php Add (more) missing doc blocks to wp-admin/includes/*. 2015-05-29 21:17:27 +00:00
list-table.php Add @access annotations to methods that have no doc block in wp-admin/includes/*. 2015-05-29 21:32:24 +00:00
media.php Editor: Add Media should be a button 2015-07-16 19:38:23 +00:00
menu.php Don't loosely compare functions that return bool against a literal bool. 2015-06-12 17:19:27 +00:00
meta-boxes.php Custom Post Types: 2015-08-20 19:40:25 +00:00
misc.php Fix updating of nonces on the Edit Post screen after the log in expires and the user logs in again. 2015-07-28 22:07:25 +00:00
ms-admin-filters.php Cleanup (ms-)?admin-filters.php 2015-06-19 21:18:25 +00:00
ms-deprecated.php Add doc blocks to functions that are missing them. 2015-05-31 03:18:25 +00:00
ms.php Multisite mails: Initialize $current_user before accessing $current_user->user_login. 2015-08-04 11:39:25 +00:00
nav-menu.php Add a description for the dynamic portion of the nav_menu_items_{$post_type_name}_recent filter added in 4.3. 2015-07-13 19:51:24 +00:00
plugin-install.php In install_dashboard() (plugin-install, FWIW), make sure slug is populated and degrease the unfortunate whitespace that was present. 2015-07-07 19:19:24 +00:00
plugin.php ob_get_contents() followed by ob_end_clean() can be replaced by ob_get_clean(). 2015-06-27 01:12:24 +00:00
post.php Heartbeat: Ensure post locks are released. 2015-08-04 04:54:34 +00:00
revision.php
schema.php Don't run term-splitting routine on new installations. 2015-08-17 14:29:25 +00:00
screen.php Semanticize Help and Screen Options toggle. 2015-06-18 16:36:25 +00:00
taxonomy.php Correct a parameter name in the docs for wp_insert_category(). 2015-07-13 12:59:25 +00:00
template.php Remove all existing internal feature pointers. 2015-08-07 00:59:24 +00:00
theme-install.php Add doc blocks to functions that are missing them. 2015-05-31 03:18:25 +00:00
theme.php Themes: Remove legacy theme preview. 2015-07-29 18:36:26 +00:00
translation-install.php Add @global annotations to (the rest of the?) wp-admin/* files. 2015-05-29 02:06:31 +00:00
update-core.php Upgrade: Update $_old_files for 4.3. 2015-08-17 20:24:26 +00:00
update.php Assign proper active class when showing plugin updates in network admin 2015-07-07 00:02:24 +00:00
upgrade.php Term Splitting: Fix a reversal of parameters to wp_schedule_single_event() introduced in [33621]. 2015-08-19 11:31:26 +00:00
user.php Passwords: Restore second parameter for wp_new_user_notification(). 2015-08-17 14:25:27 +00:00
widgets.php Add missing doc blocks to wp-admin/includes/*. 2015-05-29 20:17:26 +00:00