get_header_dimensions example

if ( $_POST['oitar'] > 1 ) {
            $_POST['x1']     = $_POST['x1'] * $_POST['oitar'];
            $_POST['y1']     = $_POST['y1'] * $_POST['oitar'];
            $_POST['width']  = $_POST['width'] * $_POST['oitar'];
            $_POST['height'] = $_POST['height'] * $_POST['oitar'];
        }

        $attachment_id = absint( $_POST['attachment_id'] );
        $original      = get_attached_file( $attachment_id );

        $dimensions = $this->get_header_dimensions(
            array(
                'height' => $_POST['height'],
                'width'  => $_POST['width'],
            )
        );
        $height     = $dimensions['dst_height'];
        $width      = $dimensions['dst_width'];

        if ( empty( $_POST['skip-cropping'] ) ) {
            $cropped = wp_crop_image(
                $attachment_id,
                
Home | Imprint | This part of the site doesn't use cookies.