Opened 4 months ago
Last modified 3 days ago
#48303 new task (blessed)
Docblock improvements for 5.4
| Reported by: |  | Owned by: | |
|---|---|---|---|
| Milestone: | 5.4 | Priority: | normal | 
| Severity: | normal | Version: | |
| Component: | General | Keywords: | |
| Focuses: | docs | Cc: | |
| PR Number: | 
Attachments (6)
Change History (89)
    
      
    #2
  
    
        
          
             @
 @
            
4 months ago
        
    
  
  
    
wp_enqueue_script, wp_enqueue_style, wp_register_script and wp_register_style parameter $deps could be narrowed from array to string[].
    
      
    #3
  
    
        
          
             @
 @
            
4 months ago
        
    
  
  
    
wp_unslash parameter and return value could be narrowed from string|array to string|string[].
    
      
         
        
This ticket was mentioned in Slack in #docs by atachibana. View the logs.
      
      
4 months ago
    
    
  
              
    
    
        
          
             @
 @
            
3 months ago
        
    
  
  
  
Docs: Moved the @link tag for Customize API in WP_Customize_Manager::add_setting() and WP_Customize_Setting
    
      
    #33
  
        in reply to:
    ↑ 26
        ;
          follow-up:
    ↓ 34
    
        
          
             @
 @
            
3 months ago
        
    
  
  
    
Replying to Marcio Zebedeu:
Can you please confirm? I had my doubts about naming patch.
Thanks for the patches! However, [46647] and [46691] are changesets, not tasks. These are changes that are already committed and generally don't require additional patches, unless you notice a typo or any other inaccuracy :)
    
      
    #34
  
        in reply to:
    ↑ 33
    
        
          
             @
 @
            
3 months ago
        
    
  
  
    
Replying to SergeyBiryukov:
Replying to Marcio Zebedeu:
Can you please confirm? I had my doubts about naming patch.
Thanks for the patches! However, [46647] and [46691] are changesets, not tasks. These are changes that are already committed and generally don't require additional patches, unless you notice a typo or any other inaccuracy :)
Oh...thank. I'm still learning :) 
    
      
    #71
  
    
        
          
             @
 @
            
3 weeks ago
        
    
  
  
    
Hi, I started by looking at the function get_the_post_thumbnail and its parameter $size, which is currently of the type string|array. I think this could be narrowed down to string|int[] by examining its source and all the functions and hooks it calls. As such, I think these functions and hooks could have their parameter $size narrowed in the same way. The ones I encountered:
Functions:
- get_the_post_thumbnail
- wp_get_attachment_image
- wp_get_attachment_image_src
- image_downsize
- image_get_intermediate_size
- image_constrain_size_for_editor
Hooks:
- begin_fetch_post_thumbnail_html
- end_fetch_post_thumbnail_html
- wp_get_attachment_image_src
- image_downsize
- image_get_intermediate_size
- editor_max_image_size
However, I'm pretty sure there are more.
    
      
    #74
  
    
        
          
             @
 @
            
2 weeks ago
        
    
  
  
    
Hi, OK, thanks.
6 more functions that can have parameters narrowed:
- is_pagecan have parameter narrowed to- int|string|int[]|string[]
- is_singlecan have parameter narrowed to- int|string|int[]|string[]
- is_singularcan have parameter narrowed to- string|string[]
- WP_Query::is_pagecan have parameter narrowed to- int|string|int[]|string[]
- WP_Query::is_singlecan have parameter narrowed to- int|string|int[]|string[]
- WP_Query::is_singularcan have parameter narrowed to- string|string[]
Partially covered by #48354



 
			 
                
I didn't know about this tracking ticket for all the small docs issues, so I created a lot of small ones (sorry...)