/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/* Add your custom styles here */

// Adicionar novo tamanho de thumbnail para post_type receitas

function custom_thumbnail_sizes() {    
	add_image_size('TWPX_v3:4_150x200', 150, 200, true);
	add_image_size('TWPX_v3:4_280x373', 280, 373, true);
    add_image_size('TWPX_v3:4_400x533', 400, 533, true);    
	add_image_size('TWPX_v3:4_577x768', 577, 768, true);
	add_image_size('TWPX_v3:4_901x1200', 901, 1200, true);
	
	add_image_size('TWPX_h3:2_200x133', 200, 133, true);
	add_image_size('TWPX_h3:2_375x250', 375, 250, true);
    add_image_size('TWPX_h3:2_533x355', 533, 355, true);    
	add_image_size('TWPX_h3:2_768x512', 768, 512, true);
	add_image_size('TWPX_h3:2_1200x800', 1200, 800, true);
	
	add_image_size('TWPX_h_1140x250', 1140, 250, true);
}

add_action( 'after_setup_theme', 'custom_thumbnail_sizes' );

// Ativar novo tamanho de thumbnail na interface de edição de mídia
function custom_thumbnail_sizes_choose( $sizes ) {
    $custom_sizes = array(
   	'TWPX_v3:4_150x200'  => 'v3:4_150x200',
	'TWPX_v3:4_280x373'  => 'v3:4_280x373',		
	'TWPX_v3:4_400x533'  => 'v3:4_400x533',
	'TWPX_v3:4_577x768'  => 'v3:4_577x768',
	'TWPX_v3:4_901x1200'  => 'v3:4_901x1200',
	
	'TWPX_h3:2_200x133'  => 'h3:2_200x133',
    'TWPX_h3:2_375x250'  => 'h3:2_375x250',		
	'TWPX_h3:2_533x355'  => 'h3:2_533x355',
	'TWPX_h3:2_768x512'  => 'h3:2_768x512',
	'TWPX_h3:2_1200x800'  => 'h3:2_1200x800',	
	
	'TWPX_h_1140x250'  => 'h_1140x250',
    );
    return array_merge( $sizes, $custom_sizes );
}
add_filter( 'image_size_names_choose', 'custom_thumbnail_sizes_choose' );
