You are here

html_entity_decode.inc in Feeds Tamper 6

Same filename and directory in other branches
  1. 7 plugins/html_entity_decode.inc

File

plugins/html_entity_decode.inc
View source
<?php

/**
 * @file
 * Decode HTML entities.
 */
$plugin = array(
  'form' => 'feeds_tamper_html_entity_decode_form',
  'callback' => 'feeds_tamper_html_entity_decode_callback',
  'name' => 'HTML entity decode',
  'multi' => 'loop',
  'category' => 'HTML',
);
function feeds_tamper_html_entity_decode_form($importer, $element_key, $settings) {
  $form = array();
  $form['html'] = array(
    '#value' => t('Convert all HTML entities such as &amp;amp; and &amp;quot; to &amp; and &quot;.'),
  );
  return $form;
}
function feeds_tamper_html_entity_decode_callback($source, $item_key, $element_key, &$field, $settings) {
  $field = html_entity_decode($field, ENT_QUOTES, 'UTF-8');
}