Mesela şöyle bir açıklama yazıyorum:
<div class="class-name">Bu gün hava çok sıcak</div>phpmyadmin'den bakıyorum kaydedilen sadece "Bu gün hava çok sıcak" şeklinde sadece metin kısmı olduğu için bir tablo, görsel..vs eklediğimde hiç biri görünmüyor. <b>kalın</b> bile yapamıyorum.
Kodlar;
/* Custom Field for Categories */
function dm_category_fields($term) {
if (current_filter() == 'category_edit_form_fields') {
$bottom_description = get_term_meta($term->term_id, 'bottom_description', true);
?>
<tr class="form-field">
<th valign="top" scope="row"><label for="term_fields[bottom_description]"><?php _e('Sayfa Sonu Açıklaması'); ?></label></th>
<td>
<textarea class="large-text" cols="50" rows="10" id="term_fields[bottom_description]" name="term_fields[bottom_description]"><?php echo esc_textarea($bottom_description); ?></textarea><br/>
<span class="description"><?php _e('Kategori içeriğinin sonuna bir şeyler eklemek için. Shortcode destekler.'); ?></span>
</td>
</tr>
<?php } elseif (current_filter() == 'category_add_form_fields') {
?>
<div class="form-field">
<label for="term_fields[bottom_description]"><?php _e('Sayfa Sonu Açıklaması'); ?></label>
<textarea cols="40" rows="10" id="term_fields[bottom_description]" name="term_fields[bottom_description]"></textarea>
<p class="description"><?php _e('Kategori içeriğinin sonuna bir şeyler eklemek için. Shortcode destekler.'); ?></p>
</div>
<?php
}
}
add_action('category_add_form_fields', 'dm_category_fields', 10, 2);
add_action('category_edit_form_fields', 'dm_category_fields', 10, 2);
function wcr_save_category_fields($term_id) {
if (!isset($_POST['term_fields'])) {
return;
}
foreach ($_POST['term_fields'] as $key => $value) {
update_term_meta($term_id, $key, sanitize_text_field($value));
}
}
add_action('edited_category', 'wcr_save_category_fields', 10, 2);
add_action('create_category', 'wcr_save_category_fields', 10, 2);