• 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_og_get_image_validate_size() – Validate the width and height against required width and height

You appear to be a bot. Output may be restricted

Description

Validate the width and height against required width and height

Usage

$bool = _jetpack_og_get_image_validate_size( $width, $height, $req_width, $req_height );

Parameters

$width
( int ) required – Width of the image.
$height
( int ) required – Height of the image.
$req_width
( int ) required – Required width to pass validation.
$req_height
( int ) required – Required height to pass validation.

Returns

bool True if the image passed the required size validation

Source

File name: jetpack/functions.opengraph.php
Lines:

1 to 11 of 11
function _jetpack_og_get_image_validate_size( $width, $height, $req_width, $req_height ) {
  if ( ! $width || ! $height ) {
    return false;
  }

  $valid_width         = ( $width >= $req_width );
  $valid_height        = ( $height >= $req_height );
  $is_image_acceptable = $valid_width && $valid_height;

  return $is_image_acceptable;
}
 

 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_og_get_image_validate_size
Plugin ref: Jetpack
Version: 11.0
Sourcefile: functions.opengraph.php
File ref: functions.opengraph.php
API type: private
Deprecated?: No
API Letters: _,G,I,J,O

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 6.0
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-2022. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites