Commit Graph

11 Commits

Author SHA1 Message Date
Scott Taylor 8977166746 In `wp_insert_post()`, when setting `$post_author`, use `isset()` instead of `! empty()` to allow `0` to be passed as the value for `$post_author`.
Adds unit tests.

Props ericdaams, wonderboymusic.
Fixes #32585.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 18:54:25 +00:00
Scott Taylor 5a21742a6f `wp_delete_post()`: add a filter, 'pre_delete_post', to allow bailout from the function if the filter returns a non-null value.
Props boonebgorges.
Fixes #32933.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 15:59:24 +00:00
Scott Taylor 891b76e034 `sanitize_post()`: the default value for `$context` is 'display'. The documentation says the default for `sanitize_post_field()` is 'display', but there is no default for the arg. Make the argument: `$context = 'default'`.
Props morganestes.
Fixes #33117.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 15:46:25 +00:00
Scott Taylor 0b412d3333 `sanitize_post()` is polymorphic, add an `is_array()` check for `$post` before operating on it as an array.
Props morganestes.
Fixes #33118.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 15:38:27 +00:00
Scott Taylor 47409875ab In `get_page_uri()`, do not add parent slugs to orphaned pages.
Adds unit test.

Props filosofo, MikeHansenMe, MikeHansenMe, chriscct7.
Fixes #15963. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@33970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 16:54:24 +00:00
Scott Taylor c1bb5b5ce3 After [33843], update the location of some files in `This filter is documented in` docs
Props dimadin.
See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-08 22:17:26 +00:00
Sergey Biryukov 0424d962e1 Update the parameter docs for `wp_add_post_tags()`, `wp_set_post_tags()`, and `wp_set_post_terms()`.
Props johnbillion.
Fixes #33749.
Built from https://develop.svn.wordpress.org/trunk@33931


git-svn-id: http://core.svn.wordpress.org/trunk@33900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-06 00:12:26 +00:00
John Blackbourn 9e6f9a5d93 Function docs for the `tax_input` and `meta_input` parameters available for `wp_insert_post()`.
See #20451

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


git-svn-id: http://core.svn.wordpress.org/trunk@33891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-05 21:02:24 +00:00
Scott Taylor 102a8aecf8 Allow `wp_insert_post()` to accept a `meta_input` argument. Devs should use `register_meta()` to ensure that specific values specified by key are sanitized properly.
Adds unit test.

Props CoenJacobs, swissspidy.
Fixes #20451.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-05 19:50:24 +00:00
Sergey Biryukov 4e77ffdee1 In `get_post_type_labels()`, ensure that filtered labels contain all required default values.
fixes #33543.
Built from https://develop.svn.wordpress.org/trunk@33776


git-svn-id: http://core.svn.wordpress.org/trunk@33744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-28 03:39:21 +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