[Plugin: Media Custom Fields] no custom fields breaks foreach loop.
-
Minor fix, if you havent made any custom fields yet, the foreeach in line 233 will complain.
media-custom-fields.php
Inserting an “if ($tqmcf)” (check that the variable isent empty):
function tqmcf_edit( $form_fields, $post ) { $tqmcf = get_tqmcf(); if ($tqmcf) // new { // new foreach ( $tqmcf as $field ) { $form_fields[$field["slug"]]['label'] = $field['name']; $form_fields[$field["slug"]]['value'] = get_post_meta( $post->ID, $field["slug"], true ); $form_fields[$field["slug"]]['helps'] = $field['description']; } } // new return $form_fields; }very usefull plugin :thumbs-up:
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘[Plugin: Media Custom Fields] no custom fields breaks foreach loop.’ is closed to new replies.