Allow `get_comments_number()` to officially accept `$post` or `$post_id`. Adds unit tests.

Props coffee2code, JanHenkG.
Fixes #26240.


git-svn-id: https://develop.svn.wordpress.org/trunk@28558 602fd350-edb4-49c9-b593-d223f7449a82
Read the `src` attribute for the `[embed]` shortcode if the shortcode's body is empty.

These work:
`[embed src="https://www.youtube.com/watch?v=ZqD-LPOWIT0"]`
`[embed src="https://www.youtube.com/watch?v=ZqD-LPOWIT0"][/embed]`

If you do:
`[embed src="https://www.youtube.com/watch?v=ZqD-LPOWIT0"]http://any-other-url.com[/embed]`

... "http://any-other-url.com" will be the URL that is parsed.

Props kovshenin, aaroncampbell for making initial patches.
Fixes #24456.



git-svn-id: https://develop.svn.wordpress.org/trunk@28559 602fd350-edb4-49c9-b593-d223f7449a82
Truly check for `! empty()` instead of falsey `''` when determining whether to add `LIMIT` clause to SQL in `wp_get_archives()`.

Props jjeaton for the initial patch.
Fixes #27834.


git-svn-id: https://develop.svn.wordpress.org/trunk@28560 602fd350-edb4-49c9-b593-d223f7449a82
In `get_terms_to_edit()`, call `get_object_term_cache()` before priming cache with `wp_get_object_terms()`.

In `get_inline_data()`, do the same.

On list table screens with taxonomies in the admin, this dramatically reduces the number of database queries (3x less). Even more so with a persistent object cache (5x less).

Props johnbillion, jeffstieler, wonderboymusic.
Fixes #18968.



git-svn-id: https://develop.svn.wordpress.org/trunk@28561 602fd350-edb4-49c9-b593-d223f7449a82
When adding queries to `tax_query`: if the query's `field` is `term_taxonomy_id`, don't require `taxonomy` to be specified. In `WP_Tax_Query::transform_query()`, `$query['taxonomy']` is never checked for the 'term_taxonomy_id' `case` because 'term_taxonomy_id' is the primary key being looked up.

Adds unit tests.

Props helen.
Fixes #25284.



git-svn-id: https://develop.svn.wordpress.org/trunk@28562 602fd350-edb4-49c9-b593-d223f7449a82
Replaces all uses of `TEMPLATEPATH` and `STYLESHEETPATH` in core with `get_template_directory()` and `get_stylesheet_directory()`.

Add `@deprecated` annotations to `TEMPLATEPATH` and `STYLESHEETPATH` definitions.

Props obenland, aaroncampbell. 
Fixes #18298.


git-svn-id: https://develop.svn.wordpress.org/trunk@28563 602fd350-edb4-49c9-b593-d223f7449a82
`wp_dropdown_pages()` allows `option_none_value` to be passed. Add that arg to the `$defaults` for `wp_dropdown_users()` and `wp_dropdown_categories()` as well.

Props solarissmoke. 
Fixes #16625.


git-svn-id: https://develop.svn.wordpress.org/trunk@28564 602fd350-edb4-49c9-b593-d223f7449a82
wpView: fix selecting a view's text string in Safari, props gcorne, fixes #28088

git-svn-id: https://develop.svn.wordpress.org/trunk@28565 602fd350-edb4-49c9-b593-d223f7449a82
Add unit tests for functions in `wp-includes/category.php`.

Props mdbitz. 
Fixes #28119.


git-svn-id: https://develop.svn.wordpress.org/trunk@28566 602fd350-edb4-49c9-b593-d223f7449a82
In `media_sideload_image()`, check the returned value of `download_url()` earlier to avoid attempting to `unlink()` an instance of `WP_Error`.

Props georgestephanis. 
Fixes #28204.


git-svn-id: https://develop.svn.wordpress.org/trunk@28567 602fd350-edb4-49c9-b593-d223f7449a82
Merge branch 'master' of https://github.com/tierra/wordpress