Commit Graph

652 Commits

Author SHA1 Message Date
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