在我安装了Dokan插件之后,新帖子和新产品上的编辑器工具出现了问题,这是dokan-tmc-keyon.js文件中的问题。
jQuery(document).ready(function($) {
tinymce.create('tinymce.plugins.dokan_button', {
init : function(editor, url) {
var menuItem = [];
var ds_img = dokan_assets_url +'/images/D.png';
$.each( dokan_shortcodes, function( i, val ){
var tempObj = {
text : val.title,
onclick: function() {
editor.insertContent(val.content)
}
};
menuItem.push( tempObj );
} );
// Register buttons - trigger above command when clickeditor
editor.addButton('dokan_button', {
title : 'Dokan shortcodes',
classes : 'dokan-ss',
type : 'menubutton',
// text : 'Dokan',
// image : dokan_assets_url +'/images/D.png',
menu : menuItem,
style : ' background-size : 18px; background-repeat : no-repeat; background-image: url( '+ ds_img +' );'
});
},
});
// Register our TinyMCE plugin
tinymce.PluginManager.add('dokan_button', tinymce.plugins.dokan_button);
});发布于 2018-05-26 23:17:43
这是杜坎插件的问题。将下面的代码添加到"functions.php“中(在主题目录中)将暂时解决这个问题(我希望它们在较新的版本中解决这个冲突):
function dk_shortcode_script($shortcodes){
define('DOKAN_SHORTCODES', $shortcodes);
?>
var dokan_assets_url = <?php echo json_encode( DOKAN_PRO_PLUGIN_ASSEST ) ?>;
var dokan_shortcodes = <?php echo json_encode( DOKAN_SHORTCODES ) ?>;
代码是由Ahamed (@achchu93)在插件支持论坛上编写的。
https://wordpress.stackexchange.com/questions/302748
复制相似问题