* Set post_count and found_posts for all 'fields' queries.
* Set found_posts to post_count when limits are not used
* Update phpdoc for $found_posts and set_found_posts()
Props SergeyBiryukov, wonderboymusic
fixes#14426
git-svn-id: http://core.svn.wordpress.org/trunk@21928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Introduce a wp_checkdate() function with a single filter to centralise the code that validates dates.
* Improve the error message
* Correctly handle the return value of wp_insert_post which is not always a WP_Error on failure
Fixes#17180
git-svn-id: http://core.svn.wordpress.org/trunk@21922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously you could quite easily send a new post into the back of beyond by specifying an invalid date like the 30th Feb and this was very confusing.
Sometimes it would seem to work and sometimes the post would end up very far in the past - depending on the mysql version and other factors.
Fixes#17180 props jkudish.
git-svn-id: http://core.svn.wordpress.org/trunk@21921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Adds `view.Workspace.Library` and `view.Workspace.Gallery` as extensions of `view.Workspace` to implement the individual screens
* Shifts the toolbar logic that was library-specific from the generic `Workspace` view to `Workspace.Library`.
* Adds a toolbar to the `Gallery` view.
* 'Create a gallery' and 'Return to media library' buttons toggle between the two views.
* 'Insert gallery into post' closes the modal, but does not actually perform its namesake action.
* Note that elements can still be deselected in the gallery view. This will be fixed in a future commit.
Improvements to avoid over-eager event unbinding:
* `Modal` views now properly detach their contents before replacing them with a new element.
* Likewise, `Workspace` views detach their main content blocks when re-rendering the view.
To test the gallery workflow (which is incomplete), run the following in your browser's console:
`wp.media({ multiple: true });`
see #21809, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
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
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
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
* Will be replaced with http://wordpress.org/extend/plugins/atom-publishing-protocol/.
* Introduces an action, xmlrpc_rsd_apis, to add APIs to xmlrpc.php?rsd.
* Introduces support for 'error' being 403 and 50x in class-wp.php.
* Removes 'Remote Publishing' from Writing Settings (see [21804]). Keeps the remote_publishing settings section.
DB version is bumped to generate the new wp-app rewrite rule and remove the old enable_app option.
props wonderboymusic.
fixes#21509.
git-svn-id: http://core.svn.wordpress.org/trunk@21818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Moves the uploading Attachments queue from the media workspace view to the uploader itself. This ensures that all attachments are added to the central attachmnet store.
Updates wp.Uploader to pass Attachment models to callbacks instead of Plupload file objects. Attachments in the process of uploading have a reference to the file object (which can be fetched by calling `attachment.get('file');`).
Also updates the customizer to be compatible with the API changes.
git-svn-id: http://core.svn.wordpress.org/trunk@21814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These per-page values were when the post type or taxonomy name has a hyphen.
Previously, these were converted to underscores. This changed in [21322].
fixes#18958.
git-svn-id: http://core.svn.wordpress.org/trunk@21811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
props markoheijnen for the initial patch.
Introduces a new filter, xmlrpc_enabled.
Respects any current callbacks registered to the pre_option_enable_xmlrpc
and option_enable_xmlrpc filters, for anyone forcing it off via code.
fixes#21509.
git-svn-id: http://core.svn.wordpress.org/trunk@21804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Remove explicit declarations of class, id, style, and title from $allowedposttags
* Dynamicallly add global attributes to every tag for the 'post' context
* No longer calls wp_kses_array_lc() every time wp_kses() runs. Instead it runs once if CUSTOM_TAGS is true. Plugins directly passing a custom allowed_html array will no longer get the lc treatment. Keep an eye out for problems with this.
* wp_kses_data() and wp_filter_kses() pass current_filter() for the $allowed_html argument to wp_kses().
* wp_kses_allowed_html() handles being passed a filter name for a context. If the filter is not a recognized one it defaults to using $allowedtags as was done before for wp_kses_data() and wp_filter_kses().
* wp_kses_allowed_html() recognizes user_description and pre_user_description out of the box. For these it takes $allowedtags and inserts rel attribute support.
* wp_kses_allowed_html() allows plugins to override the return values for the default contexts and support arbitrary contexts via a wp_kses_allowed_html filter.
* wp_kses_hook() can now pass a string context for $allowed_html to the pre_kses filter. We might have to pass the result of wp_kses_allowed_html() instead if it turns out that plugins are digging in $allowed_html.
fixes#17977
see #20210
git-svn-id: http://core.svn.wordpress.org/trunk@21790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
Browsers natively support dragging img elements, which would then set off the drop zone in the modal. We disable this by setting the draggable attribute to false.
git-svn-id: http://core.svn.wordpress.org/trunk@21785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This allows us to automatically retain selections when the library context is changed (e.g. when searching. This changes the Attachment view's select() and deselect() methods so that they can be triggered directly.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates the featured image when the publish/update button is clicked (rather than instantly). Uses the existing post_thumbnail_meta_box() function. Does not remove the old featured image meta box JS, ajax handler, or CSS.
see #21776, #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Currently uses actions for inserting media into a post as an example (hence the raw text). To test a workflow that supports multiple selection, run the following in your browser's JavaScript console:
wp.media({ multiple: true });
see #21390, #21808.
git-svn-id: http://core.svn.wordpress.org/trunk@21769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Make the $post argument to get_post() optional, defaulting to the current post in The Loop.
Props nacin
see #21309
git-svn-id: http://core.svn.wordpress.org/trunk@21735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
to avoid a parse error in a PHP4 environment (caused by use of
the clone keyword in option.php).
Manually include functions.php in the rare situations where it
is not already included by the time we need to load translations
early.
Remove the functions.php dependency by switching the wp_die() calls
to die(), in wp_check_php_mysql_versions().
props SergeyBiryukov, see #21316, for trunk.
git-svn-id: http://core.svn.wordpress.org/trunk@21715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removal of this stopped pagination working for bare category URLs when
certain %category% based permalink structures were in used.
Reverts one more piece of [19737]. Props SergeyBiryukov. See #21209.
git-svn-id: http://core.svn.wordpress.org/trunk@21705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[20539] removed string casts that would have taken place on SimpleXMLElement
objects, which implement toString. Instead, convert the SimpleXMLElement object
to a stdClass object before we leave _parse_xml(), for consistency with the
simple object returned from _parse_json().
see #20246.
for trunk.
git-svn-id: http://core.svn.wordpress.org/trunk@21701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This will be the main entry point for basic media development, and should hopefully help less experienced developers wrangle the new media APIs.
If you would like to see the new UI, navigate to the post editor and run the following in your browser's Javascript console:
wp.media();
Well, that certainly feels a lot nicer to type.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
We use the 'date' attribute to create Javascript Date objects. The Date() constructor has better cross-browser compatibility when numeric arguments are passed to the constructor.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Rename watch() and unwatch() to observe() and unobserve(), respectively, to avoid conflicts with Firefox's proprietary Object.prototype.watch method.
Rename validate() to validator(), and changed() to validate(), as the latter will be more frequently used, and better explains its purpose. Also, make the new validate() more concise.
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change is_*_admin() to reference in_admin() with fallback to the WP_*_ADMIN constants during early bootstrap. This allows unit tests and ajax handlers to set the admin context.
fixes#21742
git-svn-id: http://core.svn.wordpress.org/trunk@21687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This filter has wrapped the network-wide themes, outside of the network-wide
allowed function (dating back to MU), hence the unusual placement. This restores
previous behavior; we will introduce new filters to enable greater flexibility.
see #21099.
for trunk.
git-svn-id: http://core.svn.wordpress.org/trunk@21686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Please note that this commit does not integrate media into the existing UI. If you would like to see the new UI, navigate to the post editor and run the following in your browser's Javascript console:
new wp.media.controller.Workflow().render().modal.open();
The Javascript is broken up into two files, with the slugs media-models and media-views.
* media-models: The models are UI agnostic, and can be used independent of the views. If you'd like to create custom UIs, this is the script for you.
* media-views: This is the Media Experience. The views (and controllers) depend on the models (which are listed as a dependency and will automatically be included thanks to wp_enqueue_script). The views also require the media templates, media-view styles, and the plupload bridge settings. Perhaps we should create a function to include the whole shebang, but in the meantime...
To include media-views in the admin, run the following PHP in or after 'admin_enqueue_scripts':
wp_enqueue_script( 'media-views' );
wp_enqueue_style( 'media-views' );
wp_plupload_default_settings();
add_action( 'admin_footer', 'wp_print_media_templates' );
see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduce wp_send_json_success() and wp_send_json_error(), which will allow us to fire appropriate done() or fail() callbacks in JS.
props koopersmith. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@21679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds Tooltip, Menu, and Spinner.
Autocomplete depends on Menu.
Renames Effects files.
1.9 final is expected next week.
see #21736.
git-svn-id: http://core.svn.wordpress.org/trunk@21657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since a plugin can load a previous (< 1.3) version of SimplePie before we do,
we need to be compatible with our old method of overriding SimplePie_Cache::create().
SimplePie_Cache::create() was converted to static in 1.3 (as it was called),
requiring that we create two different definitions of WP_Feed_Cache (extends
SimplePie_Cache). Instead, we can use 1.3's new object registry, and leave
the old WP_Feed_Cache to SimplePie 1.2 versions.
see #21183.
git-svn-id: http://core.svn.wordpress.org/trunk@21652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Any plugin wishing to use jQuery color animations must set jquery-color as a dependency
(or enqueue it).
Remove the un-minified version of jQuery Color.
props scribu.
fixes#21692.
git-svn-id: http://core.svn.wordpress.org/trunk@21646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Uses individual files for each class. We now conditionally load only the pieces
we need, resulting in less memory usage. Also easier to maintain now that it is
not a single 387KB file.
fixes#21183.
git-svn-id: http://core.svn.wordpress.org/trunk@21644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
Continue to register them, pulling from ajax.googleapis.com. This is only being done for backwards compatibility;
libraries in use will continue to be local sources.
In the process, update to the latest versions of Prototype (1.7.1, June 5) and script.aculo.us (1.9.0, from 2010).
props helenyhou.
fixes#21661, #16664, #16665.
git-svn-id: http://core.svn.wordpress.org/trunk@21593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* This moves our "development" versions from .dev.js to .js (same for css).
* The compressed version then moves from .js to .min.js (same for css).
By switching to the standard .min convention, it sets expectations for developers,
and works nicely with existing tools such as ack.
fixes#21633.
git-svn-id: http://core.svn.wordpress.org/trunk@21592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This allows for a custom comment status to be queried directly overriding the status argument.
See #21101 props nbachiyski.
git-svn-id: http://core.svn.wordpress.org/trunk@21570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This provides nearly the same benefits without possibly receiving a stale object from get_userdata(),
which could affect authentication, and introduce side effects for plugins.
see #21120.
git-svn-id: http://core.svn.wordpress.org/trunk@21563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These magic methods allow us to mark properties as protected or private, without breaking compatibility, as they were once accessible. The joys of PHP4.
fixes#18510.
git-svn-id: http://core.svn.wordpress.org/trunk@21512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes a warning introduced in [21472] when calling mysql_free_result() was moved to flush().
fixes#20838.
git-svn-id: http://core.svn.wordpress.org/trunk@21511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
wp-includes/admin-bar.php:
* Replace get_admin_url() and get_home_url() with admin_url() and home_url() and place them inside a switch/restore. Likewise replace current_user_can_for_blog() with current_user_can(). This avoids doing multiple switch restores.
wp-includes/ms-blogs.php:
* Deprecate the $validate argument to switch_to_blog(). This avoids a not very necessary call to get_blog_details(), possibly saving a few queries.
* Use $_wp_switched and $_wp_switched_stack instead of $switched and $switched_stack to make it less likely these globals will be stomped.
* Use GLOBALS to access blog_id and other globals. I've preferred this style lately since it makes it obvious a global is being used and avoids global blog_id being stomped by a local variable.
* Lose some is_object() checks. wp_get_current_user() always returns an object, for example.
* Call the new WP_Roles::reinit() method.
wp-includes/class-wp-xmlrpc-server.php:
* Replace current_user_can_for_blog() with current_user_can() and move it inside the switch/restore pair. This eliminates a switch/restore.
wp-includes/capabilities.php:
* Use array_keys() instead of $role => $data since $data is unused. I *think* this is a bit faster.
* Introduce WP_Roles::reinit(). This reinitializes WP_Roles and is used after switch_to_blog() has already update the blog ID in the wpdb object. If a global roles array is being used instead of the db, reinit is skipped.
* current_user_can_for_blog() now does a switch/restore. It didn't before meaning it could be reinitializing the user with the wrong role information for the current blog.
wp-includes/ms-settings.php:
* Define $_wp_switched_stack and $_wp_switched. This way switch_to_blog() and restore_current_blog() can rely on it being set.
wp-settings.php:
* Instantiate the WP_Roles global. This was it is always defined during init. To remove the WP_Roles checks from WP_Role and WP_User this would probably have to move before plugins are loaded, which might not be a good thing.
wp-includes/functions.php:
* Update wp_upload_dir() to reference _wp_switched.
git-svn-id: http://core.svn.wordpress.org/trunk@21485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These properties, while protected, are still accessible thanks to the magic getter added in [21472].
props pento, nvartolomei, joelhardi. fixes#18510.
git-svn-id: http://core.svn.wordpress.org/trunk@21473 1a063a9b-81f0-0310-95a4-ce76da25c4cd