the_post_custom( $data->ID ); } function the_post_custom( $id ) { $custom = get_post_custom( $id ); if ( count( $custom ) > 0 ) { $content = ''; foreach ( $custom AS $field => $value ) { if ( in_array( $field, $this->types ) ) $content .= ' '.implode( ' ', $value ); } return $content.''; } return ''; } function highlight( $post, $words, $content ) { $meta = $this->the_post_custom( $post->ID ); if ( !empty( $meta ) ) { $highlight = new Highlighter( $meta, $words, true ); if ( $highlight->has_matches() ) { $highlight->zoom( 40, 80 ); $highlight->mark_words(); return '

'.__( 'Meta-data', 'search-unleashed' ).': '.$highlight->get().'

'; } } return ''; } function field_name() { return 'post_meta'; } function name() { return __( 'Post/page meta-data', 'search-unleashed' ); } function load( $config ) { if ( isset( $config['types'] ) ) $this->types = $config['types']; } function edit() { global $wpdb; $available = $wpdb->get_results( "SELECT meta_key FROM {$wpdb->postmeta} WHERE meta_key NOT LIKE '%_wp%' GROUP BY meta_key ORDER BY meta_key" ); ?> :
isset( $data['key'] ) ? $data['key'] : array() ); } function get_keys() { $keys = array(); foreach ( (array)$this->types AS $type ) { $keys[] = "'".$type."'"; } return implode( ',', $keys ); } }