Tag Archives: wp_editor

Plugin for shortcode generate in editor

=>Manage From Settings
=>Drage and Drop to delete shortcode.
=>Icon is avalable in all post and page editor.

https://wordpress.org/plugins/shortcoder/

Advertisements

wp editor for theme options

themeoptions.php


<div class="ft-control">
<?php    $a1_content = $legal_options['productcontent'];
$a1_editor_id = 'productcontent';
$a1_settings = array('textarea_name' => 'legal_theme_options[productcontent]','textarea_rows' => 25);
wp_editor($a1_content, $a1_editor_id, $a1_settings); ?>
</div>

display


<?php if (!empty($legal_options['productcontent'])) {
echo '<div class="col-md-12 no-padding">' . $legal_options['productcontent'] . '</div>';
} ?>

add this function in saving your theme-options .JS file

tinyMCE.triggerSave();

example:


jQuery("#form-option").submit(function(e)
{
tinyMCE.triggerSave();
var postData = jQuery(this).serializeArray();
var formURL = jQuery(this).attr("action");
jQuery.ajax(
{
url : formURL,
type: "POST",
data : postData,
async:false,
success:function(data, textStatus, jqXHR)
{
//data: return data from server
jQuery('.save-options').fadeIn();
setTimeout(function () {
jQuery('.save-options').fadeOut();
}, 1500);
},
error: function(jqXHR, textStatus, errorThrown)
{
//if fails
}
});
e.preventDefault(); //STOP default action
});

%d bloggers like this: