su/config/crop_ratios

The shortcodes-ultimate su/config/crop ratios hook.

Published Date - February 15, 2021

Description

return apply_filters(
	'su/config/crop_ratios',
	array(
		'21:9'  => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'21:9'
		),
		'16:9'  => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'16:9'
		),
		'16:10' => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'16:10'
		),
		'5:4'   => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'5:4'
		),
		'4:3'   => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'4:3'
		),
		'3:2'   => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'3:2'
		),
		'2:1'   => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'2:1'
		),
		'1:1'   => sprintf(
			'[%s] %s',
			__( 'Square', 'shortcodes-ultimate' ),
			'1:1'
		),
		'1:2'   => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'1:2'
		),
		'2:3'   => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'2:3'
		),
		'3:4'   => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'3:4'
		),
		'4:5'   => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'4:5'
		),
		'10:16' => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'10:16'
		),
		'9:16'  => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'9:16'
		),
		'9:21'  => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'9:21'
		),
	)
);

Parameters

  1. $array, 21:9), 16:9 => sprintf, 16:9), 16:10 => sprintf, 16:10), 5:4 => sprintf, 5:4), 4:3 => sprintf, 4:3), 3:2 => sprintf, 3:2), 2:1 => sprintf, 2:1), 1:1 => sprintf, 1:1), 1:2 => sprintf, 1:2), 2:3 => sprintf, 2:3), 3:4 => sprintf, 3:4), 4:5 => sprintf, 4:5), 10:16 => sprintf, 10:16), 9:16 => sprintf, 9:16), 9:21 => sprintf, 9:21))


Usage

The following example is for adding a hook callback.

// define the su/config/crop_ratios callback 
function custom_su_config_crop_ratios( $array, 21:9), 16:9 => sprintf, 16:9), 16:10 => sprintf, 16:10), 5:4 => sprintf, 5:4), 4:3 => sprintf, 4:3), 3:2 => sprintf, 3:2), 2:1 => sprintf, 2:1), 1:1 => sprintf, 1:1), 1:2 => sprintf, 1:2), 2:3 => sprintf, 2:3), 3:4 => sprintf, 3:4), 4:5 => sprintf, 4:5), 10:16 => sprintf, 10:16), 9:16 => sprintf, 9:16), 9:21 => sprintf, 9:21)) ){ 
   //custom code here
    return $array, 21:9), 16:9 => sprintf, 16:9), 16:10 => sprintf, 16:10), 5:4 => sprintf, 5:4), 4:3 => sprintf, 4:3), 3:2 => sprintf, 3:2), 2:1 => sprintf, 2:1), 1:1 => sprintf, 1:1), 1:2 => sprintf, 1:2), 2:3 => sprintf, 2:3), 3:4 => sprintf, 3:4), 4:5 => sprintf, 4:5), 10:16 => sprintf, 10:16), 9:16 => sprintf, 9:16), 9:21 => sprintf, 9:21))
} 

//add the action 
add_filter('su/config/crop_ratios', 'custom_su/config/crop_ratios', 10, 1)

Defined

The filter is defined in the following location(s).

shortcodes-ultimate/includes/config/crop-ratios.php

return apply_filters(
	'su/config/crop_ratios',
	array(
		'21:9'  => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'21:9'
		),
		'16:9'  => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'16:9'
		),
		'16:10' => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'16:10'
		),
		'5:4'   => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'5:4'
		),
		'4:3'   => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'4:3'
		),
		'3:2'   => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'3:2'
		),
		'2:1'   => sprintf(
			'[%s] %s',
			__( 'Landscape', 'shortcodes-ultimate' ),
			'2:1'
		),
		'1:1'   => sprintf(
			'[%s] %s',
			__( 'Square', 'shortcodes-ultimate' ),
			'1:1'
		),
		'1:2'   => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'1:2'
		),
		'2:3'   => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'2:3'
		),
		'3:4'   => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'3:4'
		),
		'4:5'   => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'4:5'
		),
		'10:16' => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'10:16'
		),
		'9:16'  => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'9:16'
		),
		'9:21'  => sprintf(
			'[%s] %s',
			__( 'Portrait', 'shortcodes-ultimate' ),
			'9:21'
		),
	)
);