Scott Taylor
42bcec5061
Introduce a function, wp_attachment_is( $type, $post = 0 )
, to collapse the logic for determining whether an attachment is an image
, audio
, or video
.
...
This is admittedly a first pass. There needs to be a generic handler for when any other type is passed, but for now it accepts the whitelist.
See #25275 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31645 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 20:25:09 +00:00
Drew Jaynes
340fa25658
Properly indent the hash notation of default arguments for wp_page_menu()
.
...
See #28841 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31600 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-02 06:15:36 +00:00
Sergey Biryukov
757fd2c1e4
Always pass back the custom classes get_post_class()
was called with, even if the post was not found.
...
props F J Kaiser, Bueltge.
fixes #22271 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31408 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 03:59:06 +00:00
Drew Jaynes
475337bd97
Adjust the DocBlock for wp_dropdown_pages()
to mark the entire $args
parameter array as optional instead of each individual argument.
...
See #12494 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31356 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 08:55:52 +00:00
Drew Jaynes
53209f19b3
Add documentation for the $value_field
argument added to wp_dropdown_pages()
in [31338].
...
See #12494 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31355 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-06 08:50:20 +00:00
Boone Gorges
c9c9af5df8
Introduce 'value_field'
parameter to wp_dropdown_pages()
.
...
This parameter allows developers to choose the post field that will be used to
fill in the 'option' attribute of the generated dropdown markup.
See [31006] #30306 for a parallel enhancement in `wp_dropdown_categories()`.
Props jfarthing84.
Fixes #12494 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31338 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 19:03:52 +00:00
Boone Gorges
a710c0451c
Use hash notation for wp_dropdown_pages()
argument documentation.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@31337 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-05 18:59:22 +00:00
Boone Gorges
8ec0792557
Add classes for custom taxonomy terms in get_post_class()
.
...
Props sillybean.
Fixes #16223 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31271 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-23 15:40:31 +00:00
Scott Taylor
6fd11624d1
The keyword elseif
should be used instead of else if
so that all control keywords look like single words.
...
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs.
See #30799 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31090 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-08 07:04:40 +00:00
Scott Taylor
44fe0ebf75
Correct the @param
docs for arguments that are truthy/falsey.
...
See #30799 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30983 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-20 23:03:21 +00:00
Mark Jaquith
93ea9862a5
Revert [30036].
...
see #18035
git-svn-id: https://develop.svn.wordpress.org/trunk@30912 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-16 17:34:17 +00:00
Drew Jaynes (DrewAPicture)
205a43ed05
Correctly capitalize JavaScript throughout core docs.
...
Fixes #30569 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30695 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-02 00:30:59 +00:00
Scott Taylor
4de850c8ff
Improve the @param
docs for src/wp-includes/post*.php
.
...
See #30224 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30671 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-30 22:37:00 +00:00
Drew Jaynes (DrewAPicture)
76699122d0
Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.
...
Affects DocBlocks for the following core elements:
* Backtick-escape HTML tags in several argument descriptions for `wp_link_pages()`
* Remove an HTML tag from the summary for `prepend_attachment()`
* Backtick-escape inline code in the description for `get_extended()`
* Backtick-escape inline code in the description for `get_post_type_labels()`
* Various markdown formatting in the description for `add_rewrite_endpoint()`
* Markdown-indent a code snippet in the file header for wp-includes/shortcodes.php
* Markdown-indent code snippets in the description for `add_shortcode()
Props rarst.
See #30473 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30545 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-24 06:14:03 +00:00
Scott Taylor
03b49d8f88
Check $_current_page
before using it in Walker_Page->start_el()
.
...
Props jeremyfelt.
Fixes #26901 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30157 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-01 20:28:40 +00:00
Drew Jaynes (DrewAPicture)
3cc10d77a0
Remove redundant and erroneous @uses
tag from most core inline documentation.
...
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.
Fixes #30191 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30105 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-30 01:04:55 +00:00
Dominik Schilling (ocean90)
15af3fdaa8
Improve body class for page templates.
...
* Convert slash to dash too.
* Add sub-folder name as a separate body class.
* New classes are additional classes, old syntax will persists for BC.
With this `/page-templates/full-width.php` will produce `page-template`, `page-template-page-templates`, `page-template-full-width` and `page-template-page-templatesfull-width-php`.
props obenland, Caspie, donutz.
fixes #23470 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30100 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-29 22:19:08 +00:00
Sergey Biryukov
b1c3d5eccc
Don't add 'sticky' class in get_post_class() if 'ignore_sticky_posts' query var is set.
...
props jakub.tyrcha, johneckman.
fixes #18035 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30036 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-27 02:15:35 +00:00
John Blackbourn
b92307f58d
In wp_link_pages()
, only output link separators between actual pagination links. Fixes #24940 . Props obenland.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@30030 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-26 22:40:07 +00:00
Scott Taylor
076c7e8902
Add a 6th (!) attribute to wp_get_attachment_link()
to allow aria-describedby
to be added to gallery output.
...
Props joedolson, DrewAPicture, rianrietveld.
Fixes #27402 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29914 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 04:27:07 +00:00
wonderboymusic
0b7342e906
MediaElement upgrade: cleanup for generated markup for videos.
...
See #29110 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29429 602fd350-edb4-49c9-b593-d223f7449a82
2014-08-07 05:52:03 +00:00
Sergey Biryukov
fad9723a42
Revert [28963].
...
see #28006 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29235 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-19 00:25:46 +00:00
Drew Jaynes (DrewAPicture)
01350ad5a7
Convert default arguments documentation for wp_page_menu()
into a hash notation.
...
Props coffee2code for the initial patch/
See #28841 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29112 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-11 23:12:42 +00:00
Sergey Biryukov
4b9c7b3e1d
Add 'status-sticky' class in get_post_class() for sticky posts in the admin.
...
props mordauk, netweb.
fixes #22590 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29003 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-05 00:12:46 +00:00
Drew Jaynes (DrewAPicture)
b1b454c7a0
Remove backticks on $post
variables in some short parameter descriptions.
...
See [28653], [28654].
See #28388 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28976 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-03 19:27:54 +00:00
John Blackbourn
53f98b80b7
Prepend "Draft:" to draft post titles when previewing on the front end, and add a "single-status-$status" class to the body classes for all post statuses. Fixes #28006 . Props hlashbrooke
...
git-svn-id: https://develop.svn.wordpress.org/trunk@28963 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-02 22:52:31 +00:00
Scott Taylor
dcd7ff837d
Use the WPINC
constant when loading class-phpass.php
...
Props wojtek.szkutnik
See #14157 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28903 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-29 22:11:44 +00:00
Drew Jaynes (DrewAPicture)
1388b15b67
Re-document default arguments in wp_link_pages()
using the hash-notation style.
...
Props taylorde.
Fixes #28680 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28899 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-29 18:55:45 +00:00
Scott Taylor
54d4f34ad2
If the get_the_excerpt()
is called out of bounds of a global $post
, return ''.
...
Fixes #22413 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28880 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-28 04:00:27 +00:00
Scott Taylor
b4c75b8ab1
Check for the existence of $post
before using it in get_the_ID()
. Return false
if it doesn't exist.
...
Props UmeshSingla.
Fixes #17034 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28844 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-26 02:04:38 +00:00
Sergey Biryukov
abddfc4b99
Prevent get_post_class() and get_body_class() from returning duplicate classes.
...
props Compute.
fixes #28541 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28760 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-17 15:17:36 +00:00
Sergey Biryukov
88e8720018
Use get_pages() instead of a raw SQL query in get_body_class().
...
fixes #28159 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28696 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-07 03:21:46 +00:00
Drew Jaynes (DrewAPicture)
d068c888f3
Ensure $post_id
is documented as optional where applicable.
...
See #28388 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28654 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-03 04:43:47 +00:00
Drew Jaynes (DrewAPicture)
9bb9177199
Make sure $post
is properly documented as optional where applicable.
...
See #28388 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28653 602fd350-edb4-49c9-b593-d223f7449a82
2014-06-03 03:52:46 +00:00
Sergey Biryukov
90a40a07a1
Pass $post to 'protected_title_format' and 'private_title_format' filters.
...
props johnjamesjacoby, DrewAPicture.
fixes #23724 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28571 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-24 06:47:55 +00:00
Scott Taylor
f716ff94e4
Add missing access modifiers to methods/members in Walker
and subclasses. Add a magic __get()
method.
...
See #27881 , #22234 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28514 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 05:59:07 +00:00
Drew Jaynes (DrewAPicture)
f228c5b16e
Improve inline documentation of default arguments for the_title_attribute()
.
...
See #28298 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28498 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 02:27:08 +00:00
Scott Taylor
f116de6203
Set @param
back to $output
, not $html
, in the inline filter docs. This was a copy/paste mistake.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28419 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 05:07:18 +00:00
Scott Taylor
61faf32275
Eliminate use of extract()
in Walker_Page::start_el()
.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28402 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 01:40:48 +00:00
Scott Taylor
c96d4a94b9
Eliminate use of extract()
in wp_list_pages()
which, surprisingly, didn't even use any of the extracted variables.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28401 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 01:21:20 +00:00
Scott Taylor
e4a800238f
Eliminate use of extract()
in wp_dropdown_pages()
.
...
Adds unit tests to: `tests/post/template.php`.
There was previously only one wimpy assertion for `wp_dropdown_pages()`.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28399 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 01:11:21 +00:00
Scott Taylor
21e0370e5c
Eliminate use of extract()
in wp_link_pages()
.
...
Adds unit tests to a new file: `tests/post/template.php`.
There were previously no unit tests for `wp_link_pages()`.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28398 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 00:43:40 +00:00
Scott Taylor
ba8e36f94c
Eliminate use of extract()
in the_title_attribute()
.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28383 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-13 04:47:11 +00:00
Drew Jaynes (DrewAPicture)
cb5852a813
Add inline documentation of the default arguments for wp_list_pages()
.
...
Props garza for the initial patches.
Fixes #11338 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28357 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-10 08:01:13 +00:00
Scott Taylor
11e65eb200
In wp_get_attachment_link()
, $post_title
is set and then not used.
...
See #27882 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28331 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-06 21:34:10 +00:00
Sergey Biryukov
ece95a0257
Prevent 'paged-*' from being added to body classes on 404 error pages.
...
props psoluch.
see #16468 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28249 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-04 13:16:13 +00:00
Scott Taylor
f17d9491b1
Fix a regression caused by [27622] in prepend_attachment()
by passing all attachments that are not audio or video to the else
clause.
...
Fixes #27634 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27908 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-02 17:13:09 +00:00
Scott Taylor
09c4928cf7
In wp_list_pages()
, add the current_page_item
class where applicable when used with a custom post type.
...
Adds a unit test.
Props nacin.
Fixes #17590 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27755 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-26 22:46:16 +00:00
Scott Taylor
54bc81e04f
Do not use the alternative if/elseif/else syntax in prepend_attachment()
introduced in [27622], as per kovshenin.
...
Fixes #27243 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27682 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 14:38:31 +00:00
Drew Jaynes (DrewAPicture)
73fe2abadd
Inline documentation for hooks in wp-includes/post-template.php.
...
Props Toru and kpdesign.
Fixes #25621 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27676 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 03:36:36 +00:00