• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Jetpack_Photon_ImageSizes::standardize_size_data() – Standardises and validates the size_data array.

You appear to be a bot. Output may be restricted

Description

Standardises and validates the size_data array.

Usage

$array = Jetpack_Photon_ImageSizes::standardize_size_data( $size_data );

Parameters

$size_data
( array ) required – Size data array – at least containing height or width key. Can contain crop as well.

Returns

array Array with populated width, height and crop keys; empty array if no width and height are provided.

Source

File name: jetpack/_inc/lib/class.jetpack-photon-image-sizes.php
Lines:

1 to 14 of 14
  public function standardize_size_data( $size_data ) {
    $has_at_least_width_or_height = ( isset( $size_data['width'] ) || isset( $size_data['height'] ) );
    if ( ! $has_at_least_width_or_height ) {
      return array();
    }

    $defaults = array(
      'width'  => null,
      'height' => null,
      'crop'   => false,
    );

    return array_merge( $defaults, $size_data );
  }
 

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

Published: 27 November 2019 | Last updated: 27 November 2019

Primary Sidebar

Information

Function name: Jetpack_Photon_ImageSizes::standardize_size_data
Class ref: Jetpack_Photon_ImageSizes
Plugin ref: Jetpack
Version: 9.2
Sourcefile: _inc/lib/class.jetpack-photon-image-sizes.php
File ref: _inc/lib/class.jetpack-photon-image-sizes.php
Deprecated?: No
API Letters: I,J,P,S

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites