Viewing 0 reply threads
  • Author
    Posts
    • #6519
      bakaisar
      Member

      First, I want to thank to all developers for this awesome plugin.

      But now, I need some help.

      This is the original code. => http://pastebin.com/xLMf2Na4

      I modified some values in Easy Digital Downloads plugin with my theme. Then, I add a new taxonomy with piklist (ref. to artist_taxonomies)

      But I also want the same taxonomy with the same feature like that, so I copy and paste it and change its value to Product (product_represented). (ref. to product_represented)

      This is the new code. => http://pastebin.com/NBwvxTDL

      and got this error.

      Fatal error: Cannot redeclare get_labels() (previously declared in /home/japanrec/public_html/wp-content/themes/musiks/inc/edd.php:71) in /home/japanrec/public_html/wp-content/themes/musiks/inc/edd.php on line 124

      It seems that I cannot simply renaming stuffs.

      can someone teach me how to fix this?

      [update]

      and also what do you think about this code? (ref. to taxonomy terms: line 237 to 255)

      			$terms1 = get_the_terms( $post->ID, 'download_artist', '', ', ', '' );
      			if ( $terms1 && ! is_wp_error( $terms1 ) ) {
      				$artist = array();
      				foreach ( $terms1 as $term1 ) {
      					$artist[] = $term1->name;
      				}
      				$obj['artist'] = join( ", ", $artist );
      			}
      			$terms2 = get_the_terms( $post->ID, 'download_product_represented', '', ', ', '' );
      			if ( $terms2 && ! is_wp_error( $terms2 ) ) {
      				$product_represented = array();
      				foreach ( $terms2 as $term2 ) {
      					$product_represented[] = $term2->name;
      				}
      				$obj['product_represented'] = join( ", ", $product_represented );
      			}			
      			$obj['poster'] = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
      			$objs[] = $obj;
      		}

      is it good enough? This is what i was struggle with first before the problem above appeared

Viewing 0 reply threads
  • You must be logged in to reply to this topic.