ID ) ) { return $fields; } $current_position = get_post_meta( $post->ID, 'wpthumb_crop_pos', true ); if ( ! $current_position ) { $current_position = 'center,center'; } $html = ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= '
'; $fields['crop-from-position'] = array( 'label' => __( 'Crop Position', 'wpthumb' ), 'input' => 'html', 'html' => $html ); return $fields; } /** * wpthumb_media_form_crop_position_save function. * * Saves crop position in post meta. * * @access public * * @param array $post * @param array $attachment * @return $post */ function wpthumb_media_form_crop_position_save( $post, $attachment ) { if ( ! isset( $attachment['wpthumb_crop_pos'] ) ) { return; } if ( $attachment['wpthumb_crop_pos'] == 'center,center' ) { delete_post_meta( $post['ID'], 'wpthumb_crop_pos' ); } else { update_post_meta( $post['ID'], 'wpthumb_crop_pos', $attachment['wpthumb_crop_pos'] ); } return $post; }