Mark Jaquith
ec527ab07d
Clear the get_pages cache whenever ANY hierarchical post type cache is cleared — not just Pages. fixes #21279
...
git-svn-id: https://develop.svn.wordpress.org/trunk@21286 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-20 04:35:51 +00:00
Mark Jaquith
5ab7fcea5e
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: https://develop.svn.wordpress.org/trunk@21219 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-05 20:51:55 +00:00
Andrew Nacin
d1270f0d77
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: https://develop.svn.wordpress.org/trunk@21213 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-05 19:21:57 +00:00
Andrew Nacin
a9643d617a
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: https://develop.svn.wordpress.org/trunk@21177 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-29 13:57:02 +00:00
Jon Cave
ab22e8ed87
get_post_stati() returns post statuses not types. Props jeremyfelt. Fixes #20664 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20779 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-13 07:41:47 +00:00
Ryan Boren
9b8b0bffac
Collect intermediate images before deleting an attachment and its meta. Fixes thumbnail deletion. Props SergeyBiryukov. fixes #20658
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20770 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-11 18:47:32 +00:00
Ryan Boren
0de14403bf
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: https://develop.svn.wordpress.org/trunk@20739 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-08 17:01:50 +00:00
Ryan Boren
a38242a366
phpdoc updates for register_post_type(). Props jeremyfelt. fixes #20622
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20734 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-07 16:25:06 +00:00
Ryan Boren
76c1cad16a
phpdoc fix for register_post_status(). Props yoavf. fixes #20616
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20726 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-05 19:04:34 +00:00
Andrew Nacin
5f902262d1
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: https://develop.svn.wordpress.org/trunk@20613 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-27 16:08:58 +00:00
Jon Cave
83a3cc73df
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: https://develop.svn.wordpress.org/trunk@20569 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-23 22:04:35 +00:00
Jon Cave
7953f9e753
Fix typo and terminology in Twenty Eleven's header template. Props JarretC. Fixes #20442 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20465 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-14 19:02:04 +00:00
Ryan Boren
d1100bacb4
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: https://develop.svn.wordpress.org/trunk@20453 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-12 18:49:48 +00:00
Andrew Nacin
1909f3fbeb
Use the metadata API rather than raw queries and direct do_action calls. see #20417 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20435 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-11 20:02:39 +00:00
Ryan Boren
27592057cd
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: https://develop.svn.wordpress.org/trunk@20423 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-10 16:09:44 +00:00
Andrew Nacin
54a6a40533
Introduce $wpdb->delete(). props justindgivens, scribu. fixes #18948 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20287 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-24 15:24:31 +00:00
Peter Westwood
a42caf87b4
XMLRPC: Add new wp.getPostType and wp.getPostTypes apis. See #18436 props maxcutler, markoheijnen and nprasath002.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20271 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-23 17:53:14 +00:00
Ryan Boren
83604c7fbb
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: https://develop.svn.wordpress.org/trunk@20216 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-19 19:09:03 +00:00
Jon Cave
3790d70d28
Use return value of update_post_meta() in set_post_thumbnail() instead of always returning true. Props webord. Fixes #20218 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20172 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-14 09:48:57 +00:00
Ryan Boren
1a41092158
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: https://develop.svn.wordpress.org/trunk@20171 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-12 18:23:48 +00:00
Peter Westwood
157ffb3f85
XMLRPC: Expose the extended more text to XMLRPC clients from metaWeblog.getPost(). Fixes #10933 props koke, ericmann.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20156 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-08 12:50:21 +00:00
Andrew Nacin
11fd4b45c0
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: https://develop.svn.wordpress.org/trunk@20075 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-02 18:56:54 +00:00
Jon Cave
cafa8dab24
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: https://develop.svn.wordpress.org/trunk@20023 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 20:29:33 +00:00
Ryan Boren
2c83196cff
Update phpdoc for wp_mime_type_icon(). Props SergeyBiryukov, mitchoyoshitaka. fixes #16604
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19924 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-14 18:12:01 +00:00
Ryan Boren
021c55798e
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: https://develop.svn.wordpress.org/trunk@19918 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-14 15:09:35 +00:00
Andrew Nacin
52838cbf4d
Docs, see ##19882.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19910 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-10 22:49:56 +00:00
Andrew Nacin
c8f498046f
Allow get_post_meta() to be called with only a post ID, as get_metadata() handles this. props scribu, fixes #19882 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19908 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-10 22:42:54 +00:00
Jon Cave
dd9c09eff5
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: https://develop.svn.wordpress.org/trunk@19906 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-10 22:00:37 +00:00
Andrew Nacin
092808ead8
Allow localized commas to be used as tag separators. see #7897 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19853 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-07 18:06:12 +00:00
Jon Cave
6a7fe5b25c
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: https://develop.svn.wordpress.org/trunk@19779 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-28 21:00:59 +00:00
Andrew Nacin
838bb8c0c5
s/parem/param/. props Latz. fixes #19823 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19744 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-24 21:52:49 +00:00
Andrew Nacin
05d413f123
Args is an object, not an array. props duck_, aaroncampbell. see #19275 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19740 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-23 19:32:39 +00:00
Andrew Nacin
8900888567
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: https://develop.svn.wordpress.org/trunk@19738 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-23 19:12:04 +00:00
Jon Cave
d2306a693b
Update hierarchy for all hierarchical post types when deleting a parent post, not just for pages. Fixes #19637 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19734 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-13 18:37:46 +00:00
Ryan Boren
285247786e
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: https://develop.svn.wordpress.org/trunk@19729 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-11 21:26:18 +00:00
Jon Cave
148329fecb
Rewrite rules don't need to be flushed on every page save/delete as they're no longer verbose. Fixes #19636 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19727 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-10 22:55:38 +00:00
Jon Cave
156048ca52
split was deprecated in PHP 5.3.0, so use explode instead. Props garyc40. Fixes #16325 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19726 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-09 21:20:51 +00:00
Ryan Boren
2b186b0c45
Lose EOF ?>. Clean up EOF newlines. fixes #12307
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19712 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-08 17:01:11 +00:00
Jon Cave
760471a9a8
Fix mistakes in parameter documentation and add some missing param docs. See #19756 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19702 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-06 18:31:43 +00:00
Ryan Boren
5e76729992
One newline is enough.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19684 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-05 20:10:39 +00:00
Ryan Boren
0f2274ee75
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: https://develop.svn.wordpress.org/trunk@19675 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-04 19:45:13 +00:00
Ryan Boren
676ba7043e
Use one space, not two, after trailing punctuation. fixes #19537
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19593 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-13 23:45:31 +00:00
Dion Hulse
d70ddc49f9
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: https://develop.svn.wordpress.org/trunk@19444 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-24 00:20:21 +00:00
Andrew Nacin
88b1b11435
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: https://develop.svn.wordpress.org/trunk@19305 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-15 21:19:29 +00:00
Jon Cave
9c824b6687
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: https://develop.svn.wordpress.org/trunk@19283 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-14 21:32:56 +00:00
Dion Hulse
522f890c32
Fix typo in [19231]. See #17579
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19234 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-09 22:13:35 +00:00
Andrew Nacin
f3ba249747
Check post type and bail earlier in wp_get_attachment_url(). props mitchoyoshitaka, fixes #17579 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19231 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-09 19:20:33 +00:00
Andrew Nacin
057afbb44b
Don't set post_type QV in _post_format_request() when we're in the admin. props ethitter. fixes #18475 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19193 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-06 21:15:23 +00:00
Jon Cave
479b59bdb0
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: https://develop.svn.wordpress.org/trunk@19117 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-02 17:06:34 +00:00
Ryan Boren
4399cf7610
Avoid E_STRICT notices. see #18975
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19094 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-31 19:38:46 +00:00