Permalink
Browse files

Save data for taxonomy, to be followed up with in Pods::save

  • Loading branch information...
sc0ttkclark committed Apr 25, 2012
1 parent ecdb15a commit cdd2ea78e7b3665c3f894f1d3d1720d771f706ee
Showing with 7 additions and 2 deletions.
  1. +7 −2 classes/PodsMeta.php
View
@@ -170,9 +170,14 @@ public function save_taxonomy ( $term_id, $term_taxonomy_id, $taxonomy ) {
if ( !isset( self::$taxonomies[ $taxonomy ][ 'name' ] ) )
return false;
- $pod = $this->api->load_pod( array( 'name' => self::$taxonomies[ $taxonomy ]['name'] ) );
+ $pod = $this->api->load_pod( array( 'name' => self::$taxonomies[ $taxonomy ][ 'name' ] ) );
$item = pods( $pod[ 'name' ], $term_id );
- // @todo Save values to PodsAPI
+ $data = array();
+ foreach ( $pod[ 'fields' ] as $field ) {
+ if ( isset( $_POST[ 'pods_meta_' . $field[ 'name' ] ] ) )
+ $data[ $field[ 'name' ] ] = $_POST[ 'pods_meta_' . $field[ 'name' ] ];
+ }
+ $item->save( $data );
}
public function meta_user ( $user_id ) {

0 comments on commit cdd2ea7

Please sign in to comment.