Commit Graph

408 Commits

Author SHA1 Message Date
Andrew Nacin
1b0a4561a4 Use correct variable. props picklewagon. fixes #22394.
git-svn-id: http://core.svn.wordpress.org/trunk@22476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-09 00:16:30 +00:00
Andrew Nacin
039279db28 Only call wp_get_object_terms() if get_object_term_cache() says there is no cache (false), which is different than no terms. props wonderboymusic, fixes #16505.
git-svn-id: http://core.svn.wordpress.org/trunk@22433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 20:00:51 +00:00
Andrew Nacin
711f6f2619 Treat a single taxonomy passed as an array the same as when passed as a string in get_terms(). props wonderboymusic, fixes #17955.
git-svn-id: http://core.svn.wordpress.org/trunk@22417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 09:03:40 +00:00
Jon Cave
391ff2f639 Fix documentation typo: s/WP_Erorr/WP_Error/. See #21593.
git-svn-id: http://core.svn.wordpress.org/trunk@22309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-25 22:29:37 +00:00
Ryan Boren
28461df188 Return WP_Error when registering a taxonomy that exceeds 32 characters.
Props ocean90.
fixes #21593


git-svn-id: http://core.svn.wordpress.org/trunk@22307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-25 22:12:02 +00:00
Ryan Boren
77518e9c71 Objects no longer need to be explicitly passed by ref to call_user_func*() to be callable. Props wonderboymusic. fixes #21865
git-svn-id: http://core.svn.wordpress.org/trunk@22118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-04 20:00:16 +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
3c2b9a6901 An empty taxonomy query should return no results rather than all posts. Props wonderboymusic. fixes #20604
git-svn-id: http://core.svn.wordpress.org/trunk@22109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-04 13:16:47 +00:00
Andrew Nacin
557d9313a7 Introduce constants to allow for easier expression of time periods in seconds. Adds MINUTE_IN_SECONDS, HOUR_IN_SECONDS, DAY_IN_SECONDS, WEEK_IN_SECONDS, YEAR_IN_SECONDS. props nbachiyski, SergeyBiryukov. fixes #20987.
git-svn-id: http://core.svn.wordpress.org/trunk@21996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-25 05:26:19 +00:00
Andrew Nacin
d80d004b10 Don't repeatedly call get_object_taxonomies() in clean_object_term_cache(). see #11399.
git-svn-id: http://core.svn.wordpress.org/trunk@21951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-22 15:21:30 +00:00
Ryan Boren
df21fa1cc6 Pass a term object to the delete_term actions. Props bigdawggi. fixes #20645
git-svn-id: http://core.svn.wordpress.org/trunk@21939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-21 13:27:56 +00:00
Andrew Nacin
8203ef4905 Make WP_Tax_Query::transform_query() public. props scribu. fixes #21684.
git-svn-id: http://core.svn.wordpress.org/trunk@21863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-15 20:17:03 +00:00
Andrew Nacin
e728ad3a1e Update docs to reflect that wp_count_terms() can return WP_Error when the taxonomy does not exist. props SergeyBiryukov, fixes #21888.
git-svn-id: http://core.svn.wordpress.org/trunk@21843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 16:11:30 +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
1af8c36086 Allow easy registration of taxonomy columns on post (and custom post type) list table screens.
To register a column for a list table, use the new manage_taxonomies_for_{$post_type}_columns
filter. Introduces show_admin_column => true for register_taxonomy(), which automatically
displays that column on all associated post types.

props jtsternberg, SergeyBiryukov for initial patches.
fixes #21240.



git-svn-id: http://core.svn.wordpress.org/trunk@21788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-08 03:18:36 +00:00
Ryan Boren
2b47dd4afe Return WP_Error if the db insert in wp_set_object_terms() fails. Props jndetlefsen. fixes #21800
git-svn-id: http://core.svn.wordpress.org/trunk@21766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-05 17:57:53 +00:00
Andrew Nacin
5a9193d6c9 Validate $order in wp_get_object_terms(). props duck_.
git-svn-id: http://core.svn.wordpress.org/trunk@21758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-05 01:23:53 +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
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
9eeccc2230 Add term_taxonomy_id field handling to WP_Tax_Query::transform_query(), allowing the transformation to be bypassed when tt ids are passed.
props wonderboymusic.
fixes #21228.



git-svn-id: http://core.svn.wordpress.org/trunk@21552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-20 16:49:21 +00:00
Andrew Nacin
84c3a86036 Hide the link manager from the UI on upgrade, if the site has no links. New DB option, link_manager_enabled.
Enforce this by denying the 'manage_links' capability, which hides the All Links, Add New Link, and Link Categories screens. Hide WP_Widget_Links and the UI for the default_link_category as well.

Convert all references to 'posts and links' when handling reassignment on user deletion to just 'posts'.

see #21307.



git-svn-id: http://core.svn.wordpress.org/trunk@21501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-13 16:18:42 +00:00
ryan
eaa419dba3 Consolodate some strings. Props pavelevap. fixes #20809
git-svn-id: http://core.svn.wordpress.org/trunk@20972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-01 19:05:30 +00:00
nacin
2243e45a43 Add view_item to the phpdoc for get_taxonomy_labels(). props Caspie. fixes #20406.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-11 20:08:30 +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
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
duck_
8ac3015ccf Stop invalid SQL syntax by bailing from wp_get_object_terms() if $object_ids or $taxonomies is empty. Props batmoo. Fixes #19952.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-21 20:20:50 +00:00
duck_
ecdac4be4f Taxonomy rewrite generation when turning on permalinks, r18443 for taxonomies. Props SergeyBiryukov. Fixes #19794.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-15 17:30:37 +00:00
duck_
312e1f1811 Post formats should show_in_nav_menus when the current theme supports them. Props filosofo, nacin. Fixes #16390.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-08 17:12:02 +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
774e51c04c Correct logic inversion. #19275.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-23 20:10:01 +00:00
nacin
0c224cd82c Clean up and better document create_initial_taxonomies(). see #19275.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-23 19:58:26 +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
ryan
2b44b1a244 Update register_taxonomy_for_object_type() phpdoc to reflect that the post_type must be a string only, no arrays allowed. Props transom. fixes #19795
git-svn-id: http://svn.automattic.com/wordpress/trunk@19730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-11 21:39:01 +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
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
85304c2dc7 Introduce term_is_ancestor_of(). Finish taxonomy support for wp_insert_category(). Props garyc40. fixes #15581
git-svn-id: http://svn.automattic.com/wordpress/trunk@19678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-04 22:44:19 +00:00
nacin
03d21f6606 term_exists() @return correction. props johnbillion, fixes #19565.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-16 20:56:14 +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
ryan
39dc973965 Avoid undefined index notices. Props SergeyBiryukov, valendesigns. fixes #18455
git-svn-id: http://svn.automattic.com/wordpress/trunk@19077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-28 19:52:14 +00:00
nacin
28e10d8f2b Remove duplicate word in docs. props SergeyBiryukov, fixes #18986.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-25 16:07:14 +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
975c670f15 Update the update_count_callback docs. see #18986.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-21 21:50:36 +00:00
nacin
38921762a3 No need to specify an update_count_callback for categories or tags, as the default handler for them will now be _update_post_term_count(). see #18986, [19035].
git-svn-id: http://svn.automattic.com/wordpress/trunk@19036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-21 21:46:03 +00:00
nacin
463bfd9fe5 Separate non-post term counting from _update_post_term_count(). Introduce _update_generic_term_count(). The generic handler will be the default whenever the taxonomy is attached to an object type other than a post type (link, user). Otherwise the _update_post_term_count() handler will be the default. fixes #18986. see #17548.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-21 21:38:14 +00:00
ryan
791b424c31 Typo fix. Props SergeyBiryukov. see #18986
git-svn-id: http://svn.automattic.com/wordpress/trunk@19031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-20 21:41:54 +00:00
ryan
5bfc91f5ee Fix term counting for links. Props SergeyBiryukov. fixes #18986
git-svn-id: http://svn.automattic.com/wordpress/trunk@19025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-20 14:28:26 +00:00
ryan
ec7afa90a1 Call wp_update_term_count() only for those terms that have been added to or removed from the object. Props jeremyclarke. fixes #18631
git-svn-id: http://svn.automattic.com/wordpress/trunk@18999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-18 21:01:55 +00:00
nacin
89c0895887 new does not require by reference.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-18 20:20:59 +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