Sergey Biryukov
f5aab6e25d
Docs: Correct $post
parameter name and description for wp_attachment_is()
and wp_attachment_is_image()
.
...
Props flixos90.
Fixes #37377 .
Built from https://develop.svn.wordpress.org/trunk@38068
git-svn-id: http://core.svn.wordpress.org/trunk@38009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-16 13:05:29 +00:00
Drew Jaynes
60de6917fb
Docs: Add and clarify changelog entries for elements that can now accept, use, or return WP_Post_Type
objects.
...
Also adds a missing initial `@since` version for `wp_xmlrpc_server::_prepare_post_type()`.
See [37890]. See #36217 .
Built from https://develop.svn.wordpress.org/trunk@38051
git-svn-id: http://core.svn.wordpress.org/trunk@37992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-13 15:24:28 +00:00
Sergey Biryukov
139387b7e5
Docs: Use 3-digit, x.x.x-style semantic versioning for _doing_it_wrong()
, _deprecated_function()
, _deprecated_argument()
, and _deprecated_file()
throughout core.
...
Props metodiew.
Fixes #36495 .
Built from https://develop.svn.wordpress.org/trunk@37985
git-svn-id: http://core.svn.wordpress.org/trunk@37926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-06 12:40:29 +00:00
Joe McGill
170d22a22c
Post Thumbnails: Add helper functions for attachment captions.
...
This adds three new functions for getting/displaying attachment captions:
* `wp_get_attachment_caption` - Retrieves a caption for a specific attachment.
* `get_the_post_thumbnail_caption()` - Returns the post thumbnail caption.
* `the_post_thumbnail_caption()` - Displays the post thumbnail caption.
These are helpful for displaying a caption associated with an image directly
in a template, rather than using the caption shortcode.
This also introduces two new filters:
* `wp_get_attachment_caption` - Filters the value of `wp_get_attachment_caption()`.
* `the_post_thumbnail_caption` - Filters the display of the post thumbnail caption.
`the_post_thumbnail_caption()` is automatically filtered by `wptexturize()`,
`convert_smilies()`, and `convert_chars()` in `wp-includes/default-filters.php`.
Props flixos90, joemcgill.
Fixes #12235 .
Built from https://develop.svn.wordpress.org/trunk@37915
git-svn-id: http://core.svn.wordpress.org/trunk@37856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-29 17:28:28 +00:00
Dominik Schilling
60dc856d64
Posts: Introduce WP_Post_Type
and use it in register_post_type()
and unregister_post_type()
.
...
This changes the global `$wp_post_types` to an array of `WP_Post_Type` objects. `WP_Post_Type` includes methods to handle post type supports, rewrite rules, meta boxes, hooks, and taxonomies.
Each post type argument becomes a property of `WP_Post_Type`.
Props swissspidy, flixos90.
Fixes #36217 .
Built from https://develop.svn.wordpress.org/trunk@37890
git-svn-id: http://core.svn.wordpress.org/trunk@37831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 16:41:35 +00:00
Drew Jaynes
0ef938e9da
Docs: Improve formatting and syntax of the defaullt label docs in the DocBlock for get_post_type_labels()
.
...
See #32246 .
Built from https://develop.svn.wordpress.org/trunk@37886
git-svn-id: http://core.svn.wordpress.org/trunk@37827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 07:18:27 +00:00
Drew Jaynes
538eb01e6f
Docs: Add a more complete $labels
parameter description to the DocBlock for register_post_type()
.
...
Directly references `get_post_type_labels()` for the full list of supported labels.
See #32246 .
Built from https://develop.svn.wordpress.org/trunk@37885
git-svn-id: http://core.svn.wordpress.org/trunk@37826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 06:42:28 +00:00
Drew Jaynes
112992ba80
Docs: Improve the $post_type
parameter description in the DocBlock for register_post_type()
.
...
See #32246 .
Built from https://develop.svn.wordpress.org/trunk@37884
git-svn-id: http://core.svn.wordpress.org/trunk@37825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 06:37:28 +00:00
Drew Jaynes
d4ae5b76ee
Docs: Add more complete documentation for the $supports
argument in register_post_type()
.
...
See #32246 .
Built from https://develop.svn.wordpress.org/trunk@37883
git-svn-id: http://core.svn.wordpress.org/trunk@37824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 06:32:27 +00:00
Drew Jaynes
9ef5fb0a17
Docs: Improve the usefulness, accuracy, and syntax of the register_post_type()
DocBlock summary and description.
...
See #32246 .
Built from https://develop.svn.wordpress.org/trunk@37882
git-svn-id: http://core.svn.wordpress.org/trunk@37823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 06:27:32 +00:00
Jeremy Felt
6f3f00ea97
Multisite: Change WP_Network
id
property to an integer.
...
For consistency and developer sanity.
Props flixos90.
Fixes #37050 .
Built from https://develop.svn.wordpress.org/trunk@37870
git-svn-id: http://core.svn.wordpress.org/trunk@37811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:26:29 +00:00
Drew Jaynes
1e48cc8a05
Docs: Improve the return description for wp_get_post_categories()
to include more information about possible return values.
...
Props jeherve for the initial patch.
Fixes #37002 .
Built from https://develop.svn.wordpress.org/trunk@37686
git-svn-id: http://core.svn.wordpress.org/trunk@37652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-11 17:08:28 +00:00
Drew Jaynes
9193013158
Docs: Apply inline @see
tags to hooks referenced in DocBlocks in a variety of wp-includes/* files.
...
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.
Fixes #36921 .
Built from https://develop.svn.wordpress.org/trunk@37544
git-svn-id: http://core.svn.wordpress.org/trunk@37512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 19:02:28 +00:00
Drew Jaynes
dcadd35728
Docs: Standardize filter docs in wp-includes/post.php to use third-person singular verbs per the inline documentation standards for PHP.
...
See #36913 .
Built from https://develop.svn.wordpress.org/trunk@37504
git-svn-id: http://core.svn.wordpress.org/trunk@37472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:31:28 +00:00
Drew Jaynes
f52a8cb1fa
Docs: Remove/replace invalid inline @link
tags in DocBlocks in wp-includes/*.
...
Fixes #36910 .
Built from https://develop.svn.wordpress.org/trunk@37487
git-svn-id: http://core.svn.wordpress.org/trunk@37455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 17:39:28 +00:00
Boone Gorges
4428a031a3
In get_page_by_path()
, values fetched from cache should obey $output
param.
...
Introduced in [37479].
Props spacedmonkey.
Fixes #36711 .
Built from https://develop.svn.wordpress.org/trunk@37481
git-svn-id: http://core.svn.wordpress.org/trunk@37449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 16:19:29 +00:00
Boone Gorges
98050e404d
Cache queries in get_page_by_path()
.
...
Props spacedmonkey.
Fixes #36711 .
Built from https://develop.svn.wordpress.org/trunk@37479
git-svn-id: http://core.svn.wordpress.org/trunk@37447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-21 17:27:29 +00:00
Sergey Biryukov
ff37a3b730
Docs: Fix typo in a comment in check_and_publish_future_post()
.
...
See #32246 .
Built from https://develop.svn.wordpress.org/trunk@37403
git-svn-id: http://core.svn.wordpress.org/trunk@37369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-08 12:46:29 +00:00
Eric Lewis
aba14233d9
Posts: Allow get_page_uri()
to be called without a $page argument.
...
`get_page_uri()` can now be called without an argument, which will return the page URI for the current post in the loop.
Props pollett.
Fixes #26284 .
Built from https://develop.svn.wordpress.org/trunk@37345
git-svn-id: http://core.svn.wordpress.org/trunk@37311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 18:29:29 +00:00
Drew Jaynes
fe3b007fdd
Docs: Remove inline @see
tags from function, class, and method references in inline docs.
...
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.
Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.
See #32246 .
Built from https://develop.svn.wordpress.org/trunk@37342
git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Sergey Biryukov
49a47bb255
Docs: Document the @return
value of wp_add_trashed_suffix_to_post_name_for_post()
.
...
Props Shelob9.
Fixes #36728 .
Built from https://develop.svn.wordpress.org/trunk@37334
git-svn-id: http://core.svn.wordpress.org/trunk@37300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-01 10:16:29 +00:00
Boone Gorges
742e0005c6
Add parameter documentation for 'post_category' to wp_insert_post()
.
...
Props Latz.
Fixes #36601 .
Built from https://develop.svn.wordpress.org/trunk@37255
git-svn-id: http://core.svn.wordpress.org/trunk@37221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-20 13:54:30 +00:00
Boone Gorges
374a489166
In sanitize_post_field()
, only run 'attribute' or 'js' escaping when necessary.
...
Props tfrommen.
Fixes #34900 .
Built from https://develop.svn.wordpress.org/trunk@37220
git-svn-id: http://core.svn.wordpress.org/trunk@37186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-16 14:51:28 +00:00
Boone Gorges
cfab9716e3
Use __trashed
suffix rather than -%trashed%
for trashed post slugs.
...
Percent signs are reserved characters in URIs. As such, it was impossible for
plugins to route requests to trashed posts, as happens in bbPress. The new
`__trashed` suffix should be sufficiently unique.
Also adds a test that demonstrates that the `__trashed` suffix can be
appended to slugs that contain the suffix somewhere other than the end of
the string.
Props netweb, ericlewis.
Fixes #11863 .
Built from https://develop.svn.wordpress.org/trunk@37165
git-svn-id: http://core.svn.wordpress.org/trunk@37132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-07 19:22:28 +00:00
Drew Jaynes
f9919442e2
Docs: Improve the DocBlock summary for wp_queue_posts_for_term_meta_lazyload()
, introduced in [36566].
...
See #35816 . See #35986 .
Built from https://develop.svn.wordpress.org/trunk@36945
git-svn-id: http://core.svn.wordpress.org/trunk@36913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-10 18:29:26 +00:00
Drew Jaynes
49803ffabe
Docs: Improve the accuracy of the return description for unregister_post_type()
, introduced in [36316].
...
See #14761 . See #35986 .
Built from https://develop.svn.wordpress.org/trunk@36944
git-svn-id: http://core.svn.wordpress.org/trunk@36912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-10 18:25:25 +00:00
Boone Gorges
e032560e6b
Correct @return
annotation for wp_set_object_terms()
and related functions.
...
The return value is an array of term taxonomy IDs, not term IDs.
Fixes #36182 .
Built from https://develop.svn.wordpress.org/trunk@36896
git-svn-id: http://core.svn.wordpress.org/trunk@36864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-09 16:17:28 +00:00
Drew Jaynes
2846e3aaef
Docs: Use the correct variable name for the $post_ID
parameter in the DocBlock for wp_add_trashed_suffix_to_post_name_for_trashed_posts()
.
...
See #11863 . See #32246 .
Built from https://develop.svn.wordpress.org/trunk@36727
git-svn-id: http://core.svn.wordpress.org/trunk@36694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-26 09:25:26 +00:00
Drew Jaynes
1b9a705394
Docs: Standardize summaries for two new internal functions used to handle suffixing trashed posts.
...
Also adds a notation of private access to each.
See #11863 . See #32246 .
Built from https://develop.svn.wordpress.org/trunk@36726
git-svn-id: http://core.svn.wordpress.org/trunk@36693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-26 09:23:25 +00:00
Dominik Schilling
e5ea82d81a
Spelling: Standardize on "front end"/"back end" (noun) and "front-end"/"back-end" (adjective).
...
Props obrienlabs, thewanderingbrit.
Fixes #34887 .
Built from https://develop.svn.wordpress.org/trunk@36709
git-svn-id: http://core.svn.wordpress.org/trunk@36676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-25 12:53:27 +00:00
Drew Jaynes
4c3c2b315f
Posts: Rename the $args
parameter in get_post_types_by_support()
to $feature
for better self-documentation.
...
See #34010 . See #32246 .
Built from https://develop.svn.wordpress.org/trunk@36704
git-svn-id: http://core.svn.wordpress.org/trunk@36671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-25 04:55:25 +00:00
Pascal Birchler
8725644d40
Posts: Introduce get_post_types_by_support()
.
...
Similar to `get_post_types()`, this new function returns a list of post type names that support a specific feature.
Props wpsmith, barryceelen, swissspidy.
Fixes #34010 .
Built from https://develop.svn.wordpress.org/trunk@36652
git-svn-id: http://core.svn.wordpress.org/trunk@36619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-23 22:50:26 +00:00
Eric Lewis
04da8bb63a
Posts: Non-trashed posts should take slug priority over trashed posts.
...
When determining a unique post slug, trashed posts are taken into account. Previously, new posts would add suffixes to their slugs (e.g. `about-2`) when a post in the trash had the desired slug (e.g. `about`).
To avoid this behavior, when a post is trashed its slug (i.e. `post_name`) is now suffixed with `-%trashed%`. The post's pre-trash slug is stored as post meta, and if the post is restored from trash, its desired slug is reapplied.
For existing trashed posts which don't have the `-%trashed%` suffix, the suffix is added when a post with its desired slug is created.
Props ocean90, boonebgorges, ryan, SergeyBiryukov, coffee2code, helen, williamsba1.
See #11863 .
Built from https://develop.svn.wordpress.org/trunk@36607
git-svn-id: http://core.svn.wordpress.org/trunk@36574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-21 21:45:28 +00:00
Andrew Ozz
2d94e025a2
Replace wp_upload_dir()
with the new wp_get_upload_dir()
in all cases where a file is not being uploaded. Deprecate _wp_upload_dir_baseurl()
, and replace it with wp_get_upload_dir()
.
...
See #34359 .
Built from https://develop.svn.wordpress.org/trunk@36569
git-svn-id: http://core.svn.wordpress.org/trunk@36536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-18 00:24:27 +00:00
Boone Gorges
571e14f897
More performance improvements to metadata lazyloading.
...
Comment and term meta lazyloading for `WP_Query` loops, introduced in 4.4,
depended on filter callback methods belonging to `WP_Query` objects. This meant
storing `WP_Query` objects in the `$wp_filter` global (via `add_filter()`),
requiring that PHP retain the objects in memory, even when the local variables
would typically be expunged during normal garbage collection. In cases where a
large number of `WP_Query` objects were instantiated on a single pageload,
and/or where the contents of the `WP_Query` objects were quite large, serious
performance issues could result.
We skirt this problem by moving metadata lazyloading out of `WP_Query`. The
new `WP_Metadata_Lazyloader` class acts as a lazyload queue. Query instances
register items whose metadata should be lazyloaded - such as post terms, or
comments - and a `WP_Metadata_Lazyloader` method will intercept comment and
term meta requests to perform the cache priming. Since `WP_Metadata_Lazyloader`
instances are far smaller than `WP_Query` (containing only object IDs), and
clean up after themselves far better than the previous `WP_Query` methods (bp
only running their callbacks a single time for a given set of queued objects),
the resource use is decreased dramatically.
See [36525] for an earlier step in this direction.
Props lpawlik, stevegrunwell, boonebgorges.
Fixes #35816 .
Built from https://develop.svn.wordpress.org/trunk@36566
git-svn-id: http://core.svn.wordpress.org/trunk@36533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-17 22:58:26 +00:00
Drew Jaynes
c55f447ad4
Docs: Revert unintended changes in wp-includes/post.php, mistakenly included in [36497].
...
See #34988 . See #33701 .
Built from https://develop.svn.wordpress.org/trunk@36498
git-svn-id: http://core.svn.wordpress.org/trunk@36465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-07 02:46:25 +00:00
Drew Jaynes
3785385ea2
Docs: Add a missing version to the file header for wp-admin/term.php, introduced in [36308].
...
See #34988 . See #33701 .
Built from https://develop.svn.wordpress.org/trunk@36497
git-svn-id: http://core.svn.wordpress.org/trunk@36464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-07 02:43:26 +00:00
Boone Gorges
8db393ada6
Make the $post
param optional in get_post_field()
.
...
When `$post` is `null`, the current post object will be returned.
Props sebastian.pisula.
Fixes #35683 .
Built from https://develop.svn.wordpress.org/trunk@36481
git-svn-id: http://core.svn.wordpress.org/trunk@36448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-05 18:58:25 +00:00
Boone Gorges
de9d742b9a
Allow is_post_type_viewable()
to accept a post type name.
...
Previously, it accepted only a post type object.
Props spacedmonkey.
Fixes #35609 .
Built from https://develop.svn.wordpress.org/trunk@36402
git-svn-id: http://core.svn.wordpress.org/trunk@36369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-26 02:37:26 +00:00
Pascal Birchler
68f12521c8
Post Types: Introduce unregister_post_type()
.
...
This new function can be used to completely unregister non built-in post types.
Fixes #14761 .
Built from https://develop.svn.wordpress.org/trunk@36316
git-svn-id: http://core.svn.wordpress.org/trunk@36283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-15 12:20:27 +00:00
Pascal Birchler
b0b13aff2f
Embeds: Allow embedding static front pages and pages having a child page with an embed
slug.
...
This makes `embed` a special slug that can't be used for new pages/posts. When `https://example.com/foo/embed/ ` is an existing page, embeds fall back to `https://example.com/foo/?embed=true `.
Adds unit tests.
Fixes #34971 .
Built from https://develop.svn.wordpress.org/trunk@36307
git-svn-id: http://core.svn.wordpress.org/trunk@36274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-15 07:56:26 +00:00
Pascal Birchler
d0c1f44d21
Docs: Revert [36268] as the global is indeed used, just via the superglobal.
...
Fixes #35413 .
Built from https://develop.svn.wordpress.org/trunk@36269
git-svn-id: http://core.svn.wordpress.org/trunk@36236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-12 12:26:27 +00:00
Pascal Birchler
14f073a154
Docs: Fix incorrect DocBlock for wp_get_attachment_url()
.
...
The documented `$pagenow` global isn't used in the function.
Props sebastian.pisula.
Fixes #35413 .
Built from https://develop.svn.wordpress.org/trunk@36268
git-svn-id: http://core.svn.wordpress.org/trunk@36235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-12 12:08:26 +00:00
Pascal Birchler
73317a33b6
Permalinks: Ensure the page hierarchy is correct for sample permalinks.
...
Fixes #35368 .
Built from https://develop.svn.wordpress.org/trunk@36253
git-svn-id: http://core.svn.wordpress.org/trunk@36220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-10 18:28:28 +00:00
Sergey Biryukov
267c524a07
Docs: Correct get_page_uri()
description.
...
Props ericlewis.
Fixes #35165 .
Built from https://develop.svn.wordpress.org/trunk@36143
git-svn-id: http://core.svn.wordpress.org/trunk@36109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-01 18:29:27 +00:00
Andrew Ozz
597bbf0318
Responsive images: add compatibility for versions < 2.7 when the full image path was stored in the metadata. Introduces _wp_get_attachment_relative_path()
and uses it in wp_get_attachment_url()
.
...
Props dd32, SergeyBiryukov.
Fixes #35106 for trunk.
Built from https://develop.svn.wordpress.org/trunk@36120
git-svn-id: http://core.svn.wordpress.org/trunk@36086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-30 00:06:28 +00:00
Dion Hulse
d5d401ad10
Pages: get_page_uri()
should return the URI at which the resource being accessed is available at, this may include non-'publish' status posts.
...
Reverts [34001] and fixes the original issue in #15963 - avoiding a PHP Notice for when the post doesn't exist.
Props tharsheblows.
See #15963 .
Fixes #35084 .
Built from https://develop.svn.wordpress.org/trunk@36094
git-svn-id: http://core.svn.wordpress.org/trunk@36059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-26 03:46:28 +00:00
Sergey Biryukov
7d9d7f2df4
Docs: Clarify that get_post_types()
accepts 'not'
as its $operator
parameter.
...
Props barryceelen.
Fixes #35225 .
Built from https://develop.svn.wordpress.org/trunk@36091
git-svn-id: http://core.svn.wordpress.org/trunk@36056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-26 00:38:25 +00:00
John Blackbourn
1402c3d8b4
Docs: Miscellaneous docblock corrections.
...
See #32246
Built from https://develop.svn.wordpress.org/trunk@36069
git-svn-id: http://core.svn.wordpress.org/trunk@36034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-23 06:31:27 +00:00
Sergey Biryukov
d5d5d64e3d
I18N: Use better context for post statuses.
...
See #35054 .
Built from https://develop.svn.wordpress.org/trunk@35903
git-svn-id: http://core.svn.wordpress.org/trunk@35867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-13 19:18:26 +00:00
Drew Jaynes
2cad8ec9e3
Docs: Remove indentation from a wrapped line in the DocBlock description for get_post_type_labels()
to prevent incorrect formatting when parsed.
...
With the false indentation in place, the parser for the Code Reference incorrectly interprets it as a block quote.
Fixes #35019 .
Built from https://develop.svn.wordpress.org/trunk@35868
git-svn-id: http://core.svn.wordpress.org/trunk@35832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-11 18:42:27 +00:00
Eric Lewis
6be07725fb
Add inline documentation for get_page_by_path()
.
...
Fixes #34964 .
Built from https://develop.svn.wordpress.org/trunk@35861
git-svn-id: http://core.svn.wordpress.org/trunk@35825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-11 03:50:26 +00:00
Joe Hoyle
5031ca5c23
Prevent unnecessary $wpdb->update() when hierarchical post doesn't have children.
...
Props danielbachhuber.
Fixes #34896 .
Built from https://develop.svn.wordpress.org/trunk@35817
git-svn-id: http://core.svn.wordpress.org/trunk@35781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-07 17:47:25 +00:00
Eric Lewis
0e8e5124c1
Posts: Don't modify post_name if it wasn't supplied to wp_insert_post()
.
...
Previously when updating a post using wp_insert_post(), post_name was
regenerated based on post_title every time if post_name was not passed in
explicitly. This irons out the expectation that properties not passed into the
function should not be modified.
Props jason_the_adams.
Fixes #34865 .
Built from https://develop.svn.wordpress.org/trunk@35800
git-svn-id: http://core.svn.wordpress.org/trunk@35764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 21:58:25 +00:00
Sergey Biryukov
bc1e479fd0
After [35718], update the location of some files in This filter is documented in
docs.
...
Partially reverts [33954].
Fixes #33413 .
Built from https://develop.svn.wordpress.org/trunk@35725
git-svn-id: http://core.svn.wordpress.org/trunk@35689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-22 03:51:28 +00:00
Andrew Nacin
1579e45d41
Simplify the include graph after work to split out classes.
...
see #33413 . More details there.
Built from https://develop.svn.wordpress.org/trunk@35718
git-svn-id: http://core.svn.wordpress.org/trunk@35682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-20 07:24:30 +00:00
Drew Jaynes
6069a4b2f6
Docs: Clarify the file header summary for wp-includes/post.php, the top-level file for the Post API.
...
See #33413 . See #33701 .
Built from https://develop.svn.wordpress.org/trunk@34401
git-svn-id: http://core.svn.wordpress.org/trunk@34365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 13:13:26 +00:00
Scott Taylor
4cec121d0b
Move Walker_Page
and Walker_PageDropdown
into their own files via svn cp
. Remove them from post-template.php
. Load them in post.php
.
...
`post-template.php` loads after `post.php` in `wp-settings.php`. It could probably also be loaded in `post.php`, but avoiding that for the moment.
See #33413 .
Built from https://develop.svn.wordpress.org/trunk@34109
git-svn-id: http://core.svn.wordpress.org/trunk@34077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 02:59:24 +00:00
Scott Taylor
cd99e0cfff
Posts: move WP_Post
into its own file. post.php
loads the new files, so this is 100% BC if someone is loading post.php
directly. New files created using svn cp
.
...
Creates:
`class-wp-post.php`
`post-functions.php`
`post.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.
See #33413 .
Built from https://develop.svn.wordpress.org/trunk@33759
git-svn-id: http://core.svn.wordpress.org/trunk@33727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 12:40:21 +00:00
Scott Taylor
ef87172270
foreach
is a statement, not a function.
...
See #33491 .
Built from https://develop.svn.wordpress.org/trunk@33734
git-svn-id: http://core.svn.wordpress.org/trunk@33702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 20:28:22 +00:00
Scott Taylor
21c61251a2
With a few modifications in wp-admin/menu.php
, we can eliminate the extra logic for Post and Page menu registration. Instead, they can just declare menu_position
on post type registration.
...
Props scribu, wonderboymusic.
Fixes #16865 .
Built from https://develop.svn.wordpress.org/trunk@33723
git-svn-id: http://core.svn.wordpress.org/trunk@33690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-24 21:19:24 +00:00
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
Scott Taylor
0b29061b3d
Fix case type in docs for get_children()
.
...
Props bobbingwide.
Fixes #33364 .
Built from https://develop.svn.wordpress.org/trunk@33637
git-svn-id: http://core.svn.wordpress.org/trunk@33604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-18 21:39:24 +00:00
Boone Gorges
2f514a6115
When generating a fallback post_name
using the post ID, wp_insert_post()
should clear the post cache immediately.
...
If the post cache is not cleared at this point, the cache can become stale
for operations performed before the cache is cleared later in the function.
Specifically, the generation of a `guid` for new posts can use stale data,
resulting in non-unique values. [33262] introduced a call to `get_post()`
that introduced just such an invalidation problem.
Fixes #5305 .
Built from https://develop.svn.wordpress.org/trunk@33630
git-svn-id: http://core.svn.wordpress.org/trunk@33597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-18 02:51:26 +00:00
Dominik Schilling
70128fe760
Comments: IDs are integers.
...
Built from https://develop.svn.wordpress.org/trunk@33555
git-svn-id: http://core.svn.wordpress.org/trunk@33522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-04 04:58:35 +00:00
Drew Jaynes
9cd32c7f6c
Docs: Correct the possible return types and corresponding descriptions for wp_get_post_terms()
.
...
Props adamkheckler for the initial patch.
Fixes #32950 .
Built from https://develop.svn.wordpress.org/trunk@33393
git-svn-id: http://core.svn.wordpress.org/trunk@33361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-23 07:45:25 +00:00
Boone Gorges
0a24f1bebf
Improve function description for wp_transition_post_status()
.
...
The documentation should make it clear that the function does not modify the
post object in the database, but only fires hooks related to the transition.
Props AramZS.
Fixes #33014 .
Built from https://develop.svn.wordpress.org/trunk@33296
git-svn-id: http://core.svn.wordpress.org/trunk@33268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-16 14:35:26 +00:00
Boone Gorges
28ce0320e3
In wp_unique_post_slug()
, only prevent date archive conflicts when the slug is being changed.
...
This prevents existing posts with numeric slugs from having their permalinks
changed on update.
Fixes #5305 .
Built from https://develop.svn.wordpress.org/trunk@33262
git-svn-id: http://core.svn.wordpress.org/trunk@33234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-14 12:28:48 +00:00
Boone Gorges
5a1618b497
When creating a new post with an empty post_name
and post_title
, don't generate a post_name
that conflicts with a date archive permalink.
...
See #5305 .
Built from https://develop.svn.wordpress.org/trunk@33261
git-svn-id: http://core.svn.wordpress.org/trunk@33233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-14 12:28:24 +00:00
Drew Jaynes
9e94263af1
Wrap a long changelog entry description in the DocBlock for get_post_type_labels()
.
...
See [32673]. See #32891 .
Built from https://develop.svn.wordpress.org/trunk@33234
git-svn-id: http://core.svn.wordpress.org/trunk@33206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-13 21:49:25 +00:00
Helen Hou-Sandí
30e478b1fb
Move get_default_comment_status()
to wp-includes/comment.php
to sit alongside get_comment_statuses()
.
...
props nacin.
see #31168 .
Built from https://develop.svn.wordpress.org/trunk@33122
git-svn-id: http://core.svn.wordpress.org/trunk@33093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-08 15:44:28 +00:00
Konstantin Obenland
a4e803fbd4
Use get_default_comment_status()
globally.
...
Also makes the filter name static and passes the post type for context.
Props valendesigns.
Fixes #31168 .
Built from https://develop.svn.wordpress.org/trunk@33054
git-svn-id: http://core.svn.wordpress.org/trunk@33025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-02 22:32:25 +00:00
Konstantin Obenland
edffcb0bcd
Turn of comments for pages by default.
...
Pages are static content, for which comments are not expected out of the box.
Props valendesigns, rachelbaker.
Fixes #31168 .
Built from https://develop.svn.wordpress.org/trunk@33041
git-svn-id: http://core.svn.wordpress.org/trunk@33012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-02 00:22:24 +00:00
Scott Taylor
a28f09a32c
Correct inline doc for $public
in register_post_status()
.
...
Props ericlewis.
Fixes #32061 .
Built from https://develop.svn.wordpress.org/trunk@32881
git-svn-id: http://core.svn.wordpress.org/trunk@32852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-19 22:35:25 +00:00
John Blackbourn
f632756f16
Correct the docs for the post_type_labels_{$post_type}
filter.
...
Fixes #32707
Props dlh
Built from https://develop.svn.wordpress.org/trunk@32849
git-svn-id: http://core.svn.wordpress.org/trunk@32820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-18 21:33:27 +00:00
Scott Taylor
5c6b63d3a6
if
is a statment, not a function.
...
See #32444 .
Built from https://develop.svn.wordpress.org/trunk@32800
git-svn-id: http://core.svn.wordpress.org/trunk@32771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 20:01:25 +00:00
Dominik Schilling
55f3b68c75
Nav Menus: Update wp_setup_nav_menu_item()
to stop overriding empty properties from supplied $menu_item
.
...
Update docs for `WP_Post` constructor to indicate that `WP_Post|object` can be the supplied param, as opposed to just `WP_Post`.
props westonruter.
fixes #32632 .
Built from https://develop.svn.wordpress.org/trunk@32762
git-svn-id: http://core.svn.wordpress.org/trunk@32733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-14 10:53:25 +00:00
Scott Taylor
107d5b088d
page_template
should be annotated as @property
, not @property-read
in WP_Post
. The property is set on an instance in wp_insert_post()
...
Props morganestes.
Fixes #32515 .
Built from https://develop.svn.wordpress.org/trunk@32729
git-svn-id: http://core.svn.wordpress.org/trunk@32700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-12 17:01:24 +00:00
John Blackbourn
02192cb53f
Introduce featured_image
, set_featured_image
, remove_featured_image
, and use_featured_image
post type labels when registering a post type in order to override the 'Featured Image' text and its related phrases.
...
Props johnbillion, mordauk, valendesigns.
Fixes #19257 .
Built from https://develop.svn.wordpress.org/trunk@32673
git-svn-id: http://core.svn.wordpress.org/trunk@32643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-31 16:54:27 +00:00
Boone Gorges
9f0c6cbf8c
Disallow post slugs that will result in permalinks that conflict with date archive URLs.
...
On certain permalink structures, a numeric post slug will result in a post
permalink that conflicts with a date archive URL. For example, with permastruct
`/%year%/%monthnum%/%postname%/`, a post published in May 2015 with slug
`'15'` will result in a URL (`/2015/05/15/`) that conflicts with the archive
for May 15, 2015.
To avoid this problem, `wp_unique_post_slug()` rejects a requested slug when it
would generate a conflict of this type. Thus, in our example, `'15'` would
become `'15-2'`.
Props valendesigns, boonebgorges, Denis-de-Bernardy, loushou.
See #5305 .
Built from https://develop.svn.wordpress.org/trunk@32647
git-svn-id: http://core.svn.wordpress.org/trunk@32617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 12:53:24 +00:00
Scott Taylor
5ee54c05ac
Add missing doc blocks to revision.php
.
...
Clarify `@return` values where necessary.
In `wp_delete_post_revision()`, `wp_delete_post()` doesn't return `WP_Error`, so that check can be removed.
`wp_revisions_to_keep()` always returns an `int`, so `wp_revisions_enabled()` can use strict comparison.
See #32444 .
Built from https://develop.svn.wordpress.org/trunk@32621
git-svn-id: http://core.svn.wordpress.org/trunk@32591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-27 18:38:24 +00:00
Scott Taylor
2ebce023df
Add missing doc blocks to post.php
.
...
Clarify some existing values for `@param` and `@return`.
Some functions do not need to set a variable before immediately returning it.
See #32444 .
Built from https://develop.svn.wordpress.org/trunk@32619
git-svn-id: http://core.svn.wordpress.org/trunk@32589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-27 17:05:26 +00:00
Scott Taylor
af7a017f46
When calling unset()
, it is unnecessary to immediately precede it with a call to isset()
.
...
See #32444 .
Built from https://develop.svn.wordpress.org/trunk@32545
git-svn-id: http://core.svn.wordpress.org/trunk@32515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-22 05:47:25 +00:00
Boone Gorges
9d54232e39
Streamline support for multiple post types in get_posts_by_author_sql()
.
...
* Don't accept a comma-separated list, only a single post type or an array of post types. This is easier to document.
* Add changelog entries to all calling functions.
Props DrewAPicture.
Fixes #32243 .
Built from https://develop.svn.wordpress.org/trunk@32524
git-svn-id: http://core.svn.wordpress.org/trunk@32494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-21 19:49:29 +00:00
Boone Gorges
67c935ad9c
Support multiple post types in count_user_posts()
and other functions that use get_posts_by_author_sql()
.
...
Props nikonratm.
Fixes #32243 .
Built from https://develop.svn.wordpress.org/trunk@32523
git-svn-id: http://core.svn.wordpress.org/trunk@32493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-21 18:43:27 +00:00
Boone Gorges
4cdf05f6bc
Improve performance of get_page_children()
.
...
The new algorithm uses a hash table rather than function recursion, reducing
complexity to O(N). On large numbers of pages, the performance improvement is
several orders of magnitude.
Props santagada, hailin, mihai.
Fixes #10852 .
Built from https://develop.svn.wordpress.org/trunk@32355
git-svn-id: http://core.svn.wordpress.org/trunk@32326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-05 19:37:53 +00:00
Drew Jaynes
cbd07f213d
Add two changelog entries for functional changes introduced in 4.2.0.
...
Props dimadin.
See #31925 .
Built from https://develop.svn.wordpress.org/trunk@32350
git-svn-id: http://core.svn.wordpress.org/trunk@32321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-05 02:16:25 +00:00
Boone Gorges
e59aaa4f67
Attachment URLs should only be forced to SSL on the front end.
...
Detecting SSL status on the Dashboard introduces problems when writing content
that is saved to the database and then displayed on the front end, where SSL
may be optional (or impossible, due to self-signed certificates). The new
approach parallels the logic in `get_home_url()` for forcing HTTPS.
See [31614] #15928 for background.
Fixes #32112 for trunk.
Built from https://develop.svn.wordpress.org/trunk@32342
git-svn-id: http://core.svn.wordpress.org/trunk@32313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-04 13:10:27 +00:00
Dominik Schilling
64fc7294b6
Use HTTPS URLs for codex.wordpress.org.
...
see #27115 .
Built from https://develop.svn.wordpress.org/trunk@32116
git-svn-id: http://core.svn.wordpress.org/trunk@32095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-12 21:29:32 +00:00
Scott Taylor
bce851dcf2
Replace array_shift()
with reset()
where appropriate for performance.
...
Props SergeyBiryukov.
Fixes #31259 .
Built from https://develop.svn.wordpress.org/trunk@31829
git-svn-id: http://core.svn.wordpress.org/trunk@31811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-19 03:56:27 +00:00
Drew Jaynes
f50307c5d8
Clean up some inline documentation for emoji functionality, including a missing @since
for mail_emoji()
, and a changelog entry for wp_insert_post()
.
...
See #31242 .
Built from https://develop.svn.wordpress.org/trunk@31789
git-svn-id: http://core.svn.wordpress.org/trunk@31769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-16 01:43:28 +00:00
Gary Pendergast
46e2a65cf1
Add emoji support, with Twemoji fallback.
...
Replace exisiting smilies with equivalent emoji, or with shiny new smiley images where no emoji existed.
Props batmoo, joen and mkaz for the original plugin upon which this is based.
Props pento, iseulde, kraftbj and peterwilsoncc for making the internet's dreams come true.
See #31242
Built from https://develop.svn.wordpress.org/trunk@31733
git-svn-id: http://core.svn.wordpress.org/trunk@31714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 22:49:28 +00:00
Drew Jaynes
b1a59e9d30
Add a missing @since 4.2.0
tag to the DocBlock for wp_attachment_is()
.
...
See #25275 .
Built from https://develop.svn.wordpress.org/trunk@31660
git-svn-id: http://core.svn.wordpress.org/trunk@31641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-07 07:12:28 +00:00
Drew Jaynes
b84904051b
Better document parameters and the return for the newly-introduced wp_attachment_is()
.
...
Also adds a changelog entry to the DocBlock for `wp_attachment_is_image()` to denote that it serves as a wrapper for `wp_attachment_is()` as of 4.2.0.
See [31645]. See #25275 .
Built from https://develop.svn.wordpress.org/trunk@31659
git-svn-id: http://core.svn.wordpress.org/trunk@31640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-07 07:09:28 +00:00
Boone Gorges
b421255fc8
When passing $full
to get_posts_by_author_sql()
, make sure a 'post_type' clause is included in results.
...
This change makes the 'post_type' clause in `wp_list_authors()` redundant, so
we remove it. Third-party plugins using `get_posts_by_author_sql()` may have
similarly redundant clauses, but this won't change the results returned by the
SQL queries.
Also adds unit tests for `get_posts_by_author_sql()`.
Props pbearne.
Fixes #30354 .
Built from https://develop.svn.wordpress.org/trunk@31653
git-svn-id: http://core.svn.wordpress.org/trunk@31634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-07 01:15:28 +00:00
Scott Taylor
70aec9e406
Add unit tests for wp_attachment_is()
, checks the whitelist and arbitrary extension.
...
See #25275 .
Built from https://develop.svn.wordpress.org/trunk@31647
git-svn-id: http://core.svn.wordpress.org/trunk@31628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-06 20:38:26 +00:00
Scott Taylor
aabe0bcc2c
After [31645], for the default
case
, return the result of checking the extension against the passed type.
...
See #25275 .
Built from https://develop.svn.wordpress.org/trunk@31646
git-svn-id: http://core.svn.wordpress.org/trunk@31627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-06 20:28:26 +00:00
Scott Taylor
8f0b626d13
Introduce a function, wp_attachment_is( $type, $post = 0 )
, to collapse the logic for determining whether an attachment is an image
, audio
, or video
.
...
This is admittedly a first pass. There needs to be a generic handler for when any other type is passed, but for now it accepts the whitelist.
See #25275 .
Built from https://develop.svn.wordpress.org/trunk@31645
git-svn-id: http://core.svn.wordpress.org/trunk@31626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-06 20:26:26 +00:00
Boone Gorges
8c48f9400e
In wp_get_attachment_url()
, convert to HTTPS when possible.
...
`wp_get_attachment_url()`, via `wp_upload_dir()`, uses 'siteurl' to generate
attachment URLs. When a site is SSL-optional on the front end - ie, 'siteurl'
is non-HTTPS, but SSL is available - a number of situations can arise where
non-HTTPS attachment URLs cause browser mixed-content warnings:
a) SSL is forced in the admin and `wp_get_attachment_url()` is used to generate the `<img>` tag for an inserted image. In these cases, the post content will contain non-HTTPS. Viewing/editing this post in the Dashboard will result in non-HTTPS images being served in an SSL environment.
b) `wp_get_attachment_url()` is used in a theme to generate an `<img>` `src` attribute on a public page. When viewing that page over SSL, the images will have HTTP URLs.
This changeset switches attachment URLs to HTTPS when it's determined that the
host supports SSL. This happens when 'siteurl' is non-SSL, but the current page
request *is* over SSL, and the host of the current request matches the host of
the URL being generated.
Props joemcgill, boonebgorges.
Fixes #15928 .
Built from https://develop.svn.wordpress.org/trunk@31614
git-svn-id: http://core.svn.wordpress.org/trunk@31595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-05 02:39:24 +00:00
Scott Taylor
f6b1b01ecd
Make a new function, wp_delete_file()
. Use it.
...
Props scribu, wonderboymusic.
Fixes #17864 .
Built from https://develop.svn.wordpress.org/trunk@31575
git-svn-id: http://core.svn.wordpress.org/trunk@31556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-27 16:51:25 +00:00
Sergey Biryukov
224cb89878
Remove a stray single quote in wp_insert_post()
documentation.
...
see #31359 .
Built from https://develop.svn.wordpress.org/trunk@31496
git-svn-id: http://core.svn.wordpress.org/trunk@31477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-22 09:50:25 +00:00
Drew Jaynes
1ffca1fcb6
Clarify and complete default argument documentation for wp_insert_post()
.
...
Props atimmer, SergeyBiryukov.
Fixes #31359 .
Built from https://develop.svn.wordpress.org/trunk@31486
git-svn-id: http://core.svn.wordpress.org/trunk@31467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-22 00:56:29 +00:00
Drew Jaynes
542a4bd98b
Update the descriptions for transition_post_status()
and the {$new_stats}_{$post->post_type}
hook with more information about the expected behavior of transitioning post statuses.
...
In some cases, the values of `$old_status` and `$new_status` may be the same thing before and after a post status is "transitioned". An example of this would be the scenario where a published post is being updated: the status before and after the update both equal 'publish'.
Further, the documentation clarifies that if the intent is to only execute code when initially transitioningto a post status from something else, the 'transition_post_status' hook should be used instead of one of the dynamic hooks to avoid confusion.
Props Idealien for the initial patch.
Fixes #31099 .
Built from https://develop.svn.wordpress.org/trunk@31461
git-svn-id: http://core.svn.wordpress.org/trunk@31442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-14 09:11:28 +00:00
John Blackbourn
7520057038
Return a WP_Error
if an empty name is provided when registering a post type.
...
Fixes #31134
Props tyxla, MikeHansenMe
Built from https://develop.svn.wordpress.org/trunk@31450
git-svn-id: http://core.svn.wordpress.org/trunk@31431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-13 16:43:26 +00:00
Scott Taylor
fe6b5983df
In PHP 5.0.0, is_a()
became deprecated in favour of the instanceof
operator. Calling is_a()
would result in an E_STRICT
warning.
...
In PHP 5.3.0, `is_a()` is no longer deprecated, and will therefore no longer throw `E_STRICT` warnings.
To avoid warnings in PHP < 5.3.0, convert all `is_a()` calls to `$var instanceof WP_Class` calls.
`instanceof` does not throw any error if the variable being tested is not an object, it simply returns `false`.
Props markoheijnen, wonderboymusic.
Fixes #25672 .
Built from https://develop.svn.wordpress.org/trunk@31188
git-svn-id: http://core.svn.wordpress.org/trunk@31169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:06:24 +00:00
Drew Jaynes
632c26d142
Remove an erroneous @internal
tag from the DocBlock for get_children()
.
...
Use of the `@internal` tag caused the reference article for this function to be skipped during the parsing process.
Fixes #30987 for trunk.
Built from https://develop.svn.wordpress.org/trunk@31169
git-svn-id: http://core.svn.wordpress.org/trunk@31150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-13 00:08:22 +00:00
Scott Taylor
fc843ce4d0
There are some random add_action()
and add_filter()
calls littered around some files in wp-includes/
. These should be moved to wp-includes/default-filters.php
with the rest of the registered hooks. It seems like this was the best practice for awhile and then we randomly stopped. This file loads way before any of the includes, so the hooks will be registered for any request that loads WordPress, even SHORTINIT
- a lot of the hooks registered won't run anyways (that's already the case).
...
See #30947 .
Built from https://develop.svn.wordpress.org/trunk@31168
git-svn-id: http://core.svn.wordpress.org/trunk@31149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-12 16:40:23 +00:00
Scott Taylor
806b2e9bae
get_post()
takes $output
as its 2nd param. The @return
annotation should reflect the function's ability to return an array.
...
See #30799 .
Built from https://develop.svn.wordpress.org/trunk@31132
git-svn-id: http://core.svn.wordpress.org/trunk@31113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-10 21:38:23 +00:00
Scott Taylor
5547115dc2
Fix some @param
docs that have chars too close them.
...
Add `@property` annotations to `WP_User` and `WP_Post`.
Remove erroneous `@param`s from image editor class methods.
Officially add the property `$_column_headers` to `WP_List_Table`.
See #30799 .
Built from https://develop.svn.wordpress.org/trunk@31127
git-svn-id: http://core.svn.wordpress.org/trunk@31108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-10 06:57:22 +00:00
Scott Taylor
60b0cd7943
The keyword elseif
should be used instead of else if
so that all control keywords look like single words.
...
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs.
See #30799 .
Built from https://develop.svn.wordpress.org/trunk@31090
git-svn-id: http://core.svn.wordpress.org/trunk@31071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 07:05:25 +00:00
Sergey Biryukov
7685e9dc97
Skip building the query in wp_count_posts() if cached results are used.
...
props MikeHansenMe.
fixes #30928 .
Built from https://develop.svn.wordpress.org/trunk@31058
git-svn-id: http://core.svn.wordpress.org/trunk@31039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-06 16:58:26 +00:00
Scott Taylor
f79eb196df
Improve the handling of comma-separated mime-types in wp_match_mime_types()
, particularly as pertains to the mime-type selector on the Media list table screen.
...
Props mdgl.
Fixes #30788 .
Built from https://develop.svn.wordpress.org/trunk@31042
git-svn-id: http://core.svn.wordpress.org/trunk@31023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-04 02:32:22 +00:00
Scott Taylor
aa26b4c1a0
If you set '_wp_page_template'
for a post, and then switch to a theme that doesn't support the template, subsequent calls to wp_insert_post()
will bail early without running a plethora of hooks. This shouldn't happen. We should set the template to 'default'
and continue through the rest of the function. The function will still bail if $wp_error
is true
via wp_insert_post( $arr, true )
.
...
Props nofearinc.
Fixes #25334 .
Built from https://develop.svn.wordpress.org/trunk@31020
git-svn-id: http://core.svn.wordpress.org/trunk@31001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-01 20:35:30 +00:00
Scott Taylor
5eb5afac34
For clarity, initialize some arrays that previously were only assigned via short circuit in loops.
...
See #30799 .
Built from https://develop.svn.wordpress.org/trunk@30982
git-svn-id: http://core.svn.wordpress.org/trunk@30968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-20 22:47:22 +00:00
Scott Taylor
48620242c4
Give up on making uninterrupted hierarchies work in get_page_children()
for now, reverts [30159], [30246], [30636].
...
Props boonebgorges.
See #14477 .
Built from https://develop.svn.wordpress.org/trunk@30735
git-svn-id: http://core.svn.wordpress.org/trunk@30725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-04 00:24:22 +00:00
Drew Jaynes
ad1f226c35
Improve formatting of inline documentation for get_pages()
.
...
Adds missing default values, corrects several argument types, backtick-escapes argument names used in descriptions.
See #28298 .
Built from https://develop.svn.wordpress.org/trunk@30725
git-svn-id: http://core.svn.wordpress.org/trunk@30715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-03 10:31:23 +00:00
Drew Jaynes
68ed7af808
Use the correct hash notation syntax for the get_pages()
DocBlock.
...
See #28298 .
Built from https://develop.svn.wordpress.org/trunk@30723
git-svn-id: http://core.svn.wordpress.org/trunk@30713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-03 10:16:23 +00:00
Scott Taylor
9a8be964b6
Improve the @param
docs for src/wp-includes/post*.php
.
...
See #30224 .
Built from https://develop.svn.wordpress.org/trunk@30671
git-svn-id: http://core.svn.wordpress.org/trunk@30661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 22:37:22 +00:00
Drew Jaynes
7e532924c3
Docs Formatting: Backtick-escape inline code for all dynamic hook docs in wp-includes/post.php.
...
Affects DocBlocks for the following hooks:
* `post_type_labels_{$post_type}`
* `edit_{$field}`
* `{$field_no_prefix}_edit_pre`
* `pre_{$field}`
* `{$field_no_prefix}_save_pre`
* `{$field}_pre`
* `$field`
* `save_post_{$post->post_type}`
* `{$old_status}_to_{$new_status}`
* `{$new_status}_{$post->post_type}`
See #30552 .
Built from https://develop.svn.wordpress.org/trunk@30653
git-svn-id: http://core.svn.wordpress.org/trunk@30643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 11:56:22 +00:00
Scott Taylor
d12eb2e38e
Ensure uniqueness when returning page lists in get_page_children()
. Fixes failing unit tests.
...
Props boonebgorges.
Reverts [30246].
Fixes #14477 .
Built from https://develop.svn.wordpress.org/trunk@30636
git-svn-id: http://core.svn.wordpress.org/trunk@30626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 06:05:24 +00:00
John Blackbourn
db9b25fbc5
Check attachments as well as the current post type when checking for duplicate post slugs. This avoids creating a page with a slug which conflicts with an existing attachment (the inverse is already handled).
...
Updates the existing test for pages which should take priority over attachments in cases where an existing clash exists.
Fixes #18962
Props boonebgorges
Built from https://develop.svn.wordpress.org/trunk@30629
git-svn-id: http://core.svn.wordpress.org/trunk@30619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 04:49:22 +00:00
Drew Jaynes
3b6c9519a8
Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.
...
Affects DocBlocks for the following core elements:
* Backtick-escape HTML tags in several argument descriptions for `wp_link_pages()`
* Remove an HTML tag from the summary for `prepend_attachment()`
* Backtick-escape inline code in the description for `get_extended()`
* Backtick-escape inline code in the description for `get_post_type_labels()`
* Various markdown formatting in the description for `add_rewrite_endpoint()`
* Markdown-indent a code snippet in the file header for wp-includes/shortcodes.php
* Markdown-indent code snippets in the description for `add_shortcode()
Props rarst.
See #30473 .
Built from https://develop.svn.wordpress.org/trunk@30545
git-svn-id: http://core.svn.wordpress.org/trunk@30534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 06:15:24 +00:00
John Blackbourn
b50cbe1f4f
Correct an SQL syntax error introduced in r30158. Adds tests.
...
Fixes #30339
See #18962
Props julien731
Built from https://develop.svn.wordpress.org/trunk@30480
git-svn-id: http://core.svn.wordpress.org/trunk@30468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-20 16:46:22 +00:00
Drew Jaynes
3e94d3a931
Fix incorrect documentation in the DocBlocks for get_lastpostmodified()
and _get_last_post_time()
.
...
Props ericlewis for the initial patch.
Fixes #30249 .
Built from https://develop.svn.wordpress.org/trunk@30287
git-svn-id: http://core.svn.wordpress.org/trunk@30287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 21:08:45 +00:00
Drew Jaynes
92c153aa8c
Fix the syntax for some status-related documentation introduced in [30155].
...
* Variables in DocBlocks should be backtick-escaped
* Parameter and return types should be as specific as possible
* `@param` types and variables should align with each other, but not intentionally with the `@return` description
See #30230 .
Built from https://develop.svn.wordpress.org/trunk@30284
git-svn-id: http://core.svn.wordpress.org/trunk@30284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 20:56:22 +00:00
Scott Taylor
03ea739661
In get_page_children()
, only check $page->ancestors
once to avoid duplicates when the function recurses. Adds an argument, $ancestors
.
...
Fixes #18962 .
Built from https://develop.svn.wordpress.org/trunk@30246
git-svn-id: http://core.svn.wordpress.org/trunk@30246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 20:05:24 +00:00
Scott Taylor
878d074e84
Allow get_pages()
, with child_of
passed to it, to work with interrupted hierarchies.
...
Adds unit test.
Fixes #18962 .
Built from https://develop.svn.wordpress.org/trunk@30159
git-svn-id: http://core.svn.wordpress.org/trunk@30159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-01 20:44:21 +00:00
Scott Taylor
d5e4583475
All duplicate slugs across different post types.
...
Adds unit test.
Props mboynes, nacin.
Fixes #18962 .
Built from https://develop.svn.wordpress.org/trunk@30158
git-svn-id: http://core.svn.wordpress.org/trunk@30158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-01 20:37:24 +00:00
Scott Taylor
be08f576df
Improve some post_status
-related documentation.
...
Props ericlewis.
See #30230 .
Built from https://develop.svn.wordpress.org/trunk@30155
git-svn-id: http://core.svn.wordpress.org/trunk@30155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-01 20:20:23 +00:00
Drew Jaynes
66c47f29bb
Correct references of @uses $wpdb
in core documentation to use @global
.
...
See #30191 , [30105].
Fixes #30217 .
Built from https://develop.svn.wordpress.org/trunk@30122
git-svn-id: http://core.svn.wordpress.org/trunk@30122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-31 17:56:22 +00:00
Drew Jaynes
f8657d5890
Remove redundant and erroneous @uses
tag from most core inline documentation.
...
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.
Fixes #30191 .
Built from https://develop.svn.wordpress.org/trunk@30105
git-svn-id: http://core.svn.wordpress.org/trunk@30105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-30 01:05:24 +00:00
Sergey Biryukov
64d1fd2a8f
When using 'show_in_menu' as a default value for 'show_in_admin_bar' in register_post_type(), cast to boolean instead of requiring a strict match.
...
props ipm-frommen.
fixes #30092 .
Built from https://develop.svn.wordpress.org/trunk@30041
git-svn-id: http://core.svn.wordpress.org/trunk@30041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-27 13:08:19 +00:00
Scott Taylor
fd4e3023d6
In wp_delete_attachment()
: account for orphan sizes by looping over the sizes stored in metadata, instead of relying on the current sizes stored in $_wp_additional_image_sizes
.
...
Props JoshuaAbenazer, desrosj, markoheijnen.
Fixes #24518 .
Built from https://develop.svn.wordpress.org/trunk@29816
git-svn-id: http://core.svn.wordpress.org/trunk@29582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-02 15:32:16 +00:00
Drew Jaynes
cca3890c84
Add some missing information to the inline docs for get_post_types()
.
...
* Improves the `@see` reference for `register_post_type()` to mention that it contains information about accepted arguments
* Adds a description of the accepted values for the `$operator` parameter
* Fixes a typo
Fixes #29721 .
Built from https://develop.svn.wordpress.org/trunk@29752
git-svn-id: http://core.svn.wordpress.org/trunk@29524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-21 08:55:18 +00:00
Sergey Biryukov
793f814303
Make sure the $parent argument of wp_insert_attachment() still works as expected after [28579].
...
prop jesin, dikiy_forester.
fixes #29646 for trunk.
Built from https://develop.svn.wordpress.org/trunk@29745
git-svn-id: http://core.svn.wordpress.org/trunk@29519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-15 14:24:17 +00:00
John Blackbourn
d5156105b3
Correct the docblock for the registered_post_type
action. Fixes #29184 .
...
Built from https://develop.svn.wordpress.org/trunk@29468
git-svn-id: http://core.svn.wordpress.org/trunk@29246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-11 21:21:16 +00:00
Scott Taylor
0fbddaa2d2
Unbreak Media Trash
after [28788].
...
Props SergeyBiryukov.
Fixes #29080 .
Built from https://develop.svn.wordpress.org/trunk@29337
git-svn-id: http://core.svn.wordpress.org/trunk@29117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-01 15:15:17 +00:00
Sergey Biryukov
9c1d22a454
Avoid PHP notices in _count_posts_cache_key(), _update_blog_date_on_post_publish(), and _update_blog_date_on_post_delete() if post type is not registered.
...
props jesin.
fixes #28135 .
Built from https://develop.svn.wordpress.org/trunk@29318
git-svn-id: http://core.svn.wordpress.org/trunk@29099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-29 00:51:17 +00:00
Drew Jaynes
29f48882c8
Convert default arguments documentation for get_posts()
into a hash notation.
...
Props coffee2code for the initial patch.
See #28841 .
Built from https://develop.svn.wordpress.org/trunk@29113
git-svn-id: http://core.svn.wordpress.org/trunk@28899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 23:34:15 +00:00
Drew Jaynes
61d1ecba20
Fix syntax for inline comment line endings and a few line wraps in wp-includes/post.php inline documentation.
...
Fixes #25412 .
Built from https://develop.svn.wordpress.org/trunk@29097
git-svn-id: http://core.svn.wordpress.org/trunk@28883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 18:35:16 +00:00
Drew Jaynes
47bdd8cbd0
General inline documentation improvements in wp-includes/post.php.
...
Final-run. Fixes #25412 .
Built from https://develop.svn.wordpress.org/trunk@29094
git-svn-id: http://core.svn.wordpress.org/trunk@28880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 11:16:15 +00:00
Drew Jaynes
877bbff728
General inline documentation improvements in wp-includes/post.php.
...
Third-run. See #25412 .
Built from https://develop.svn.wordpress.org/trunk@29093
git-svn-id: http://core.svn.wordpress.org/trunk@28879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 10:28:15 +00:00
Drew Jaynes
f820bb9fa3
General inline documentation improvements in wp-includes/post.php.
...
Second-run. See #25412 .
Built from https://develop.svn.wordpress.org/trunk@29092
git-svn-id: http://core.svn.wordpress.org/trunk@28878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 08:16:14 +00:00
Drew Jaynes
789960f242
Convert phpDoc for register_post_type()
to use a hash notation for the $args
array.
...
See #25412 .
Built from https://develop.svn.wordpress.org/trunk@29091
git-svn-id: http://core.svn.wordpress.org/trunk@28877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 07:56:14 +00:00
Drew Jaynes
4cf4a6b866
General inline documentation improvements in wp-includes/post.php.
...
First-run. See #25412 .
Built from https://develop.svn.wordpress.org/trunk@29090
git-svn-id: http://core.svn.wordpress.org/trunk@28876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-11 07:01:14 +00:00
Drew Jaynes
d4dd02b4ae
Remove backticks on $post
variables in some short parameter descriptions.
...
See [28653], [28654].
See #28388 .
Built from https://develop.svn.wordpress.org/trunk@28976
git-svn-id: http://core.svn.wordpress.org/trunk@28765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-03 19:28:14 +00:00
Drew Jaynes
6dd339f215
Specify the $single
parameter default for get_post_meta()
. Docs spacing.
...
See #28708 .
Built from https://develop.svn.wordpress.org/trunk@28955
git-svn-id: http://core.svn.wordpress.org/trunk@28751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-02 03:30:14 +00:00
Sergey Biryukov
81103f482a
Mark $single parameter of get_post_meta() as optional.
...
props netweb.
fixes #28708 .
Built from https://develop.svn.wordpress.org/trunk@28954
git-svn-id: http://core.svn.wordpress.org/trunk@28750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-02 03:26:16 +00:00
Sergey Biryukov
a8d0832a15
Notify developers when register_post_type() or register_taxonomy() fails because of post type or taxonomy key length.
...
props mattheweppelsheimer.
fixes #28683 .
Built from https://develop.svn.wordpress.org/trunk@28902
git-svn-id: http://core.svn.wordpress.org/trunk@28701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-29 21:54:14 +00:00
Scott Taylor
8b3bb6cc2d
Remove obsolete wp_cache_delete('get_pages', 'posts')
from clean_post_cache()
.
...
Fixes #27459 .
Built from https://develop.svn.wordpress.org/trunk@28875
git-svn-id: http://core.svn.wordpress.org/trunk@28674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-28 02:16:14 +00:00
Scott Taylor
269bd96f65
Posts in the Trash should not drag attachment pages down with them.
...
Props ericlewis.
Fixes #14639 .
Built from https://develop.svn.wordpress.org/trunk@28791
git-svn-id: http://core.svn.wordpress.org/trunk@28604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-20 19:14:15 +00:00
Scott Taylor
33c096aa71
Reinstate the changes from [28579] with some adjustments:
...
* Check `! empty( $postarr['file'] )` before calling `update_attached_file()`
* Add a unit test: `test_update_attachment_fields()`
* Run the same logic for empty `guid` for attachments that always ran in `wp_insert_post()`, as per #18310 . This fixes a unit test that would have broken when this ticket was marked closed.
* Updated the unit test in `Tests_Media::test_wp_prepare_attachment_for_js()` to account for `url` no longer being empty
Props kovshenin, wonderboymusic.
See #21963 .
Built from https://develop.svn.wordpress.org/trunk@28788
git-svn-id: http://core.svn.wordpress.org/trunk@28601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-20 18:27:14 +00:00
Scott Taylor
05eeb16e30
Replace all uses of like_escape()
with $wpdb->esc_like()
.
...
Props miqrogroove.
See #10041 .
Built from https://develop.svn.wordpress.org/trunk@28712
git-svn-id: http://core.svn.wordpress.org/trunk@28528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-10 00:44:15 +00:00
Sergey Biryukov
f9792ed973
Correct @return value for get_children().
...
props ghost1227.
fixes #28422 .
Built from https://develop.svn.wordpress.org/trunk@28677
git-svn-id: http://core.svn.wordpress.org/trunk@28495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-05 15:53:14 +00:00
Drew Jaynes
b0a1f67b6b
Be more specific that $post_id
does not default to the ID of the global $post
in some cases.
...
See [28654]. See #28388 .
Built from https://develop.svn.wordpress.org/trunk@28655
git-svn-id: http://core.svn.wordpress.org/trunk@28473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-03 04:52:15 +00:00
Drew Jaynes
3724252959
Ensure $post_id
is documented as optional where applicable.
...
See #28388 .
Built from https://develop.svn.wordpress.org/trunk@28654
git-svn-id: http://core.svn.wordpress.org/trunk@28472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-03 04:44:16 +00:00
Andrew Nacin
3a2174002e
Revert [28579] and [28582]. see #21963 .
...
Built from https://develop.svn.wordpress.org/trunk@28601
git-svn-id: http://core.svn.wordpress.org/trunk@28426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-28 18:14:15 +00:00
Scott Taylor
714aae91ea
Fix some inline docs churn in wp_insert_post()
after [28579].
...
Props kpdesign.
See #21963 .
Built from https://develop.svn.wordpress.org/trunk@28582
git-svn-id: http://core.svn.wordpress.org/trunk@28407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-27 00:24:15 +00:00
Scott Taylor
b184336927
Combine wp_insert_attachment()
and wp_insert_post()
. wp_insert_attachment()
becomes a wrapper. Update inline docs.
...
Props wonderboymusic, DrewAPicture.
See #21963 .
Built from https://develop.svn.wordpress.org/trunk@28579
git-svn-id: http://core.svn.wordpress.org/trunk@28404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-26 23:20:13 +00:00
Scott Taylor
8d4d645629
Fix parsing in wp_match_mime_types()
to allow some mime-types with +
in them to appear in the list of filter links shown above the list table on upload.php
.
...
Props _duck.
Fixes #20672 .
Built from https://develop.svn.wordpress.org/trunk@28553
git-svn-id: http://core.svn.wordpress.org/trunk@28379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-22 21:36:15 +00:00
Scott Taylor
f4661c6659
Eliminate the use of extract()
in get_pages()
.
...
See #22400 .
Built from https://develop.svn.wordpress.org/trunk@28471
git-svn-id: http://core.svn.wordpress.org/trunk@28298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-17 17:12:15 +00:00
Scott Taylor
1bd4118799
Eliminate the use of extract()
in wp_insert_attachment()
.
...
`wp_insert_attachment()` and `wp_insert_post()` are incredibly similar, but have branched logic. I have annotated many places where they diverge.
See #22400 .
Built from https://develop.svn.wordpress.org/trunk@28470
git-svn-id: http://core.svn.wordpress.org/trunk@28297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-17 16:54:14 +00:00
Scott Taylor
73a9ba7428
Eliminate the use of extract()
in wp_insert_post()
.
...
See #22400 .
Built from https://develop.svn.wordpress.org/trunk@28469
git-svn-id: http://core.svn.wordpress.org/trunk@28296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-17 15:53:15 +00:00
Scott Taylor
ef8b813682
Eliminate use of extract()
in trackback_url_list()
.
...
See #22400 .
Built from https://develop.svn.wordpress.org/trunk@28382
git-svn-id: http://core.svn.wordpress.org/trunk@28210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-13 04:44:15 +00:00
Scott Taylor
1aed1f1108
In get_pages()
, $cache
does not need to be reset to an empty array. update_post_cache( $pages )
takes care of priming.
...
In `set_post_thumbnail()`, (accidental) assignment is unnecessary for `$thumbnail_html` as it is not used.
See #27882 .
Built from https://develop.svn.wordpress.org/trunk@28332
git-svn-id: http://core.svn.wordpress.org/trunk@28160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-06 21:39:14 +00:00
John Blackbourn
ab041987d3
Remove some unnecessary abstraction introduced in [28191]. See #27985 .
...
Built from https://develop.svn.wordpress.org/trunk@28194
git-svn-id: http://core.svn.wordpress.org/trunk@28024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-24 11:55:22 +00:00
John Blackbourn
d6e03df3c9
Avoid an expensive attachment counting query on the post editing screen. See #27985 , for trunk.
...
Built from https://develop.svn.wordpress.org/trunk@28191
git-svn-id: http://core.svn.wordpress.org/trunk@28021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-23 22:05:16 +00:00
Drew Jaynes
2d79af0e0a
Part II of inline documentation for hooks in wp-includes/post.php.
...
Documents all remaining hooks following [28041] and [28042]. Also updates the hash notation style for `wp_insert_post()`.
Props nacin for several hook descriptions.
Fixes #25376 .
Built from https://develop.svn.wordpress.org/trunk@28106
git-svn-id: http://core.svn.wordpress.org/trunk@27937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-13 23:06:14 +00:00
Drew Jaynes
a55d734f60
Clarify documentation for hooks in sanitize_post_field()
.
...
* `edit_post_{$field}` pairs with `edit_{$field}`
* `pre_post_{$field}` pairs with `pre_{$field}`
* `post_{$field}` pairs with `{$field}`
As the above pairs' docs are unnecessarily duplicative, the second sets of docs have been removed. Also, the "duplicates" are purposely not marked as such in this case as the hook names differ. Also remove `@deprecated` tags mistakenly left in in [28041].
See #25376 .
Built from https://develop.svn.wordpress.org/trunk@28042
git-svn-id: http://core.svn.wordpress.org/trunk@27872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 07:41:14 +00:00
Drew Jaynes
07ee43d6d0
Part I of inline documenation for hooks in wp-includes/post.php.
...
Adds docs for the following hooks:
* `get_attached_file`
* `update_attached_file`
* `_wp_relative_upload_path`
* `post_type_labels_{$post_type}`
* `edit_{$field}`
* `{$field_no_prefix}_edit_pre`
* `edit_post_{$field}`
* `pre_{$field}`
* `{$field_no_prefix}_save_pre`
* `pre_post_{$field}`
* `{$field}_pre`
* `$field`
* `post_{$field}`
* `wp_count_posts`
* `wp_count_attachments`
* `post_mime_types`
* `wp_insert_post_empty_content`
See #25376 .
Built from https://develop.svn.wordpress.org/trunk@28041
git-svn-id: http://core.svn.wordpress.org/trunk@27871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 06:49:14 +00:00
Drew Jaynes
cebbcd473c
Fix the wp_count_attachments()
PHPDoc to reflect that it returns an object, not array.
...
See #25412 .
Built from https://develop.svn.wordpress.org/trunk@27807
git-svn-id: http://core.svn.wordpress.org/trunk@27641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-28 05:43:15 +00:00
Scott Taylor
0a2e85d3f0
Use wp_parse_id_list()
when parsing exclude_tree
in get_pages()
. Add unit tests to ensure a URL string, array with string as value, and array with array as value for exclude_tree
can be used to specify multiple IDs.
...
Props cgaffga, roothorick, hakre, tbrams for patches across the years.
Fixes #9153 .
Built from https://develop.svn.wordpress.org/trunk@27767
git-svn-id: http://core.svn.wordpress.org/trunk@27604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-27 01:18:14 +00:00
Helen Hou-Sandí
52d2920891
Use Dashicon-style images for mime type icons. Actually moving to Dashicons via the font can be explored later, but has theme/plugin implications and requires too many changes to make it for 3.9. props melchoyce for the icons. fixes #26650 .
...
Built from https://develop.svn.wordpress.org/trunk@27726
git-svn-id: http://core.svn.wordpress.org/trunk@27563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 21:10:15 +00:00
Scott Taylor
38d1fb971f
Turn on thumbnail support for attachment:audio
and attachment:video
. Change conditionals to check for theme OR post type support when determining whether to turn on the Featured Image UI pieces in the admin.
...
Fixes #27460 .
Built from https://develop.svn.wordpress.org/trunk@27657
git-svn-id: http://core.svn.wordpress.org/trunk@27500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-23 02:35:14 +00:00
Drew Jaynes
da19fc531c
Better standardize parameter value types in PHPDocs where both a post ID or WP_Post
would be acceptable.
...
Covers cases where previously only `int` or `int|object` types were notated.
Props coffee2code for the original patch.
See #20495 .
Built from https://develop.svn.wordpress.org/trunk@27473
git-svn-id: http://core.svn.wordpress.org/trunk@27318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-08 19:32:16 +00:00
Andrew Nacin
17ccbc86c9
Rename the new page_templates filter to theme_page_templates, and pass it a post object for proper context.
...
see #13265 .
Built from https://develop.svn.wordpress.org/trunk@27470
git-svn-id: http://core.svn.wordpress.org/trunk@27315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-08 04:19:16 +00:00
John Blackbourn
3a0a98205c
Allow get_page_by_path()
and get_page_by_title()
to accept an array of post types. Fixes #24763 . Props zbtirrell.
...
Built from https://develop.svn.wordpress.org/trunk@27423
git-svn-id: http://core.svn.wordpress.org/trunk@27270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-05 22:26:15 +00:00
Andrew Nacin
d24a109288
Revert [27115] and let cache backends handle the stripping of spaces in cache keys as necessary.
...
microtime() returns greater precision than microtime(true).
see #27000 , #23448 , #26903 , #14485 .
Built from https://develop.svn.wordpress.org/trunk@27300
git-svn-id: http://core.svn.wordpress.org/trunk@27153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-26 22:05:13 +00:00
Drew Jaynes
cb8951b0b3
Remove all @package
and @subpackage
PHPDoc tags not at the file- or class-levels in core.
...
See #27200 .
Built from https://develop.svn.wordpress.org/trunk@27262
git-svn-id: http://core.svn.wordpress.org/trunk@27119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-25 17:14:14 +00:00
Sergey Biryukov
ab8847316c
Correct return values for update_metadata() and related functions.
...
fixes #21864 .
Built from https://develop.svn.wordpress.org/trunk@27191
git-svn-id: http://core.svn.wordpress.org/trunk@27050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-18 21:36:14 +00:00
Drew Jaynes
8c9f7965af
Inline documentation for the wp_insert_attachment_data
filter hook, added in [27130].
...
Fixes #20547 .
Built from https://develop.svn.wordpress.org/trunk@27138
git-svn-id: http://core.svn.wordpress.org/trunk@27005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-08 22:47:12 +00:00
Scott Taylor
cbc1b90633
Add a filter wp_insert_attachment_data
in wp_insert_attachment()
. This is similar to the wp_insert_post_data
filter in wp_insert_post()
.
...
Fixes #20547 .
Built from https://develop.svn.wordpress.org/trunk@27130
git-svn-id: http://core.svn.wordpress.org/trunk@26997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-08 00:44:13 +00:00
Andrew Nacin
084a7b50cd
Use a float for last_changed microtime cache values.
...
microtime() by default returns a string with a space, which isn't allowed for keys in some cache backends.
props _jameslee, drozdz.
fixes #27000 . see #23448 .
Built from https://develop.svn.wordpress.org/trunk@27115
git-svn-id: http://core.svn.wordpress.org/trunk@26982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-07 08:14:12 +00:00
Scott Taylor
4830eeb9ad
Properly invalidate the cache for wp_count_posts()
on insert, trash, or when transitioning post_status
inside of _transition_post_status()
. Introduces _count_posts_cache_key()
. Adds unit tests.
...
Props mark8barnes, for bringing this to our attention in an initial patch.
Fixes #21879 .
Built from https://develop.svn.wordpress.org/trunk@27081
git-svn-id: http://core.svn.wordpress.org/trunk@26954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-03 19:42:13 +00:00
Drew Jaynes
edce7b88b5
Improve inline documentation for add_post_type_support()
.
...
Props philiparthurmoore.
Fixes #26683 .
Built from https://develop.svn.wordpress.org/trunk@26911
git-svn-id: http://core.svn.wordpress.org/trunk@26792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-07 02:05:11 +00:00
Sergey Biryukov
0ddaa76f3e
Use correct example of a Dashicons helper class in add_menu_page() and register_post_type() docs.
...
props Rarst.
fixes #26617 for trunk.
Built from https://develop.svn.wordpress.org/trunk@26884
git-svn-id: http://core.svn.wordpress.org/trunk@26767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-31 10:33:11 +00:00
Andrew Nacin
9b29ad0529
Allow for Dashicons and base64-encoded data:image/svg+xml URIs when specifying menu icons.
...
Both of these icons can be colored to match the color scheme, including hover states.
Both are accepted for register_post_type()'s menu_icon argument, and also add_menu_page()'s $icon_url argument.
To use a Dashicon, pass the name of the helper class, e.g. 'dashicons-piechart'.
To use an SVG, pass a valid data URI string starting with 'data:image/svg+xml;base64,'.
props helen.
fixes #25147 .
Built from https://develop.svn.wordpress.org/trunk@26664
git-svn-id: http://core.svn.wordpress.org/trunk@26554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-05 06:38:09 +00:00
Andrew Nacin
6fa4ce2284
Return false from wp_delete_post() and wp_delete_attachment() if the DELETE is unsuccessful.
...
This prevents attachments from being deleted off disk when a DB is locked and the delete is otherwise unsuccessful.
fixes #25107 .
Built from https://develop.svn.wordpress.org/trunk@26543
git-svn-id: http://core.svn.wordpress.org/trunk@26435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-02 22:59:10 +00:00
Scott Taylor
295851d0bb
In get_posts()
, alter the doc block and default args to make orderby
equal to date
, not post_date
.
...
Props ounziw.
Fixes #26128 .
Built from https://develop.svn.wordpress.org/trunk@26329
git-svn-id: http://core.svn.wordpress.org/trunk@26231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-22 17:39:10 +00:00
Andrew Nacin
d0cfa40983
Add jshintrc to qunit.
...
props jorbin.
see #25187 .
Built from https://develop.svn.wordpress.org/trunk@25992
git-svn-id: http://core.svn.wordpress.org/trunk@25925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-30 14:39:10 +00:00
Andrew Nacin
5361a8abca
Spell out duplicate hook locations.
...
props DrewAPicture.
fixes #25658 .
Built from https://develop.svn.wordpress.org/trunk@25868
git-svn-id: http://core.svn.wordpress.org/trunk@25868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:59:20 +00:00
Andrew Nacin
8ae8e01b67
Remove the old wp_auto_updates_maybe_update cron event. Schedule the new wp_maybe_auto_update event at 7 a.m. and 7 p.m. in the site's timezone.
...
see #27704 .
Built from https://develop.svn.wordpress.org/trunk@25825
git-svn-id: http://core.svn.wordpress.org/trunk@25825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:53:14 +00:00
Andrew Nacin
74488bdcb0
Spell out duplicate hook locations.
...
props DrewAPicture.
fixes #25658 .
Built from https://develop.svn.wordpress.org/trunk@25868
git-svn-id: http://core.svn.wordpress.org/trunk@25780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-22 17:22:11 +00:00
Andrew Nacin
5b6bcb218d
Reset "Page on Front" when such a page is trashed.
...
props danielbachhuber.
fixes #24171 .
Built from https://develop.svn.wordpress.org/trunk@25686
git-svn-id: http://core.svn.wordpress.org/trunk@25602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-03 03:51:09 +00:00
Dominik Schilling
e4c8d56b76
Replace use of global $user_ID
in favor of get_current_user_id()
. fixes #25372 .
...
Built from https://develop.svn.wordpress.org/trunk@25669
git-svn-id: http://core.svn.wordpress.org/trunk@25585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 21:10:09 +00:00
Scott Taylor
3f42db549c
post_content
does not have a default value in the $wpdb->posts
table. Add a default value of empty string to wp_insert_attachment()
to avoid a tornado of database errors in PHP 5.5/MySQL 5.6, even when debug mode is turned off.
...
See #25282 .
Built from https://develop.svn.wordpress.org/trunk@25661
git-svn-id: http://core.svn.wordpress.org/trunk@25577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-02 19:52:09 +00:00
Drew Jaynes
82904baffd
Improve inline documentation for wp_insert_post()
by adding a hash notation.
...
See #25412 .
Built from https://develop.svn.wordpress.org/trunk@25628
git-svn-id: http://core.svn.wordpress.org/trunk@25545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-25 17:34:08 +00:00
Drew Jaynes
38b7b3a1c5
Clarify inline documentation for the return in get_attached_file()
.
...
Fixes #25409 .
Built from https://develop.svn.wordpress.org/trunk@25609
git-svn-id: http://core.svn.wordpress.org/trunk@25526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-24 21:29:08 +00:00
Andrew Nacin
71263c4854
Use correct variable. props helen. see #17071 .
...
Built from https://develop.svn.wordpress.org/trunk@25581
git-svn-id: http://core.svn.wordpress.org/trunk@25498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-23 20:18:10 +00:00
Andrew Nacin
8fa6e99edc
Introduce a wp_count_attachments filter.
...
props kevinB.
fixes #17071 .
Built from https://develop.svn.wordpress.org/trunk@25579
git-svn-id: http://core.svn.wordpress.org/trunk@25496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-23 19:11:09 +00:00
Andrew Nacin
a4040ea928
In wp_count_posts(), rename 'count_posts' hook to 'wp_count_posts', for clarity. see #16603 .
...
Built from https://develop.svn.wordpress.org/trunk@25578
git-svn-id: http://core.svn.wordpress.org/trunk@25495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-23 19:08:09 +00:00
Andrew Nacin
5febb6045f
Introduce a meta_box_cb argument for register_taxonomy().
...
The specified callback function is used as the meta box callback for the taxonomy.
props garyc40, helen.
fixes #14206 .
Built from https://develop.svn.wordpress.org/trunk@25572
git-svn-id: http://core.svn.wordpress.org/trunk@25489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-23 17:12:10 +00:00
Scott Taylor
8697ae572e
Add hooks to wp_count_posts()
. Adds filter docs. Adds unit test to test count_posts
filter.
...
Props nacin, DrewAPicture.
Fixes #16603 .
Built from https://develop.svn.wordpress.org/trunk@25554
git-svn-id: http://core.svn.wordpress.org/trunk@25474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-21 17:55:08 +00:00
Scott Taylor
ae4cf7665a
Add @access private
to _get_custom_object_labels()
, which was already implied by the dangling underscore. Cast $labels
to array
in get_taxonomy_labels()
and _get_custom_object_labels()
.
...
Props nacin, foofy.
Fixes #16310 .
Built from https://develop.svn.wordpress.org/trunk@25553
git-svn-id: http://core.svn.wordpress.org/trunk@25473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-21 17:44:09 +00:00
Scott Taylor
8bd9659d0d
Move checks for post_type
being an array inline. See [25291], [25292], #18614 .
...
Built from https://develop.svn.wordpress.org/trunk@25312
git-svn-id: http://core.svn.wordpress.org/trunk@25274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-10 03:02:10 +00:00
Scott Taylor
d7704991b3
Check the value passed to get_post_type_object()
. If it's an array, use the first item. get_query_var( 'post_type' )
can be an array if the query has been altered via filters/actions. There are several places in core that pass the query var. Adds unit tests.
...
In `template-loader.php`, move `is_post_type_archive()` and `is_tax()` directly below `is_home()`.
See #18614 , [25291].
Built from https://develop.svn.wordpress.org/trunk@25292
git-svn-id: http://core.svn.wordpress.org/trunk@25256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-06 23:39:09 +00:00
Andrew Nacin
4b40e7a646
More adjustments and improvements for inline documentation for get_pages(). see #25186 .
...
Built from https://develop.svn.wordpress.org/trunk@25271
git-svn-id: http://core.svn.wordpress.org/trunk@25237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-06 01:21:09 +00:00
Scott Taylor
54c5a75e68
Simplify the check for false-y child_of
arg.
...
Props SergeyBiryukov.
See #25230 , [25245].
Built from https://develop.svn.wordpress.org/trunk@25270
git-svn-id: http://core.svn.wordpress.org/trunk@25236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-05 23:36:10 +00:00
Scott Taylor
cc41e7d04a
Fix spacing in docs for get_pages()
.
...
Props DrewAPicture.
See #25186 .
Built from https://develop.svn.wordpress.org/trunk@25268
git-svn-id: http://core.svn.wordpress.org/trunk@25234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-05 23:21:10 +00:00
Scott Taylor
1855f97a2c
Add docs to the woefully under-documented get_pages()
.
...
Props DrewAPicture.
Fixes #25186 .
Built from https://develop.svn.wordpress.org/trunk@25266
git-svn-id: http://core.svn.wordpress.org/trunk@25232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-05 22:13:09 +00:00
Scott Taylor
d1a40562eb
Add check to make sure a valid argument was passed to get_page_uri()
.
...
Props Viper007Bond.
Fixes #24491 .
Built from https://develop.svn.wordpress.org/trunk@25262
git-svn-id: http://core.svn.wordpress.org/trunk@25230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-05 21:42:10 +00:00
Scott Taylor
6253183ffc
Set hierarchical
to false
when parent
is passed to get_pages()
and child_of
is not.
...
Fixes #25230 .
Built from https://develop.svn.wordpress.org/trunk@25245
git-svn-id: http://core.svn.wordpress.org/trunk@25213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-04 21:00:09 +00:00
Scott Taylor
bf6da40cfc
Allow get_pages()
to accept an array
for the arg parent
. Adds unit tests, some will fail until the next commit.
...
Fixes #9470 .
Built from https://develop.svn.wordpress.org/trunk@25244
git-svn-id: http://core.svn.wordpress.org/trunk@25212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-04 20:56:09 +00:00
Scott Taylor
f1a33028f6
Allow int
to be passed in lieu of array
, add append
arg to wp_set_post_categories()
. Adds more extensive unit tests for wp_set_post_categories()
.
...
Props ptahdunbar for initial patch.
Fixes #16550 .
Built from https://develop.svn.wordpress.org/trunk@25234
git-svn-id: http://core.svn.wordpress.org/trunk@25204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-04 17:42:10 +00:00
Jon Cave
93b2edbbba
Correct rewrite tag for hierarchical post types without a query_var.
...
Hierarchical rewrite rules operate via the 'pagename' query variable which is
passed to get_page_by_path(). However, the current rewrite rules use the 'name'
query variable for hierarchical types without a custom query_var.
Fixes #16323 .
Built from https://develop.svn.wordpress.org/trunk@25182
git-svn-id: http://core.svn.wordpress.org/trunk@25154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-30 08:08:09 +00:00
Scott Taylor
7c1ea6c95c
No need to re-map the return values of wp_parse_id_list()
to int.
...
See #22074 , #11823 .
Built from https://develop.svn.wordpress.org/trunk@25169
git-svn-id: http://core.svn.wordpress.org/trunk@25145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-29 18:54:09 +00:00
Scott Taylor
0624fe960b
Improve the include / exclude SQL generation in get_pages()
by using IN
and NOT IN
where applicable. Adds unit tests for include / exclude.
...
Fixes #22074 .
Built from https://develop.svn.wordpress.org/trunk@25168
git-svn-id: http://core.svn.wordpress.org/trunk@25144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-29 18:49:09 +00:00
Scott Taylor
8e6abf65a8
Respect the fields
arg when passed to get_children()
.
...
Fixes #22208 .
Built from https://develop.svn.wordpress.org/trunk@25160
git-svn-id: http://core.svn.wordpress.org/trunk@25139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-29 15:08:12 +00:00
Dominik Schilling
357f52eed7
Improve inline docs for register_post_type() and register_taxonomy().
...
* register_taxonomy: Use the same doc format for the associative array arg as used for register_post_type()
* register_taxonomy: Improve docs for _builtin, capabilities, hierarchical and rewrite args
* register_taxonomy: Use the same order in $defaults as in docblock
* register_taxonomy: Replace is_null with null ===, to be consistent
* register_post_type: Use the same order in $defaults as in docblock
* register_post_type: Improve docs for @uses and default fallbacks
And while we're on it: Whitespaces.
fixes #25150 .
Built from https://develop.svn.wordpress.org/trunk@25130
git-svn-id: http://core.svn.wordpress.org/trunk@25110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-26 20:24:08 +00:00
Sergey Biryukov
b86ea82b12
Fix typo in phpdoc. props jamescollins. fixes #25092 .
...
Built from https://develop.svn.wordpress.org/trunk@25097
git-svn-id: http://core.svn.wordpress.org/trunk@25079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-22 23:48:09 +00:00
Andrew Nacin
fa4c7a1feb
PHPDoc for WP_Post properties. fixes #25092 .
...
Built from https://develop.svn.wordpress.org/trunk@25086
git-svn-id: http://core.svn.wordpress.org/trunk@25070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-22 15:58:09 +00:00
Scott Taylor
a9dc60c9a8
Improve inline docs for function params that can be serialized when non-scalar. Fixes #18488 .
...
Built from https://develop.svn.wordpress.org/trunk@25076
git-svn-id: http://core.svn.wordpress.org/trunk@25061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-21 21:11:09 +00:00
Dominik Schilling
8ad024f30a
Introduce save_post_{$post_type} hook.
...
The hook is fired before the general save_post hook and has the same args as save_post.
props bmb, SergeyBiryukov, ocean90, fixes #16176 .
Built from https://develop.svn.wordpress.org/trunk@25050
git-svn-id: http://core.svn.wordpress.org/trunk@25037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-17 20:21:09 +00:00
Andrew Nacin
08c4061af7
In get_attached_file(), fix the explanation of when the filter is bypassed. props devesine, fixes #24571 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@24983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-05 22:07:42 +00:00
Andrew Nacin
487327cf4e
Pass $update = true to the save_post and wp_insert_post hooks in wp_publish_post().
...
see #21450 , [24823].
props wpsmith.
fixes #24957 .
git-svn-id: http://core.svn.wordpress.org/trunk@24977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-05 21:41:51 +00:00
Andrew Nacin
c95a24f2d9
When registering a post type, pass the correct argument for feeds to add_permastruct().
...
props butuzov, johnpbloch.
fixes #23302 .
git-svn-id: http://core.svn.wordpress.org/trunk@24830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-28 22:28:18 +00:00
Andrew Nacin
87f9d112c0
Return an empty stdClass from wp_count_posts() when a nonexistent post type is requested.
...
props johnpbloch.
fixes #24803 .
git-svn-id: http://core.svn.wordpress.org/trunk@24826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-28 21:38:00 +00:00
Andrew Nacin
aa6d93cd3e
Pass $update to the save_post and wp_insert_post hooks in wp_insert_post(). props ericmann, fixes #21450 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@24823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-28 21:05:25 +00:00
Michael Adams
f993cfd8e3
Fix inline docs for posts functions that no longer use $wpdb
.
...
Props jdgrimes, JustinSainton.
git-svn-id: http://core.svn.wordpress.org/trunk@24807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-28 18:52:56 +00:00
Andrew Nacin
df0ac70aff
Add a default post_title value to wp_insert_attachment() to avoid a notice when there is no ID3 title.
...
props wonderboymusic.
see #24805 .
git-svn-id: http://core.svn.wordpress.org/trunk@24759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-20 20:20:47 +00:00
Andrew Nacin
ab72605607
More clear and concise escaping in get_page_by_path(). see #21767 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@24715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-16 14:23:29 +00:00
Andrew Nacin
092a33115c
Remove wp_parse_post_content(), get_paged_content(), paginate_content() from 3.6, and remove the new $id parameters for get_the_content() and the_content().
...
The content parsing functions are good abstractions, but are no longer needed by core and are too closely tied to legacy globals, rather than paving a new path.
For get_the_content() and the_content(), this only worsens the function prototype. It muddies theme-specific display (more links, etc) with filtered content. `apply_filters( 'the_content', $post->post_content )` is sufficient practice for now.
see #24330 , [24301]. see #23625 , [23804].
git-svn-id: http://core.svn.wordpress.org/trunk@24598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-09 05:22:50 +00:00
Sergey Biryukov
58c364947f
PHPDoc fixes and additions. fixes #24616 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@24490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-21 12:45:11 +00:00
Mark Jaquith
28e3c51dab
Lose content removal and splitting from the media extraction functions.
...
see #24484
git-svn-id: http://core.svn.wordpress.org/trunk@24400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-03 19:27:58 +00:00
Mark Jaquith
89fd06e44b
First pass at removing Post Format UI.
...
see #24452 . fixes #24455 .
git-svn-id: http://core.svn.wordpress.org/trunk@24388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-30 21:33:46 +00:00
Ryan Boren
a2b4bc456f
* Introduce wp_parse_post_content() and use it in setup_postdata(), get_the_content(), and get_the_remaining_content().
...
* Add a post ID argument to the_content(), get_the_content(), the_remaining_content(), and get_the_remaining_content().
* Pass the post ID to the the_content filter.
* Remove the format_pages global.
* Declare format_content and split_content as vars in WP_Post.
* phpdoc for the the_content filter that documents the new ID argument and denotes it as not-so-portable.
Props gcorne, DrewAPicture, duck_, aaroncampbell
see #24330
git-svn-id: http://core.svn.wordpress.org/trunk@24301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-20 11:05:50 +00:00
Sergey Biryukov
396166203e
Fix handling of '0' as meta_value argument in get_pages(). fixes #20376 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@24238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-10 19:18:54 +00:00
Sergey Biryukov
74638ccb5a
Fix typos in phpdoc. props TheLastCicada. fixes #24302 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@24229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-10 01:39:30 +00:00
Sergey Biryukov
57c10eadbb
Use ellipsis instead of three dots. props tjsingleton, jordie23, wojtek.szkutnik, DrewAPicture, SergeyBiryukov. see #8714 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@24207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-08 21:27:31 +00:00
Andrew Nacin
92b4636e17
Required arguments can't follow optional arguments.
...
Make required arguments optional in confirm_blog_signup().
Mark arguments as required in _future_post_hook(), the walker method display_element(), get_author_link() (deprecated), and the WP_Widget constructor.
props rlerdorf.
see #24210 .
git-svn-id: http://core.svn.wordpress.org/trunk@24126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-29 13:26:31 +00:00
Mark Jaquith
7c1ef6c33a
Use get_post_format() instead of assuming we already have it.
...
* Fixes an issue where image posts without a title could not be deleted
fixes #23887 . see #24046 . props WraithKenny, SergeyBiryukov.
git-svn-id: http://core.svn.wordpress.org/trunk@24015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-17 17:49:44 +00:00
Mark Jaquith
259f4fdef4
Allow the content of no-title audio, video, quote, and image posts to be blanked.
...
props wonderboymusic. fixes #23623 .
git-svn-id: http://core.svn.wordpress.org/trunk@23986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-14 01:43:01 +00:00
Mark Jaquith
cccb2939db
Fix a longstanding "off by one" revision authorship bug.
...
* Fixes old revision data on the fly when you open a post for editing.
* Uses post_name of revisions to store a post version number (-v1), so we know what has been fixed.
* Latest version should also have a revision stored, whereas before it did not.
props adamsilverstein, mdawaffe. fixes #16215 .
git-svn-id: http://core.svn.wordpress.org/trunk@23823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-27 20:21:38 +00:00
Ryan Boren
77f431ec4c
Bail early with correct WP_Error when an invalid post ID is passed to wp_insert_post() and wp_update_post().
...
Props simonwheatley
fixes #23474
git-svn-id: http://core.svn.wordpress.org/trunk@23740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-18 14:33:09 +00:00
Sergey Biryukov
27298cd802
Remove redundant code from post_type_supports() and remove_post_type_support(). props obenland, bilalcoder. fixes #21527 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@23722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-15 18:28:33 +00:00
Andrew Nacin
3828d67fad
Allow get_post_ancestors() to inspect the $post global, when null/0 is received. see #23708 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@23635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-07 06:49:46 +00:00
Ryan Boren
315bfb019a
Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
...
see #21767
git-svn-id: http://core.svn.wordpress.org/trunk@23594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-03 21:11:40 +00:00
Ryan Boren
43a7e695e9
Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767
...
git-svn-id: http://core.svn.wordpress.org/trunk@23554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 16:28:40 +00:00
Andrew Nacin
5cd77fdb99
Revert [23359]. The post_author and comment_count post object fields will remain numeric strings for back compat. see #22324 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@23531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-28 19:40:26 +00:00
Andrew Nacin
b88b1c1f53
Move revisions/autosave and post format functions from wp-includes/post.php into revision.php and post-formats.php.
...
git-svn-id: http://core.svn.wordpress.org/trunk@23466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-21 21:24:34 +00:00
Helen Hou-Sandí
ad85d07189
Edit screen UI for post formats: a first run for functionality.
...
* Adds a very basic tabbed interface for selecting a post format (requires JS).
* Extra fields, which are post meta, are shown/hidden based on the selected format.
* Introduce a helper function for retrieving formats-specific metadata: `get_post_format_meta()`.
* Image selection uses the media modal, although without filtering or from URL support at the moment.
props rachelbaker, wonderboymusic, aaroncampbell, helen. see #19570 .
git-svn-id: http://core.svn.wordpress.org/trunk@23449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-18 19:11:24 +00:00
Sergey Biryukov
a395bb01b8
Properly truncate UTF-8 post slugs in wp_unique_post_slug(). fixes #21013 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@23420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-15 14:35:41 +00:00
Ryan Boren
cc5ed3a485
Change all core API to expect unslashed rather than slashed arguments.
...
The exceptions to this are update_post_meta() and add_post_meta() which are often used by plugins in POST handlers and will continue accepting slashed data for now.
Introduce wp_upate_post_meta() and wp_add_post_meta() as unslashed alternatives to update_post_meta() and add_post_meta(). These functions could become methods in WP_Post so don't use them too heavily yet.
Remove all escape() calls from wp_xmlrpc_server. Now that core expects unslashed data this is no longer needed.
Remove addslashes(), addslashes_gpc(), add_magic_quotes() calls on data being prepared for handoff to core functions that until now expected slashed data. Adding slashes in no longer necessary.
Introduce wp_unslash() and use to it remove slashes from GPCS data before using it in core API. Almost every instance of stripslashes() in core should now be wp_unslash(). In the future (a release or three) when GPCS is no longer slashed, wp_unslash() will stop stripping slashes and simply return what is passed. At this point wp_unslash() calls can be removed from core.
Introduce wp_slash() for slashing GPCS data. This will also turn into a noop once GPCS is no longer slashed. wp_slash() should almost never be used. It is mainly of use in unit tests.
Plugins should use wp_unslash() on data being passed to core API.
Plugins should no longer slash data being passed to core. So when you get_post() and then wp_insert_post() the post data from get_post() no longer needs addslashes(). Most plugins were not bothering with this. They will magically start doing the right thing. Unfortunately, those few souls who did it properly will now have to avoid calling addslashes() for 3.6 and newer.
Use wp_kses_post() and wp_kses_data(), which expect unslashed data, instead of wp_filter_post_kses() and wp_filter_kses(), which expect slashed data. Filters are no longer passed slashed data.
Remove many no longer necessary calls to $wpdb->escape() and esc_sql().
In wp_get_referer() and wp_get_original_referer(), return unslashed data.
Remove old stripslashes() calls from WP_Widget::update() handlers. These haven't been necessary since WP_Widget.
Switch several queries over to prepare().
Expect something to break.
Props alexkingorg
see #21767
git-svn-id: http://core.svn.wordpress.org/trunk@23416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 22:51:06 +00:00
Peter Westwood
ae974b8495
Revisions: Allow a plugin to force us to skip the don't save this revision because it hasn't changed code if it knows better.
...
See #7392 and #9843 . Also cleans up the whitespace.
git-svn-id: http://core.svn.wordpress.org/trunk@23415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 16:45:43 +00:00
Peter Westwood
716d48e0cd
Revisions: Before saving a new post revision make sure that something has changed in the fields that we are revisioning.
...
Fixes : #7392 and #9843 props adamsilverstein.
git-svn-id: http://core.svn.wordpress.org/trunk@23414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 11:36:32 +00:00
Ryan Boren
353ef064ea
Use microtime() instead of incrementors for last_changed to to avoid race conditions with cache evictions.
...
Props westi
fixes #23448
git-svn-id: http://core.svn.wordpress.org/trunk@23401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-11 18:08:14 +00:00
Sergey Biryukov
c569c15b6d
Correct the documentation for _publish_post_hook(). Remove unused global declaration. props roulandf. fixes #23376 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@23387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-05 15:45:37 +00:00
Sergey Biryukov
6f00a2c1cc
Sanitize post_author and comment_count as integer fields. props GeertDD. fixes #22324 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@23353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-28 04:17:05 +00:00
Ryan Boren
1b2b394a91
Avoid the appearance of a magic number.
...
Props nacin
see #23167
git-svn-id: http://core.svn.wordpress.org/trunk@23320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-22 15:52:13 +00:00
Ryan Boren
48058dfb99
Explicitly set last_changed to 1 instead of the result of wp_cache_set(). Avoids ambiguity and works with cache backends that return void instead of boolean.
...
see #23167
git-svn-id: http://core.svn.wordpress.org/trunk@23319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-22 15:46:16 +00:00
Helen Hou-Sandí
b538d6163f
Make sure .widefat border and background coloring only applies to tables. props MikeHansenMe. fixes #21936 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@23315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-22 14:44:04 +00:00
Ryan Boren
1edf259b45
In get_pages(), cache queries to individual cache buckets instead of storing them in one cached array. Also, store post IDs instead of full objects. This reduces overall memory usage as well as the size of the cache buckets. Use incrementor style passive cache invalidation.
...
Props nprasath002
see #23167
git-svn-id: http://core.svn.wordpress.org/trunk@23300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-15 17:32:35 +00:00
Peter Westwood
f683fc7677
Tighten our braces. Fixes #23118 props evansolomon.
...
git-svn-id: http://core.svn.wordpress.org/trunk@23265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-04 10:13:51 +00:00
Andrew Nacin
0d3d52a92a
Always return arrays from get_post_ancestors(). Return an array when passed a value that evaluates to false.
...
props dannydehaan.
fixes #22882 for trunk.
Test: [1177/tests].
git-svn-id: http://core.svn.wordpress.org/trunk@23212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-27 15:48:18 +00:00
Andrew Nacin
8d52e9fc68
Always call get_post() in get_page_uri() to ensure we have a WP_Post object, which lazy-loads the ancestors this function requires.
...
props dd32
fixes #22883
Unit tests: [1175/tests]
git-svn-id: http://core.svn.wordpress.org/trunk@23208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-27 15:26:05 +00:00
Andrew Nacin
f9d07a1928
Revert [21942] and have wp_publish_post() deal with the database directly. clean_post_cache() is now also called directly due to [21943].
...
fixes #22944 for trunk.
Unit tests: [1174/tests].
see #11399 . see #21963 .
git-svn-id: http://core.svn.wordpress.org/trunk@23206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-27 15:14:43 +00:00
Andrew Nacin
3097cb315b
Do not save an initial revision for a post created through the auto-draft mechanism. Prevents a bogus revision, often with the title 'Auto Draft'. Restores pre-auto-draft behavior made obvious by XML-RPC's implementation of both auto-drafts and the subsequent wp.getRevisions method. fixes #22687 . see #22686 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-12-03 06:28:28 +00:00
Ryan Boren
cef3bc6abb
Map the create_posts post type cap to upload_files for attachments.
...
Props nacin
fixes #16714
git-svn-id: http://core.svn.wordpress.org/trunk@22921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-29 16:14:07 +00:00
Ryan Boren
b237423e72
Clear the object term relationships cache in wp_set_object_terms() rather than wp_set_post_terms(). This should be done lower in the stack than wp_set_post_terms().
...
Props batmoo
fixes #22560
git-svn-id: http://core.svn.wordpress.org/trunk@22878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-27 19:42:38 +00:00
Daryl Koopersmith
5b11aea8f5
Media: Dynamically generate attachment filters using get_post_mime_types().
...
Moves `get_post_mime_types()` from `wp-admin/includes/post.php` to `wp-includes/post.php`.
fixes #22514 , see #21390 .
git-svn-id: http://core.svn.wordpress.org/trunk@22743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-21 10:18:59 +00:00
Ryan Boren
a2edda4b6a
Don't bail from get_the_terms() if the post type is not registed for the taxonomy. This can break back compat when add_post_type_support( 'page', 'post-formats' ) is called but register_taxonomy_for_object_type( 'postr_-format', 'page' ) is not.
...
Props SergeyBiryukov
fixes #22473
git-svn-id: http://core.svn.wordpress.org/trunk@22722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-20 18:31:06 +00:00
Andrew Nacin
2f77c7984b
This should be a cache add, not a cache set. see #22503 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 08:39:52 +00:00
Andrew Nacin
a1dba4a709
Call wp_cache_set() with a group and then an expiration in wp_mime_type_icon(). fixes #22503 . see #22186 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 08:31:43 +00:00
Ryan Boren
cc2ddb8421
Always return a raw filtered post object from WP_Post::get_instance().
...
Props kovshenin, scribu, ntm
fixes #22448
git-svn-id: http://core.svn.wordpress.org/trunk@22635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-17 15:14:48 +00:00
Andrew Nacin
c67a081816
Revert [22445]. see #20376 . fixes #22389 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-08 03:30:56 +00:00
Andrew Nacin
8eb8948a2e
Fix meta value querying in wp_list_pages(). props SergeyBiryukov. fixes #20376 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 21:48:38 +00:00
Andrew Nacin
c04587d409
Add a $public_only argument to count_many_users_posts() and get_posts_by_author_sql(). Defaults to false, and allows the counts to be returned for only public posts. props ryan, westi. fixes #21431 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-05 23:11:25 +00:00
Andrew Nacin
e04bdce3ca
clean_post_cache() no longer calls itself recursively. see #11399 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-02 16:13:53 +00:00
Ryan Boren
a550a6d489
Use the create_posts capability in more places.
...
In get_post_type_capabilities(), make sure create_posts reflects customizations to the edit_posts capability when create_posts is not specifically set.
git-svn-id: http://core.svn.wordpress.org/trunk@22291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-24 22:15:43 +00:00
Ryan Boren
a316671b85
Don't wp_cache_add() stdClass objects in get_post() to avoid polluting the cache with incomplete or otherwise compromised objects.
...
Declare the core properties of WP_Pist as proper public properties and provide them with defaults.
Props wonderboymusic
fixes #22223
git-svn-id: http://core.svn.wordpress.org/trunk@22264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-19 21:53:17 +00:00
Andrew Nacin
2cc408d09c
Avoid queries in wp_unique_post_slug() for nav menu items. see #22189 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-15 14:13:57 +00:00
Andrew Nacin
57681dda7a
Remove whitespace from around the WP_Post/get_post SQL string.
...
git-svn-id: http://core.svn.wordpress.org/trunk@22230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-15 03:08:43 +00:00
Andrew Nacin
fd56fd3563
Use wp_update_post() rather than wp_insert_post() in wp_publish_post() to avoid stomping of values like categories. props ericmann, fixes #22167 . see #21963 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-11 17:36:59 +00:00
Andrew Nacin
ac6f57de76
Add post_type_labels_{$post_type} filter. props scribu. fixes #21948 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@22164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-10 13:50:42 +00:00
Ryan Boren
ac0011a77c
Make sure cache bucket is an array to avoid warning. see #21309
...
git-svn-id: http://core.svn.wordpress.org/trunk@22163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-10 12:29:51 +00:00
Ryan Boren
faca571a3a
Avoid 'Only variables should be assigned by reference' warning. Props wonderboymusic. see #21865
...
git-svn-id: http://core.svn.wordpress.org/trunk@22114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-04 18:21:47 +00:00
Ryan Boren
f8f60ac01b
Introduce create_posts meta capability. Props scribu, nacin, casben79. see #16714
...
git-svn-id: http://core.svn.wordpress.org/trunk@22060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-27 15:33:19 +00:00
Ryan Boren
70edf4111b
Fetch full terms for the post_category and tags_input queries and then wp_list_pluck() the desired fields. Fetching full terms primes the cache and reduces overall queries. Add cache invalidation to wp_set_post_terms(). Props scribu. see #21309
...
git-svn-id: http://core.svn.wordpress.org/trunk@21981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-24 20:35:56 +00:00
Ryan Boren
bc3c170305
Don't add empty _wp_attached_file, _wp_attachment_metadata, _thumbnail_id meta to posts. Delete these fields when set to empty. Props SergeyBiryukov, Caspie. fixes #16391
...
git-svn-id: http://core.svn.wordpress.org/trunk@21967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-24 13:07:34 +00:00
Andrew Nacin
29b7d26ca5
Properly indent after [21952]. see #11399 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-22 16:21:06 +00:00
Andrew Nacin
a42ce2353a
Stop cleaning the cache of a post's children. Ancestors are no longer cached against the post object, which means this kind of walking is unnecessary. It is also prohibitively expensive with large hierarchies.
...
We need to remove post_ancestors non-persistent caching for this. get_post_ancestors() can simply rely on the caching of get_post() instead. Previously, it was a direct query, hence the extra layers of caching and clearing.
Child cache clearing stays in wp_delete_post() as children get a new parent.
fixes #11399 .
git-svn-id: http://core.svn.wordpress.org/trunk@21952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-22 15:55:02 +00:00
Andrew Nacin
33af30eb7f
Use the regular post type UI for editing single media items (attachments).
...
* Attachments now go through post.php, edit_post(), the like, and have show_ui set to true.
* Taxonomies attached to the media library now appear in the admin menu (if show_ui).
* Editing, cropping, uploading, etc. is still very rough, but mostly functional.
API-wise:
* New function: get_taxonomies_for_attachments(). Like get_taxonomies(), for taxonomies specifically registered against attachments.
* Brings taxonomy support from the posts list table to the media list table. Expect them to converge soon.
* wp_insert_attachment() now handles taxonomies like wp_insert_post(). Also expect them to converge soon.
* New edit_form_after_title hook.
props helenyhou, ocean90. see #21391 .
git-svn-id: http://core.svn.wordpress.org/trunk@21948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-21 22:52:54 +00:00
Andrew Nacin
5a362d3ace
Call clean_post_cache() in wp_insert_post() after the manual query to change GUID. Remove the second call to clean_post_cache() previously done on the save_post hook. see #11399 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-21 18:52:15 +00:00
Andrew Nacin
a4831c82f0
Have wp_publish_post() wrap wp_insert_post() directly. see #11399 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-21 18:49:45 +00:00
Peter Westwood
fa8a509ff3
Posting: Improve the invalid date protection code based on feedback from nacin.
...
* Introduce a wp_checkdate() function with a single filter to centralise the code that validates dates.
* Improve the error message
* Correctly handle the return value of wp_insert_post which is not always a WP_Error on failure
Fixes #17180
git-svn-id: http://core.svn.wordpress.org/trunk@21922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-20 10:46:50 +00:00
Peter Westwood
c05f6dc6dd
Posting: Make it much harder to create posts with invalid dates by enforcing the post date tests in the UI and the backend code.
...
Previously you could quite easily send a new post into the back of beyond by specifying an invalid date like the 30th Feb and this was very confusing.
Sometimes it would seem to work and sometimes the post would end up very far in the past - depending on the mysql version and other factors.
Fixes #17180 props jkudish.
git-svn-id: http://core.svn.wordpress.org/trunk@21921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-19 21:43:35 +00:00
Andrew Nacin
a7cd7c3ac7
Use wp_get_theme()->get_page_templates() rather than get_page_templates() in wp_insert_post(),
...
to allow page template setting on the frontend without a fatal error. fixes #21755 .
git-svn-id: http://core.svn.wordpress.org/trunk@21847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 18:36:08 +00:00
Andrew Nacin
95c9cd1e6b
Remove unused show_in_admin_all and single_view_cap from register_post_status(). props duck_. fixes #18972 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 18:02:23 +00:00
Andrew Nacin
07324a1f53
In get_page_by_path(), attempt to return an item that has the same post type before returning an attachment with the same name. props SergeyBiryukov. tests in [UT1021]. fixes #15665 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 17:19:25 +00:00
Andrew Nacin
b65ceddeeb
If update_post_caches() does not receive a post type, glean post types from the individual post objects, rather than assuming 'post'. fixes #20177 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 16:26:05 +00:00
Andrew Nacin
5bc021dad7
Allow supports => false to be passed to register_post_type() to disable the default title and editor.
...
An empty array may also disable all default features in the future.
Do not rely on this behavior: always specify title and editor if you want them.
props sc0ttkclark.
fixes #21586 .
git-svn-id: http://core.svn.wordpress.org/trunk@21831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 17:02:39 +00:00
Andrew Nacin
bc6087bc98
Always return upload directory information from wp_upload_dir(), even if there is an error. Append the error to the array. see #19235 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-11 22:06:49 +00:00
Andrew Nacin
9d204841ee
Remove AtomPub from core.
...
* Will be replaced with http://wordpress.org/extend/plugins/atom-publishing-protocol/ .
* Introduces an action, xmlrpc_rsd_apis, to add APIs to xmlrpc.php?rsd.
* Introduces support for 'error' being 403 and 50x in class-wp.php.
* Removes 'Remote Publishing' from Writing Settings (see [21804]). Keeps the remote_publishing settings section.
DB version is bumped to generate the new wp-app rewrite rule and remove the old enable_app option.
props wonderboymusic.
fixes #21509 .
git-svn-id: http://core.svn.wordpress.org/trunk@21818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-11 20:11:39 +00:00
Ryan Boren
f483a85676
Remove unnecessary return by refs. Props wonderboymusic. fixes #21839
...
git-svn-id: http://core.svn.wordpress.org/trunk@21792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-10 17:00:11 +00:00
Andrew Nacin
8a46609b03
Use wp_cache_add() in wp_mime_type_icon(). fixes #21835 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-07 21:10:43 +00:00
Daryl Koopersmith
50b120ad64
Ensure $post_id is defined in wp_mime_type_icon() to prevent notices when a valid mime type string is provided. see #21835 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-07 21:04:58 +00:00
Ryan Boren
cfb35a9d85
Use get_post() instead of global $post.
...
Make the $post argument to get_post() optional, defaulting to the current post in The Loop.
Props nacin
see #21309
git-svn-id: http://core.svn.wordpress.org/trunk@21735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-04 16:29:28 +00:00
Ryan Boren
16b01d701e
Simplify return from WP_Post::__get() now that references are no longer returned. see #21309
...
git-svn-id: http://core.svn.wordpress.org/trunk@21655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-29 13:42:11 +00:00
Ryan Boren
a43222bfaf
Lose return ref from WP_Post::__get(). see #21309
...
git-svn-id: http://core.svn.wordpress.org/trunk@21654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-29 13:23:54 +00:00
Ryan Boren
52b3f498e6
Add tags_input, page_template, and post_category get magic to WP_Post.
...
Deprecate get_post_to_edit() and wp_get_single_post().
Props scribu
see #21309
git-svn-id: http://core.svn.wordpress.org/trunk@21651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-28 19:08:28 +00:00
Ryan Boren
2ea0626e5d
Use switch_to_blog()/restore_current_blog() in get_blog_post() and get_blog_permalink(). Eliminate the duplicate caching in these functions. Return WP_Post from get_blog_post(). Update phpdoc. Remove global-posts cache invalidation. Props jondavidjohn fixes #21595
...
git-svn-id: http://core.svn.wordpress.org/trunk@21628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-27 16:22:45 +00:00
Ryan Boren
0352820e7b
Remove typo in phpdoc. see #21309 Props TobiasBg
...
git-svn-id: http://core.svn.wordpress.org/trunk@21601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-23 21:15:40 +00:00
Ryan Boren
18a1783423
Update phpdoc for functions that return WP_Post. Soft deprecate get_page(). see #21309
...
git-svn-id: http://core.svn.wordpress.org/trunk@21598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-23 20:34:41 +00:00
Ryan Boren
f56d8278bb
Remove return ref from all calls to get_post()
...
Return WP_Post from get_default_post_to_edit()
Replace all calls to get_page() with get_post()
see #21309
git-svn-id: http://core.svn.wordpress.org/trunk@21597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-23 20:01:10 +00:00
Ryan Boren
d2ecd62b7f
Remove references from get_post() and get_page().
...
Handle $GLOBALS['post'] containing stdClass instead of WP_Post.
Props nacin
see #21309
git-svn-id: http://core.svn.wordpress.org/trunk@21572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-21 15:42:28 +00:00
Andrew Nacin
cc63fad8cb
Return a variable reference from get_pages(). see [21559], see #21309 , fixes #20756 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-20 23:43:04 +00:00
Ryan Boren
9377523bce
Introduce WP_Post class. Clean up ancestors handling. Props scribu, toppa. fixes #10381 see #21309
...
git-svn-id: http://core.svn.wordpress.org/trunk@21559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-20 19:47:52 +00:00
Ryan Boren
9dbb6a34f6
Reduce calls to sanitize_title_with_dashes in register_(post_type|taxonomy). Props ocean90. fixes #21600
...
git-svn-id: http://core.svn.wordpress.org/trunk@21553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-20 17:25:06 +00:00
Andrew Nacin
7a4fdb78e1
Always return a variable reference from get_pages(). props wonderboymusic, foxinni. fixes #20756 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-20 16:38:43 +00:00
duck_
2740918883
Remove unused arguments (hierarchical, _edit_link, capability_type) from register_post_status
...
Props scribu, simonwheatley. Fixes #18578 , #18972 .
git-svn-id: http://core.svn.wordpress.org/trunk@21302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-22 08:45:35 +00:00
markjaquith
c937101f27
Clear the get_pages cache whenever ANY hierarchical post type cache is cleared — not just Pages. fixes #21279
...
git-svn-id: http://core.svn.wordpress.org/trunk@21286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-20 04:35:51 +00:00
markjaquith
6a1d888ea5
Better image extension regexes, so we don't just grab the "jpe" from "jpeg" files in media_sideload_image(). props sivel. fixes #16693
...
git-svn-id: http://core.svn.wordpress.org/trunk@21219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-05 20:51:55 +00:00
nacin
60b88004a6
Allow wp_update_post() to accept the same second argument as wp_insert_post(), allowing for WP_Error return values on failure. props scribu, mikeschinkel. fixes #15036 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-05 19:21:57 +00:00
nacin
c00968bee0
Take the original slug passed into wp_unique_post_slug() and pass it to the wp_unique_post_slug filter. props johnbillion. fixes #20480 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@21177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-29 13:57:02 +00:00
duck_
a2cf2fa988
get_post_stati() returns post statuses not types. Props jeremyfelt. Fixes #20664 .
...
git-svn-id: http://core.svn.wordpress.org/trunk@20779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-13 07:41:47 +00:00
ryan
d58d5993b0
Collect intermediate images before deleting an attachment and its meta. Fixes thumbnail deletion. Props SergeyBiryukov. fixes #20658
...
git-svn-id: http://core.svn.wordpress.org/trunk@20770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-11 18:47:32 +00:00
ryan
f5366a2ccf
Don't delete nav menu items when the user that owns them is deleted.
...
* Introduce delete_with_user flag to register_post_type
* Set delete_with_user to false for the nav_menu_item post type
* Set it to true for all other core post types
* If delete_with_user is not set, fallback to post_type_supports('author')
Props nacin
Fixes #16358
git-svn-id: http://core.svn.wordpress.org/trunk@20739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-08 17:01:50 +00:00
ryan
85781eaed2
phpdoc updates for register_post_type(). Props jeremyfelt. fixes #20622
...
git-svn-id: http://core.svn.wordpress.org/trunk@20734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-07 16:25:06 +00:00
ryan
ea65aae093
phpdoc fix for register_post_status(). Props yoavf. fixes #20616
...
git-svn-id: http://core.svn.wordpress.org/trunk@20726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-05 19:04:34 +00:00
nacin
0cac69f505
Return false in get_attached_file() when the file does not exist, rather than a path to the base uploads directory. props mikeschinkel. fixes #18855 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-27 16:08:58 +00:00
duck_
1e76fdfb4b
Accept a post object in clean_post_cache(). Fixes #20486 .
...
The post_type can then be accessed to properly clean the taxonomy relationships cache.
The full object is useful in situations when an ID might reference a post that has been
removed from the database (e.g. wp_delete_post()).
git-svn-id: http://svn.automattic.com/wordpress/trunk@20569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-23 22:04:35 +00:00
duck_
4523ec1333
Fix typo and terminology in Twenty Eleven's header template. Props JarretC. Fixes #20442 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-14 19:02:04 +00:00
ryan
27630a4286
Schedule auto-draft deletion from post-new.php instead of from admin.php. This provides better throttling for large multisite installs and reduces the risk of a delete avalanche.
...
fixes #19663
git-svn-id: http://svn.automattic.com/wordpress/trunk@20453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-12 18:49:48 +00:00
nacin
c7cf0927fc
Use the metadata API rather than raw queries and direct do_action calls. see #20417 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-11 20:02:39 +00:00
ryan
baf681233f
Pass post_type to clean_post_cache() instead of attempting to fetch a post object since the post may have been deleted.
...
Props leewillis77
see #19690
git-svn-id: http://svn.automattic.com/wordpress/trunk@20423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-10 16:09:44 +00:00
nacin
0730535015
Introduce $wpdb->delete(). props justindgivens, scribu. fixes #18948 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-24 15:24:31 +00:00
westi
79ff94923e
XMLRPC: Add new wp.getPostType and wp.getPostTypes apis. See #18436 props maxcutler, markoheijnen and nprasath002.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-23 17:53:14 +00:00
ryan
5b2274941d
Don't generate a query when the all_page_ids cache is an empty array. An empty array is a valid cache value when no pages are present. Avoids a useless query for sites with no pages. Props andy. see #20236
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-19 19:09:03 +00:00
duck_
848d75c4cb
Use return value of update_post_meta() in set_post_thumbnail() instead of always returning true. Props webord. Fixes #20218 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-14 09:48:57 +00:00
ryan
6241238938
Call _get_post_ancestors() from get_post_ancestors() if the ancestors property is not set in the post object. Works around situations where ancestors is not set in the cached version of the post object. see #18536
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-12 18:23:48 +00:00
westi
787d4acef5
XMLRPC: Expose the extended more text to XMLRPC clients from metaWeblog.getPost(). Fixes #10933 props koke, ericmann.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-08 12:50:21 +00:00
nacin
ae8af5d0dd
Introduce get_page_template_slug( $id = null ) to return a page's template (like "showcase.php"). Returns false if post ID is not a page, and an empty string for the default page template. Use the function across core. props billerickson for initial patch. fixes #18750 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-02 18:56:54 +00:00
duck_
a395e06896
Reduce references to the $wp_rewrite global because it's no longer used or a wrapper function can be used instead. Fixes #14546.#14546.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@20023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-28 20:29:33 +00:00
ryan
cf4135d478
Update phpdoc for wp_mime_type_icon(). Props SergeyBiryukov, mitchoyoshitaka. fixes #16604
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-14 18:12:01 +00:00
ryan
6aedd9d0f0
Split the main WP_Query posts query into two queries to avoid temp tables. Leverage cache to avoid second query in persistent cache environments. Props scribu, cheald, prettyboymp. see #18536
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-14 15:09:35 +00:00
nacin
51cdc1719d
Docs, see ##19882.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-10 22:49:56 +00:00
nacin
396a5b89e8
Allow get_post_meta() to be called with only a post ID, as get_metadata() handles this. props scribu, fixes #19882 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-10 22:42:54 +00:00
duck_
787dd48e8b
Make get_post_custom() a wrapper of get_post_meta() so that it works when cache addition is suspended and to simplify it.
...
Props leewillis77 for the initial patch. Fixes #19708 .
git-svn-id: http://svn.automattic.com/wordpress/trunk@19906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-10 22:00:37 +00:00
nacin
72c995441a
Allow localized commas to be used as tag separators. see #7897 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-07 18:06:12 +00:00
duck_
2f4c545761
Use new $args parameter for (WP_Rewrite::)add_permastruct(). Fixes #16092 .
...
Use array_intersect_key() to keep WP_Rewrite::$extra_permastructs free of unnecessary/unknown keys + values.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-28 21:00:59 +00:00
nacin
2e8a358541
s/parem/param/. props Latz. fixes #19823 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-24 21:52:49 +00:00
nacin
674196a2ef
Args is an object, not an array. props duck_, aaroncampbell. see #19275 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-23 19:32:39 +00:00
nacin
61abfcd3c7
Add 'ep_mask' as an argument to the 'rewrite' array for register_post_type() and register_taxonomy(). Keeps 'permalink_epmask' compatible as an argument for post type registrations. Fixes endpoints for category and tag pages. fixes #19275 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-23 19:12:04 +00:00
duck_
fab149d81e
Update hierarchy for all hierarchical post types when deleting a parent post, not just for pages. Fixes #19637 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-13 18:37:46 +00:00
ryan
4cf5450a81
Use wp_cache_add() instead of wp_cache_set() when priming the object term cache in update_object_term_cache(). Pass the real post_type to clean_object_term_cache() instead of hard-coding post. Call clean_object_term_cache() from clean_bookmark_cache(). Props leewillis77. fixes #19690
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-11 21:26:18 +00:00
duck_
3c0d45d77c
Rewrite rules don't need to be flushed on every page save/delete as they're no longer verbose. Fixes #19636 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-10 22:55:38 +00:00
duck_
81a7ad2c81
split was deprecated in PHP 5.3.0, so use explode instead. Props garyc40. Fixes #16325 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-09 21:20:51 +00:00
ryan
e3b46b25d3
Lose EOF ?>. Clean up EOF newlines. fixes #12307
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-08 17:01:11 +00:00
duck_
65b840b565
Fix mistakes in parameter documentation and add some missing param docs. See #19756 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-06 18:31:43 +00:00
ryan
616c35e71c
One newline is enough.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-05 20:10:39 +00:00
ryan
3eaf083995
Introduce sanitize_trackback_urls(). Don't ping bad urls. Don't ping bad urls or save them to the DB. Props xknown, SergeyBiryukov. fixes #17560
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-04 19:45:13 +00:00
ryan
07ff8b216b
Use one space, not two, after trailing punctuation. fixes #19537
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-13 23:45:31 +00:00
dd32
c85525aece
Switch to sanitize_title_for_query() for Query sanitization (allows for pre-3.3 page slugs to be viewable), Don't update page slugs to new slug-types when the slug is not being changed, Don't issue a XHR if the page slug hasn't changed. Group effort props xknown, markjaquith, nacin. See #19292
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-24 00:20:21 +00:00
nacin
d61b1474f9
Only enforce content/title/excerpt requirement in wp_insert_post() if the post type supports all three. Add a filter to allow this to be modified. fixes #18713 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-15 21:19:29 +00:00
duck_
d17f4409c3
Don't pass $post_type as get_page()'s $filter argument. Copy-and-paste error. Removal improves get_page_by_path() performance dramatically by stopping sanitize_post() being called. Fixes #19175 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-14 21:32:56 +00:00
dd32
5a026c389b
Fix typo in [19231]. See #17579
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-09 22:13:35 +00:00
nacin
04c38f3313
Check post type and bail earlier in wp_get_attachment_url(). props mitchoyoshitaka, fixes #17579 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-09 19:20:33 +00:00
nacin
d040cc1347
Don't set post_type QV in _post_format_request() when we're in the admin. props ethitter. fixes #18475 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-06 21:15:23 +00:00
duck_
aeb49fb7be
Return full WHERE clause from get_posts_by_author_sql() if the post type isn't registerd. Fixes SQL sytax on users list when 'post' is unregistered. Fixes #19116 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-02 17:06:34 +00:00
ryan
28b1b4763d
Avoid E_STRICT notices. see #18975
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-31 19:38:46 +00:00
ryan
c3c6a3721f
Fix notices and logic errors in get_page_by_path(). Props duck_. see #17670
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-28 19:32:19 +00:00
ryan
62afab8db3
Pinking shears
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-24 19:13:23 +00:00
nacin
00a31d6d19
Correct docs for get_post_field(). props JustinSainton, fixes #19025 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@19034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-21 17:13:26 +00:00
ryan
fca9f2e2e3
In wp_trash_post(), rename the trash_post action to wp_trash_post to avoid collision with the wp_transition_post_status() trash_post state transition. Props SergeyBiryukov. fixes #15628
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-14 18:39:31 +00:00
ryan
0370bda8bc
Count only published posts when updating term counts. Fire term count updates on transition_post_status. Props joehoyle. see #17548
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-10 20:52:44 +00:00
ryan
d7a17b96e9
Avoid refetching a post in get_post() when passed a post object that has already been raw sanitized. Clean up sanitize loop. Props scribu. fixes #18822
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-30 19:06:18 +00:00
ryan
e46e579ce5
Restore sorting by post_name in get_pages(). Props SergeyBiryukov. fixes #18805
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-30 18:12:14 +00:00
westi
b5a3362c70
Fire an action when a post type or taxonomy is registered so plugins can react. Fixes #18802 props simonwheatley.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-30 09:53:35 +00:00
azaozz
75432d53b0
Clean up remnants from having negative Post_IDs, props markjaquith, fixes #18235
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-29 21:47:52 +00:00
nacin
f4c5d43326
Revert [18783], as it breaks term relationship counts for attachment taxonomies. see #17548 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-29 05:29:20 +00:00
ryan
d187cf2559
Count only published posts when updating term counts. Fire term count updates on transition_post_status. Props joehoyle. fixes #17548
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-26 22:24:46 +00:00
nacin
9f216ad715
delete_post_thumbnail(). props CoenJacobs, duck_. fixes #17895 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-24 19:31:38 +00:00
duck_
4a6513185a
Documentation fixes. See #18560 .
...
- Add missing parameters
- Add missing @param data types
- s/format_where/where_format/
git-svn-id: http://svn.automattic.com/wordpress/trunk@18753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-22 12:02:31 +00:00
ryan
23db619491
Don't send page slugs through prepare() to avoid breaking octets in i18n page slugs. Props SergeyBiryukov. see #10249 #166687
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-08 17:17:17 +00:00
duck_
2f51b9be0d
Fix typos in documentation (wp-includes/[i-z]). See #18560 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-05 19:08:15 +00:00
markjaquith
31a016614d
Cast to array in get_page_by_path() foreach
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-31 06:46:16 +00:00
dd32
f1ac48873b
Display 'Edit Media' instead of 'Edit Post' for Attachments/Media in the admin bar. Props johnbillion. Fixes #18529
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-28 03:39:06 +00:00
westi
35838967a7
Add a general filter to wp_unique_post_slug to allow for full customisation of the uniqueness functionality. Fixes #14111 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-13 21:00:24 +00:00
markjaquith
4a610eaa7b
Eliminate verbose rewrite rules for ambiguous rewrite structures, resulting in massive performance gains. props andy, otto42, duck_. Nice work everyone! see #16687
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-12 01:55:08 +00:00
ryan
ec4ccf2900
Deprecate get_userdatabylogin() and get_user_by_email(). Props scribu. fixes #18333
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-05 16:57:31 +00:00
ryan
24d480d088
Turn delete_meta() , get_post_meta_by_id(), update_meta(), delete_post_meta_by_key() into wrappers around the metadata API. Add back compat *_postmeta actions to metadata API. Props jgadbois. see #18196
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-03 16:48:37 +00:00
ryan
496081f898
phpdoc for all_items and menu_name. Props ocean90. fixes #18036
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-07-26 21:31:36 +00:00
ryan
2d148f51de
Fix CPT rewrite generation when turning on permalinks. Props andy. see #18040 for trunk
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-07-15 15:49:42 +00:00
ryan
7a466b9ed9
Unset filter when inserting/updating posts. For trunk
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-28 21:46:18 +00:00
azaozz
f2abed5956
Fix phpdoc for register_post_status(), props aaroncampbell, fixes #17900
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-27 21:22:31 +00:00
ryan
08b6aa116e
Sanitize sort_column and sort_order in get_pages(). Escape search_term in WP_User_Search. Cast blog_id to int in get_blog_prefix(). Props duck_
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-27 20:47:04 +00:00
nacin
2d54db5d7c
Introduce name_admin_bar label and the show_in_admin_bar (Add New menu) argument for post types. Allows for proper translations of these strings and provides for consolidated logic. fixes #16406 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-11 02:20:18 +00:00
markjaquith
856c2742ca
Fix mistaken use of publicly_queryable when public was what was intended. props nacin. fixes #17040
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-10 17:02:03 +00:00
westi
4360343656
Only show Comments are Closed when they are supported.
...
Tidy up the logic to be clearer.
Mark attachements as supporting comments.
Fixes #17568 props duck_
git-svn-id: http://svn.automattic.com/wordpress/trunk@18211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-09 11:12:39 +00:00
ryan
7b1a753fc9
Use array_combine() to avoid a hard-coded copy of the post format slugs. Props mfields. fixes #17576
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-31 19:52:38 +00:00
ryan
b188576030
phpdoc typo fix. Props Caspie. fixes #17616
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-31 15:23:21 +00:00
ryan
c1bb49bb55
Rename duplicate delete_post and deleted_post actions to before_delete_post and after_delete_post. Props scribu. fixes #13731
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@18012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-23 23:43:14 +00:00
ryan
2cfb1592f0
Mark import attachments as private. Schedule job to delete old import attachments. Introduce attachment context.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-22 23:25:28 +00:00
nacin
dfdc7d22a9
Allow get_pages() to take multiple post statuses. see #8592 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-12 03:53:46 +00:00
markjaquith
301be4eeef
Rename submenus to not clash with top level menus. Introduce all_items CPT string, defaulting to menu_name. fixes #17378
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-11 20:09:28 +00:00
nacin
9cb6e158fc
Switch from Panel/SubPanel to Screen in inline documentation and Codex links. props michaelh, fixes #17265 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-28 15:24:49 +00:00
nacin
24ea36e302
Use the post type object in get_posts_by_author_sql() and add a post type parameter to count_many_users_posts(). The formerly somewhat useless and now totally useless pub_priv_sql_capability filter is considered deprecated. fixes #17220 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-28 11:27:39 +00:00
ryan
ed6d0bbd37
Typo fix. Props ocean90, guyn. fixes #17234
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-25 14:33:27 +00:00
nacin
a678aa115a
Fix copypasta typo in docblock. props scribu, fixes #16384 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-23 18:42:59 +00:00
markjaquith
59f5dff476
Correctly handle PATHINFO CPTs and CTs that specify with_front=false. fixes #16807 for trunk
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-10 04:24:48 +00:00
markjaquith
1a7a1d9986
Use with_front properly when creating rules for CPT archive pages. props scribu. fixes #16626 for trunk
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-03-09 05:40:52 +00:00
ryan
3cd43bf6b8
Don't query the post format for post types that don't support formats. Props nacin. fixes #16503 for trunk
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-09 17:13:28 +00:00
markjaquith
57eeed9f3e
Do not use PHP5-only array_combine. props duck_. see #16459 for trunk
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-05 18:46:07 +00:00
markjaquith
7cfc0088d6
No translation for post format slugs. Too fragile for the future. fixes #16459 for trunk
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-05 18:24:01 +00:00
nacin
6423c620f8
Don't allow an empty rewrite slug for CPT. If you need something like this, do rewrite=>false. fixes #15082 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-01-14 15:42:56 +00:00
nacin
adb4f75729
Limit post format queries to the post types registered for the taxonomy. see #16149 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-01-11 18:30:37 +00:00
ryan
85f1feed84
Bring out the shears.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-01-06 04:11:14 +00:00
markjaquith
cc81b6adf0
Funnel unknown values to blank (standard) post format in set_post_format()
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-01-05 22:26:55 +00:00
nacin
e32a14de12
Have menu_name work with show_in_menu = submenu. fixes #14832 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-01-01 00:21:18 +00:00
nacin
84119f6e0b
Correct the docs for register_post_status. fixes #15947 , props simonwheatley.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-26 22:45:34 +00:00
markjaquith
5053c62d64
Translate post format term names on the fly. props mfields. fixes #15899
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-20 21:59:16 +00:00
nacin
0bc42a98cc
Docs for get_post_format_slugs(). props demetris, fixes #15867 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@17073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-20 10:22:06 +00:00
westi
6a69bdd2d5
Allow a plugin to filter our slugs if it wants to. Fixes #15726
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-15 17:56:25 +00:00
ryan
3949ce12d0
Pink trailing whites.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-13 21:21:50 +00:00
ryan
dea20dd26b
s/default/standard/ for post format slug.
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-13 20:50:10 +00:00
nacin
5aafa64e34
Use correct query var. see #15378 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-09 14:23:54 +00:00
nacin
6a83feb219
Remove post_type_supports check from register_post_type caps all together. fixes #14122 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-08 22:07:29 +00:00
markjaquith
c1a0cf30c3
Do not store empty _wp_old_slug values. fixes #15736
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-08 21:22:16 +00:00
markjaquith
298c858c5b
Use is_page_type_hierarchical(). props nacin. see #15140
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-08 21:17:01 +00:00
markjaquith
218867ff3c
Do not do slug logging/redirects for hierarchical post types. see #15140
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-08 21:10:38 +00:00
nacin
0a61447061
Use pagination base for CPT archives. props scribu, fixes #15728 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-08 07:02:52 +00:00
ryan
5ce0d9cb7a
Apply wp_get_attachment_url to empty urls. Props filosofo. fixes #15494
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-07 18:16:21 +00:00
nacin
47cfe8dd05
Post format indexes. First pass. see #15378 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-03 10:13:17 +00:00
nacin
562c038e71
Remove sticky arg from post support. props michaelh, see #12702 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-02 23:16:04 +00:00
markjaquith
e98e5b094b
Missed a s/default/standard/ in [16679]. props PeteMall. see #15582 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-02 04:36:00 +00:00
markjaquith
e7140d23cb
The name of the standard post format is now Standard (might offer ability to change Default). fixes #15582
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-02 03:19:14 +00:00
markjaquith
5b37b224f8
Throw WP_Error if post_type passed to register_post_type() is longer than schema allows. props phrostypoison. fixes #13709
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-01 20:43:39 +00:00
scribu
57d6d72d2f
Remove archaic reference return in get_children(). Props filosofo. Fixes #12372
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-01 20:23:57 +00:00
ryan
1b72cb22a4
Prevent default post formats from entering the DB. see #15629 #15582
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-01 20:03:39 +00:00
ryan
ce490df051
Export filtering. Props duck_. fixes #15197
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-01 17:21:58 +00:00
scribu
2ec0d0509e
Fix 'timeinfo' cache invalidation. Fixes #14922
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-22 21:45:45 +00:00
nacin
69b3167678
Revert [15688], [15689], [15691]. Try again in 3.2. see #14966 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-22 17:17:26 +00:00
nacin
0d56b69953
Add the audio post format, the final format we plan to support. see #14746 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-22 17:05:14 +00:00
markjaquith
8cd425bf92
Use "default" as the key (not "0") for the default post format string in the translation array. props josephscott
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-19 04:32:33 +00:00
nacin
b8ce0261df
More param fixes, props duck_. see #14783 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-18 19:12:48 +00:00
ryan
847499e531
Pinking shears
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-17 18:47:34 +00:00
markjaquith
6482610f9a
esc_textarea() and application for obvious textarea escaping. props alexkingorg. fixes #15454
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-17 17:12:01 +00:00
nacin
e5f944a913
Don't check post_type_supports in map_meta_cap. see #14122 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-17 06:21:34 +00:00
scribu
aa0e750a9f
Update some @since tags. Props demetris. Fixes #15438
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-16 13:16:13 +00:00
nacin
29203134cb
Sanity cast. see #15192 .
...
git-svn-id: http://svn.automattic.com/wordpress/trunk@16389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-15 18:06:57 +00:00