我正在开发一个使用whitelabel选项插件的项目,我想使用radium one click导入库导入这些选项。由于radium不支持白标插件,我想用我的选项做同样的事情。目前,我的选项是使用此脚本导入的。
jQuery('#tnit_buttons1_0').click(function(e){
//jQuery('.radium-import-start').click(function(e){
e.preventDefault();
var r = confirm("Press a button!");
if (r == true){
var dataString = 'eyJ0bml0X2ZvbnRzX3N1YnNldCI6IjAiLCJ0bml0X3RoZW1lX29wdGlvbnNfYmFja3VwX2xpc3QiOiIxNDY0NzAzMTI4ICIsInRuaXRfdGhlbWVfb3B0aW9uc19iYWNrdXBfMTQ2NDcwMzEyOCI6Ilt7XCJvcHRpb25cIjpcInRuaXRfaGVhZGVyX3RvcFwiLFwidmFsdWVcIjpcIjBcIn0sbnVsbCxudWxsLG51bGwse1wib3B0aW9uXCI6XCJ0bml0X2hlYWRlcl9jb2xzXCIsXCJ2YWx1ZVwiOlwiMlwifSxudWxsLHtcIm9wdGlvblwiOlwidG5pdF9hZnRlcl9tZW51XCIsXCJ2YWx1ZVwiOlwiMFwifSxudWxsLHtcIm9wdGlvblwiOlwidG5pdF9oZWFkZXJfbG9nb1wiLFwidmFsdWVcIjpcImh0dHA6XC9cL2xvY2FsaG9zdFwvbmV3LXRlc3RcL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMTZcLzA1XC9Mb2dvLTAxLnBuZ1wifSx7XCJvcHRpb25cIjpcInRuaXRfaGVhZGVyX2xvZ29faWRcIixcInZhbHVlXCI6XCIzOFwifSx7XCJvcHRpb25cIjpcInRuaXRfZ29vZ2xlXCIsXCJ2YWx1ZVwiOlwiPCEtLSBHb29nbGUgQW5hbHl0aWNzIC0tPlxcblxcbihmdW5jdGlvbihpLHMsbyxnLHIsYSxtKXtpWydHb29nbGVBbmFseXRpY3NPYmplY3QnXT1yO2lbcl09aVtyXXx8ZnVuY3Rpb24oKXtcXG4oaVtyXS5xPWlbcl0ucXx8W10pLnB1c2goYXJndW1lbnRzKX0saVtyXS5sPTEqbmV3IERhdGUoKT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9oNF9zaXplIjoiMzgiLCJ0bml0X3BvcnRmb2xpb19uYW1lIjoiIiwidG5pdF9zZWxlY3RfcG9ydGZvbGlvX3BhZ2UiOiIyIiwidG5pdF9zZWxlY3RfdGFnc19wb3J0Zm9saW8iOiIiLCJ0bml0X3BvcnRmb2xpb19jb2x1bW5zIjoiNCIsInRuaXRfcG9ydGZvbGlvX3N0eWxlIjoiMSIsInRuaXRfcG9ydGZvbGlvX2Rlc2NyaXB0aW9uIjoiIiwidG5pdF9mb290ZXJfYm90dG9tIjoiMCIsInRuaXRfZm9vdGVyX2NvbHMiOiIxIiwidG5pdF9mYXZpY29uIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9uZXctdGVzdFwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAxNlwvMDZcL2Zhdmljb24ucG5nIiwidG5pdF9mYXZpY29uX2lkIjoiMzkiLCJ0bml0X3RvcF9iYXJfcG9zaXRpb24iOiIxIiwidG5pdF9jdXN0b21fY3NzIjoiYm9keSB7Y29sb3I6IG9yYW5nZTt9XG5oMXsgZm9udC1zaXplOiA0MHB4ICFpbXBvcnRhbnQ7fSIsInRuaXRfY3VzdG9tX2pzIjoiYWxlcnQoJ2thbWknKTtcbmpRdWVyeSgncCcpLmNzcygnY29sb3InLCAnYmx1ZScpOyJ9';
//$('#import_field').val();
jQuery.post(
ajaxurl,
{
'action': js_options_data[10] + '_import_options',
'data': dataString
},
function(response){
$(window).off("beforeunload");
location.reload();
}
);
}
else {
return;
}
});
我只想在点击一次点击按钮后导入我的数据。我能够找到该功能但无法通过在PHP中转换来放置我的上述代码,以便它可以正常工作。简单地说,我希望使用php而不是jquery导入此选项。
注意: var dataString包含用于导入我的选项的字符串。