classes/PodsAPI.php
public function reorder_pod_item( $params ) {

		$params = (object) pods_sanitize( $params );

		// @deprecated 2.0.0
		if ( isset( $params->datatype ) ) {
			pods_deprecated( __( '$params->pod instead of $params->datatype', 'pods' ), '2.0' );

			$params->pod = $params->datatype;

			unset( $params->datatype );
		}

		if ( null === pods_var_raw( 'pod', $params, null, null, true ) ) {
			return pods_error( __( '$params->pod is required', 'pods' ), $this );
		}

		if ( ! is_array( $params->order ) ) {
			$params->order = explode( ',', $params->order );
		}

		$pod = $this->load_pod( array( 'name' => $params->pod, 'table_info' => true ) );

		$params->name = $pod['name'];

		if ( false === $pod ) {
			return pods_error( __( 'Pod is required', 'pods' ), $this );
		}

		foreach ( $params->order as $order => $id ) {
			if ( isset( $pod['fields'][ $params->field ] ) || isset( $pod['object_fields'][ $params->field ] ) ) {
				if ( 'table' === $pod['storage'] && ( ! pods_tableless() ) ) {
					if ( isset( $pod['fields'][ $params->field ] ) ) {
						pods_query( "UPDATE `@wp_pods_{$params->name}` SET `{$params->field}` = " . pods_absint( $order ) . " WHERE `id` = " . pods_absint( $id ) . " LIMIT 1" );
					} else {
						pods_query( "UPDATE `{$pod['table']}` SET `{$params->field}` = " . pods_absint( $order ) . " WHERE `{$pod['field_id']}` = " . pods_absint( $id ) . " LIMIT 1" );
					}
				} else {
					$this->save_pod_item( array(
						'pod'    => $params->pod,
						'pod_id' => $params->pod_id,
						'id'     => $id,
						'data'   => array( $params->field => pods_absint( $order ) )
					) );
				}
			}
		}

		return true;
	}
public function reorder_pod_item( $params ) {

		$params = (object) pods_sanitize( $params );

		// @deprecated 2.0.0
		if ( isset( $params->datatype ) ) {
			pods_deprecated( __( '$params->pod instead of $params->datatype', 'pods' ), '2.0' );

			$params->pod = $params->datatype;

			unset( $params->datatype );
		}

		if ( null === pods_var_raw( 'pod', $params, null, null, true ) ) {
			return pods_error( __( '$params->pod is required', 'pods' ), $this );
		}

		if ( ! is_array( $params->order ) ) {
			$params->order = explode( ',', $params->order );
		}

		$pod = $this->load_pod( array( 'name' => $params->pod, 'table_info' => true ) );

		$params->name = $pod['name'];

		if ( false === $pod ) {
			return pods_error( __( 'Pod is required', 'pods' ), $this );
		}

		foreach ( $params->order as $order => $id ) {
			if ( isset( $pod['fields'][ $params->field ] ) || isset( $pod['object_fields'][ $params->field ] ) ) {
				if ( 'table' === $pod['storage'] && ( ! pods_tableless() ) ) {
					if ( isset( $pod['fields'][ $params->field ] ) ) {
						pods_query( "UPDATE `@wp_pods_{$params->name}` SET `{$params->field}` = " . pods_absint( $order ) . " WHERE `id` = " . pods_absint( $id ) . " LIMIT 1" );
					} else {
						pods_query( "UPDATE `{$pod['table']}` SET `{$params->field}` = " . pods_absint( $order ) . " WHERE `{$pod['field_id']}` = " . pods_absint( $id ) . " LIMIT 1" );
					}
				} else {
					$this->save_pod_item( array(
						'pod'    => $params->pod,
						'pod_id' => $params->pod_id,
						'id'     => $id,
						'data'   => array( $params->field => pods_absint( $order ) )
					) );
				}
			}
		}

		return true;
	}
public function reorder_pod_item ( $ params ) { $ params = ( object ) pods_sanitize ( $ params ) ; // @deprecated 2.0.0 if ( isset ( $ params -> datatype ) ) { pods_deprecated ( __ ( '$params->pod instead of $params->datatype' , 'pods' ) , '2.0' ) ; $ params -> pod = $ params -> datatype ; unset ( $ params -> datatype ) ; } if ( null === pods_var_raw ( 'pod' , $ params , null , null , true ) ) { return pods_error ( __ ( '$params->pod is required' , 'pods' ) , $ this ) ; } if ( ! is_array ( $ params -> order ) ) { $ params -> order = explode ( ',' , $ params -> order ) ; } $ pod = $ this -> load_pod ( array ( 'name' => $ params -> pod , 'table_info' => true ) ) ; $ params -> name = $ pod [ 'name' ] ; if ( false === $ pod ) { return pods_error ( __ ( 'Pod is required' , 'pods' ) , $ this ) ; } foreach ( $ params -> order as $ order => $ id ) { if ( isset ( $ pod [ 'fields' ] [ $ params -> field ] ) || isset ( $ pod [ 'object_fields' ] [ $ params -> field ] ) ) { if ( 'table' === $ pod [ 'storage' ] && ( ! pods_tableless ( ) ) ) { if ( isset ( $ pod [ 'fields' ] [ $ params -> field ] ) ) { pods_query ( "UPDATE `@wp_pods_{$params->name}` SET `{$params->field}` = " . pods_absint ( $ order ) . " WHERE `id` = " . pods_absint ( $ id ) . " LIMIT 1" ) ; } else { pods_query ( "UPDATE `{$pod['table']}` SET `{$params->field}` = " . pods_absint ( $ order ) . " WHERE `{$pod['field_id']}` = " . pods_absint ( $ id ) . " LIMIT 1" ) ; } } else { $ this -> save_pod_item ( array ( 'pod' => $ params -> pod , 'pod_id' => $ params -> pod_id , 'id' => $ id , 'data' => array ( $ params -> field => pods_absint ( $ order ) ) ) ) ; } } } return true ; }
Reorder a Pod

$params['pod'] string The Pod name
$params['field'] string The field name of the field to reorder
$params['order'] array The key => value array of items to reorder (key should be an integer)

@param array $params An associative array of parameters

@return bool

@since 1.9.0
Reorder a Pod