Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/wordads/php
File: class-wordads-formats.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WordAds Formats Class file.
[2] Fix | Delete
*
[3] Fix | Delete
* This file contains the definition of the WordAds_Formats class, which handles
[4] Fix | Delete
* determining the appropriate WordAds format slug based on ad slot dimensions.
[5] Fix | Delete
*
[6] Fix | Delete
* @package automattic/jetpack
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
declare( strict_types = 1 );
[10] Fix | Delete
[11] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[12] Fix | Delete
exit( 0 );
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* Class WordAds_Formats
[17] Fix | Delete
*
[18] Fix | Delete
* Set of WordAds methods working with formats and Ad dimensions.
[19] Fix | Delete
*/
[20] Fix | Delete
class WordAds_Formats {
[21] Fix | Delete
/**
[22] Fix | Delete
* Determine the WordAds format based on the ad dimensions.
[23] Fix | Delete
*
[24] Fix | Delete
* @param int $width The width of the ad slot.
[25] Fix | Delete
* @param int $height The height of the ad slot.
[26] Fix | Delete
*
[27] Fix | Delete
* @return string WordAds Format enum.
[28] Fix | Delete
*/
[29] Fix | Delete
public static function get_format_slug( int $width, int $height ): string {
[30] Fix | Delete
if ( $width === 300 && $height === 250 ) {
[31] Fix | Delete
return 'gutenberg_rectangle';
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
if ( $width === 728 && $height === 90 ) {
[35] Fix | Delete
return 'gutenberg_leaderboard';
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
if ( $width === 320 && $height === 50 ) {
[39] Fix | Delete
return 'gutenberg_mobile_leaderboard';
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
if ( $width === 160 && $height === 600 ) {
[43] Fix | Delete
return 'gutenberg_skyscraper';
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
return '';
[47] Fix | Delete
}
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function