Commit Graph

10431 Commits

Author SHA1 Message Date
Daryl Koopersmith
a9ca915252 Media JS: Improve signature for Workspace.add() to accept two arguments instead of an ambiguous object. see #21390, [21820], [21821].
git-svn-id: http://core.svn.wordpress.org/trunk@21901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 22:41:51 +00:00
Daryl Koopersmith
751ecf9fd5 Ensure the Attachments model properties are correctly set for Query collections.
After shifting sorting and searching logic from the `Query` collection in [21898], it became apparent that `Query` collections should also have an accurate `props` model, as the model controls the aforementioned searching and sorting.

see #21921, #21809, and #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@21900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 22:19:05 +00:00
Bot (Assets)
9481b4ae89 Compress scripts/styles: 3.5-alpha-21899.
git-svn-id: http://core.svn.wordpress.org/trunk@21899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 21:59:34 +00:00
Daryl Koopersmith
380dfbbeab Allow JS Attachments models to be searchable and sortable.
Moves `wp.media.model.Query` sorting and searching to the parent `wp.media.model.Attachments`.

Query parameters are stored in `attachments.props`, which is a `Backbone.Model`, and supports `order` (`'ASC'` or `'DESC'`), `orderby` (any `Attachment` model property name), `search` (a search term), and `query` (a boolean value that ties the `Attachments` collection to the server).

`wp.media.query( args )` now returns an `Attachments` set that is mapped to a `Query` collection instead of the `Query` collection itself. This allows you to change the query arguments by updating `attachments.props` instead of fetching the mirrored arguments, changing them, and passing them to `wp.media.query()` again.

fixes #21921, see #21390, #21809.


git-svn-id: http://core.svn.wordpress.org/trunk@21898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 21:42:29 +00:00
Andrew Nacin
3c4460fc86 Allow wp.uploadFile to upload the attachment to a post. props djzone, josephscott, maxcutler. fixes #13917.
git-svn-id: http://core.svn.wordpress.org/trunk@21896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 19:06:27 +00:00
Bot (Assets)
8892592379 Compress scripts/styles: 3.5-alpha-21895.
git-svn-id: http://core.svn.wordpress.org/trunk@21895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 18:59:37 +00:00
Andrew Nacin
4ea9f01296 Account for the old 'main override' in wp_upload_dir() for the main site in a post-MU network by declining to define the UPLOADS constant.
Fixes uploads on the main site of a post-MU network that uses ms-files rewriting. see #19235.



git-svn-id: http://core.svn.wordpress.org/trunk@21892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 18:07:18 +00:00
Andrew Nacin
095bc8b482 Clarify that conditional tags only return true for existing objects, not 404 situations. props SergeyBiryukov, fixes #16312.
git-svn-id: http://core.svn.wordpress.org/trunk@21890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 17:35:11 +00:00
Andrew Nacin
8fd2fb4998 Synchronize block-level elements between the JS and PHP versions of wpautop. props SergeyBiryukov. fixes #18534.
git-svn-id: http://core.svn.wordpress.org/trunk@21888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-18 17:32:44 +00:00
Andrew Nacin
7d8078a215 Attach the default ms_files_rewriting site option filter in ms-default-constants, as ms-default-filters is not included during SHORTINIT. see #19235.
git-svn-id: http://core.svn.wordpress.org/trunk@21881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-17 22:05:06 +00:00
Bot (Assets)
4a8bb5e3f8 Compress scripts/styles: 3.5-alpha-21879. TinyMCE updated.
git-svn-id: http://core.svn.wordpress.org/trunk@21879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-17 00:59:40 +00:00
Andrew Nacin
57ad8da7d0 On user creation, default the display name to the first and last names provided. props mikelittle for the initial patch. fixes #20637.
git-svn-id: http://core.svn.wordpress.org/trunk@21876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 22:33:24 +00:00
Andrew Ozz
b9d4bd8382 Switch TinyMCE's schema to 'html5', add 'autofocus' to the attributes map for <input>, part props SergeyBiryukov, fixes #13314
git-svn-id: http://core.svn.wordpress.org/trunk@21875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 21:20:35 +00:00
Andrew Nacin
45472e9915 Add a filter to wp_get_update_data. props usermrpapa, SergeyBiryukov. fixes #17838.
git-svn-id: http://core.svn.wordpress.org/trunk@21874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 20:51:51 +00:00
Andrew Nacin
a269ba85f7 If a nav menu has no menu items, print nothing (instead of empty container markup). props obenland. fixes #21576.
git-svn-id: http://core.svn.wordpress.org/trunk@21868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 17:07:56 +00:00
Andrew Nacin
a2b71e7fae Use selected() in default widgets. props SergeyBiryukov, iamfriendly. fixes #21451.
git-svn-id: http://core.svn.wordpress.org/trunk@21867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 16:51:12 +00:00
Andrew Nacin
37537626e3 Don't use hard-coded indexes when dealing with an array of roles. props elyobo. fixes #19222.
git-svn-id: http://core.svn.wordpress.org/trunk@21866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 16:24:33 +00:00
Andrew Nacin
749c06e91f Simplify protocol stripping in add_query_arg() by avoiding a regular expression. Don't cast a known array to an array. fixes #21332.
git-svn-id: http://core.svn.wordpress.org/trunk@21865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-16 16:16:26 +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
2a4fc8952f Split tag names by [\r\n\t ] rather than \s to avoid that character class from eating characters. props rstern, SergeyBiryukov. fixes #21779. see #13413.
git-svn-id: http://core.svn.wordpress.org/trunk@21862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-15 20:13:44 +00:00
Andrew Nacin
4c64b3a4b9 Expect a possible array of post types in get_archive_template(). props SergeyBiryukov. fixes #20867.
git-svn-id: http://core.svn.wordpress.org/trunk@21861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-15 20:07:15 +00:00
Andrew Nacin
7ae797b119 Pass the user parameter to the wpmu_validate_blog_signup filter and wpmu_validate_blog_signup()'s return array. props BrianLayman. fixes #17306.
git-svn-id: http://core.svn.wordpress.org/trunk@21860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-15 20:05:58 +00:00
Andrew Nacin
1beb18d241 Add Pinyin diacritics to remove_accents(). Remove these diacritics in sanitize_title_with_dashes() on save as well. props bolo1988, SergeyBiryukov. fixes #20772.
git-svn-id: http://core.svn.wordpress.org/trunk@21859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-15 20:01:08 +00:00
Andrew Nacin
f431b408da Combine some strings. props pavelevap. fixes #21087.
git-svn-id: http://core.svn.wordpress.org/trunk@21857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-15 19:57:05 +00:00
Andrew Nacin
9ae3bf6fa6 When doing a taxonomy query, search against the currently registered post types of the queried taxonomies.
Prevents posts of a type no longer assigned to a queried taxonomy from being returned.

props jondavidjohn. fixes #21290.



git-svn-id: http://core.svn.wordpress.org/trunk@21855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-15 19:44:51 +00:00
Andrew Nacin
923b3e8e0e Pass current network ID to domain_exists() in wpmu_validate_blog_signup(). props larysa, fixes #17303.
git-svn-id: http://core.svn.wordpress.org/trunk@21853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-15 19:29:59 +00:00
Andrew Nacin
a8a78b8975 "[ ] Discourage search engines from indexing this site". fixes #16416.
git-svn-id: http://core.svn.wordpress.org/trunk@21851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 20:26:20 +00:00
Andrew Nacin
f4c9c9ce0d Use the non-slashing variants of kses functions in sanitize_option() to avoid slash ping pong. fixes #21892.
git-svn-id: http://core.svn.wordpress.org/trunk@21850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 19:32:53 +00:00
Andrew Nacin
7d7498f7ab Don't output the {$post_type} post class in the admin, to avoid clashes with admin CSS. props c3mdigital. fixes #21203.
git-svn-id: http://core.svn.wordpress.org/trunk@21848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 18:57:11 +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
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
Andrew Nacin
aa2fdd48ae Calendar widget: Don't print widget title markup when the title is empty. props jakub.tyrcha. fixes #17837.
git-svn-id: http://core.svn.wordpress.org/trunk@21841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 19:46:24 +00:00
Andrew Nacin
19d165059d Switch $args and $url for the oembed_fetch_url filter introduced in [21839]. A bit more logical, especially given the order of arguments passed to fetch(). see #16996.
git-svn-id: http://core.svn.wordpress.org/trunk@21840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 17:49:23 +00:00
Andrew Nacin
b2b571f4ce Introduce an oembed_fetch_url filter to be applied before sending the request.
props Otto42, r-a-y. fixes #16996.



git-svn-id: http://core.svn.wordpress.org/trunk@21839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 17:45:36 +00:00
Andrew Nacin
8886eef8d9 Add nonce_user_logged_out filters to wp_create_nonce() and wp_verify_nonce() for when there is no user ID. Provides plugins the ability to tie a nonce to some other characteristic of the session. props sc0ttkclark, fixes #21111.
git-svn-id: http://core.svn.wordpress.org/trunk@21837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 17:17:47 +00:00
Andrew Nacin
a42be1dbb3 Check that the taxonomy matches when calling is_tax() with only a taxonomy argument. props wonderboymusic, see #20590.
git-svn-id: http://core.svn.wordpress.org/trunk@21836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 17:15:13 +00:00
Andrew Nacin
2f7bb69ffa Switch to sans-serif for the font stack in Thickbox as we have done elsewhere. props wet, fixes #20268.
git-svn-id: http://core.svn.wordpress.org/trunk@21834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 17:08:01 +00:00
Andrew Nacin
f69fdb6198 Don't sanitize include and exclude in gallery_shortcode(), as this is handled further down the stack, and better. props SergeyBiryukov, TobiasBg. fixes #21827.
git-svn-id: http://core.svn.wordpress.org/trunk@21833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 17:06:25 +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
58e1e69c4b oEmbed uses author_can(), not current_user_can(). props DrewAPicture, fixes #21880.
git-svn-id: http://core.svn.wordpress.org/trunk@21830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 16:42:43 +00:00
Andrew Nacin
94c34141b3 Don't cache a non-existent link in get_bookmark(). props wonderboymusic, fixes #21159.
git-svn-id: http://core.svn.wordpress.org/trunk@21829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 16:41:43 +00:00
Andrew Nacin
f54edf701a When balancing tags, properly close tags that shouldn't be self-closed but are. Support all self-closing tags.
props coffee2code.
fixes #1597.



git-svn-id: http://core.svn.wordpress.org/trunk@21828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-13 16:39:06 +00:00
Andrew Nacin
e4c21210aa Add xmpp to allowed protocols. props ethitter, fixes #21604.
git-svn-id: http://core.svn.wordpress.org/trunk@21826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-12 15:47:34 +00:00
Andrew Nacin
9f6fe3c4ff Don't show Appearance > Widgets if the theme has no sidebars defined. props SergeyBiryukov for the initial patch. fixes #21761.
git-svn-id: http://core.svn.wordpress.org/trunk@21825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-12 02:16:46 +00:00
Andrew Nacin
6a71516a85 XML-RPC: Introduce wp.getUsers, wp.getUser, wp.getProfile, wp.editProfile.
props maxcutler.
props nprasath002 for earlier patches.

see #18428.



git-svn-id: http://core.svn.wordpress.org/trunk@21824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-12 00:04:21 +00:00
Andrew Nacin
dc49f24a6c Remove ms-files.php rewriting from WordPress multisite. fixes #19235.
Keep existing networks compatible with a ms_files_rewriting network option.



git-svn-id: http://core.svn.wordpress.org/trunk@21823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-11 22:22:20 +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