mirror of
git://develop.git.wordpress.org/
synced 2025-02-06 23:50:43 +01:00
Docs: Miscellaneous DocBlock corrections.
See #53399. git-svn-id: https://develop.svn.wordpress.org/trunk@52242 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cb67c52be2
commit
37abb3a470
@ -138,7 +138,7 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
|
||||
// Enable page scrolling.
|
||||
$( 'body' ).removeClass( 'modal-open' );
|
||||
|
||||
// Hide the modal element by adding display none.
|
||||
// Hide the modal element by adding display:none.
|
||||
this.$el.hide();
|
||||
|
||||
/*
|
||||
|
@ -1194,8 +1194,10 @@ function download_url( $url, $timeout = 300, $signature_verification = false ) {
|
||||
$tmpfname_disposition = '';
|
||||
}
|
||||
|
||||
// Potential file name must be valid string
|
||||
if ( $tmpfname_disposition && is_string( $tmpfname_disposition ) && ( 0 === validate_file( $tmpfname_disposition ) ) ) {
|
||||
// Potential file name must be valid string.
|
||||
if ( $tmpfname_disposition && is_string( $tmpfname_disposition )
|
||||
&& ( 0 === validate_file( $tmpfname_disposition ) )
|
||||
) {
|
||||
if ( rename( $tmpfname, $tmpfname_disposition ) ) {
|
||||
$tmpfname = $tmpfname_disposition;
|
||||
}
|
||||
|
@ -3056,7 +3056,8 @@ function rest_default_additional_properties_to_false( $schema ) {
|
||||
* @since 5.5.0
|
||||
*
|
||||
* @param int|WP_Post $post Post ID or post object.
|
||||
* @return string The route path with a leading slash for the given post, or an empty string if there is not a route.
|
||||
* @return string The route path with a leading slash for the given post,
|
||||
* or an empty string if there is not a route.
|
||||
*/
|
||||
function rest_get_route_for_post( $post ) {
|
||||
$post = get_post( $post );
|
||||
@ -3089,7 +3090,8 @@ function rest_get_route_for_post( $post ) {
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @param string $post_type The name of a registered post type.
|
||||
* @return string The route path with a leading slash for the given post type, or an empty string if there is not a route.
|
||||
* @return string The route path with a leading slash for the given post type,
|
||||
* or an empty string if there is not a route.
|
||||
*/
|
||||
function rest_get_route_for_post_type_items( $post_type ) {
|
||||
$post_type = get_post_type_object( $post_type );
|
||||
@ -3122,7 +3124,8 @@ function rest_get_route_for_post_type_items( $post_type ) {
|
||||
* @since 5.5.0
|
||||
*
|
||||
* @param int|WP_Term $term Term ID or term object.
|
||||
* @return string The route path with a leading slash for the given term, or an empty string if there is not a route.
|
||||
* @return string The route path with a leading slash for the given term,
|
||||
* or an empty string if there is not a route.
|
||||
*/
|
||||
function rest_get_route_for_term( $term ) {
|
||||
$term = get_term( $term );
|
||||
|
@ -9,7 +9,7 @@
|
||||
/**
|
||||
* Class Mock_Invokable.
|
||||
*
|
||||
* This class is using to mock a class that has __invoke method.
|
||||
* This class is used to mock a class that has an `__invoke` method.
|
||||
*/
|
||||
class Mock_Invokable {
|
||||
|
||||
|
@ -38,14 +38,6 @@ class Spy_REST_Server extends WP_REST_Server {
|
||||
$this->sent_headers[ $header ] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores last set status.
|
||||
* @param int $code HTTP status.
|
||||
*/
|
||||
public function set_status( $status ) {
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a header from the list of sent headers.
|
||||
*
|
||||
@ -55,6 +47,15 @@ class Spy_REST_Server extends WP_REST_Server {
|
||||
unset( $this->sent_headers[ $header ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores last set status.
|
||||
*
|
||||
* @param int $code HTTP status.
|
||||
*/
|
||||
public function set_status( $status ) {
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides the dispatch method so we can get a handle on the request object.
|
||||
*
|
||||
|
@ -88,7 +88,7 @@ class Tests_Admin_IncludesFile extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers ::download_url
|
||||
*
|
||||
* @param $filter A callback containing a fake Content-Disposition header.
|
||||
* @param $filter A callback containing a fake Content-Disposition header.
|
||||
*/
|
||||
public function test_download_url_should_respect_filename_from_content_disposition_header( $filter ) {
|
||||
add_filter( 'pre_http_request', array( $this, $filter ), 10, 3 );
|
||||
@ -174,7 +174,7 @@ class Tests_Admin_IncludesFile extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers ::download_url
|
||||
*
|
||||
* @param $filter A callback containing a fake Content-Disposition header.
|
||||
* @param $filter A callback containing a fake Content-Disposition header.
|
||||
*/
|
||||
public function test_download_url_should_reject_filename_from_invalid_content_disposition_header( $filter ) {
|
||||
add_filter( 'pre_http_request', array( $this, $filter ), 10, 3 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user