ดูขนาดของรูป – get_intermediate_image_sizes

ปกติแล้ว WordPress เริ่มต้นขนาดของรูปจะมี 4 แบบด้วยกัน คือ thumbnail, medium, medium_large, large

function get_intermediate_image_sizes() {
    $default_sizes    = array( 'thumbnail', 'medium', 'medium_large', 'large' );
    $additional_sizes = wp_get_additional_image_sizes();
 
    if ( ! empty( $additional_sizes ) ) {
        $default_sizes = array_merge( $default_sizes, array_keys( $additional_sizes ) );
    }
 
    /**
     * Filters the list of intermediate image sizes.
     *
     * @since 2.5.0
     *
     * @param string[] $default_sizes An array of intermediate image size names. Defaults
     *                                are 'thumbnail', 'medium', 'medium_large', 'large'.
     */
    return apply_filters( 'intermediate_image_sizes', $default_sizes );
}

สามารถแก้ไขขนาดได้ที่เมนู Settinds > Media

Leave a Reply

Your email address will not be published. Required fields are marked *