Add missing doc blocks to `post-formats.php`.
Correct some types for `@param` and `@return`. See #32444. Built from https://develop.svn.wordpress.org/trunk@32616 git-svn-id: http://core.svn.wordpress.org/trunk@32586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fd04235a04
commit
4c6d8467e2
|
@ -11,8 +11,8 @@
|
|||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param int|object $post Post ID or post object. Optional, default is the current post from the loop.
|
||||
* @return mixed The format if successful. False otherwise.
|
||||
* @param int|object|null $post Post ID or post object. Optional, default is the current post from the loop.
|
||||
* @return string|false The format if successful. False otherwise.
|
||||
*/
|
||||
function get_post_format( $post = null ) {
|
||||
if ( ! $post = get_post( $post ) )
|
||||
|
@ -36,8 +36,8 @@ function get_post_format( $post = null ) {
|
|||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param string|array $format Optional. The format or formats to check.
|
||||
* @param object|int $post Optional. The post to check. If not supplied, defaults to the current post if used in the loop.
|
||||
* @param string|array $format Optional. The format or formats to check.
|
||||
* @param object|int|null $post Optional. The post to check. If not supplied, defaults to the current post if used in the loop.
|
||||
* @return bool True if the post has any of the given formats (or any format, if no format specified), false otherwise.
|
||||
*/
|
||||
function has_post_format( $format = array(), $post = null ) {
|
||||
|
@ -57,9 +57,9 @@ function has_post_format( $format = array(), $post = null ) {
|
|||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param int|object $post The post for which to assign a format.
|
||||
* @param string $format A format to assign. Use an empty string or array to remove all formats from the post.
|
||||
* @return mixed WP_Error on error. Array of affected term IDs on success.
|
||||
* @param int|object $post The post for which to assign a format.
|
||||
* @param string $format A format to assign. Use an empty string or array to remove all formats from the post.
|
||||
* @return array|WP_Error|false WP_Error on error. Array of affected term IDs on success.
|
||||
*/
|
||||
function set_post_format( $post, $format ) {
|
||||
$post = get_post( $post );
|
||||
|
@ -135,7 +135,7 @@ function get_post_format_string( $slug ) {
|
|||
* @since 3.1.0
|
||||
*
|
||||
* @param string $format The post format slug.
|
||||
* @return string The post format term link.
|
||||
* @return string|WP_Error|false The post format term link.
|
||||
*/
|
||||
function get_post_format_link( $format ) {
|
||||
$term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
|
||||
|
@ -149,6 +149,9 @@ function get_post_format_link( $format ) {
|
|||
*
|
||||
* @access private
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param array $qvs
|
||||
* @return array
|
||||
*/
|
||||
function _post_format_request( $qvs ) {
|
||||
if ( ! isset( $qvs['post_format'] ) )
|
||||
|
@ -167,11 +170,19 @@ function _post_format_request( $qvs ) {
|
|||
*
|
||||
* @access private
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @global WP_Rewrite $wp_rewrite
|
||||
*
|
||||
* @param string $link
|
||||
* @param object $term
|
||||
* @param string $taxonomy
|
||||
* @return string
|
||||
*/
|
||||
function _post_format_link( $link, $term, $taxonomy ) {
|
||||
global $wp_rewrite;
|
||||
if ( 'post_format' != $taxonomy )
|
||||
if ( 'post_format' != $taxonomy ) {
|
||||
return $link;
|
||||
}
|
||||
if ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {
|
||||
return str_replace( "/{$term->slug}", '/' . str_replace( 'post-format-', '', $term->slug ), $link );
|
||||
} else {
|
||||
|
@ -185,6 +196,9 @@ function _post_format_link( $link, $term, $taxonomy ) {
|
|||
*
|
||||
* @access private
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param object $term
|
||||
* @return object
|
||||
*/
|
||||
function _post_format_get_term( $term ) {
|
||||
if ( isset( $term->slug ) ) {
|
||||
|
@ -198,6 +212,11 @@ function _post_format_get_term( $term ) {
|
|||
*
|
||||
* @access private
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param array $terms
|
||||
* @param string|array $taxonomies
|
||||
* @param array $args
|
||||
* @return array
|
||||
*/
|
||||
function _post_format_get_terms( $terms, $taxonomies, $args ) {
|
||||
if ( in_array( 'post_format', (array) $taxonomies ) ) {
|
||||
|
@ -221,6 +240,9 @@ function _post_format_get_terms( $terms, $taxonomies, $args ) {
|
|||
*
|
||||
* @access private
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param array $terms
|
||||
* @return array
|
||||
*/
|
||||
function _post_format_wp_get_object_terms( $terms ) {
|
||||
foreach ( (array) $terms as $order => $term ) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.3-alpha-32615';
|
||||
$wp_version = '4.3-alpha-32616';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue