-
使用Code Editor 填写此段代码 <view style="display:flex;" ><view>,保存后整段代码会消失,怎么才能不过滤这个代码?
Posted 11 months ago # -
Hi,
Please try to write english with google translate.
Hmm, If I undestand the question, just you must add sanitize => false parameter like this:
array( 'id' => 'opt-code-editor-5', 'type' => 'code_editor', 'title' => 'Code Editor without sanitize', 'sanitize' => false, // <--- see this. ),
CopyCopied!Regards, Codestar
Posted 11 months ago # -
I wrote 'sanitize' = > false according to the document, but it didn't work, and I still couldn't save the code
Posted 11 months ago # -
Posted 11 months ago #
-
Posted 11 months ago # -
Posted 11 months ago # -
Posted 11 months ago # -
保存后 能看到 但是刷新整个页面 就消失了
Posted 11 months ago # -
After saving, you can see it normally, but the refresh page will disappear.
Posted 11 months ago # -
Hi,
All settings are correct. Yes looks so, problem is caused by server. You should talk about that with server provider.
Also you can test "sanitize => false" in your localhost, you will see that work
Regards, Codestar
Posted 11 months ago # -
not work! After saving, you can see it normally, but the refresh page will disappear.
Posted 11 months ago # -
After various tests, it is found that this problem will occur if it is used in 'Group'。
CSF::createSection($prefix, array( 'title' => 'Code Editor', 'description' => 'Visit documentation for more details on this field: <a target="_blank" rel="nofollow" href="http://codestarframework.com/documentation/#/fields?id=code-editor" target="_blank">Field: code_editor</a>', 'fields' => array( array( 'id' => 'forum_modules', 'type' => 'group', 'button_title' => '+ 添加新模块', 'accordion_title_auto' => 'true', 'fields' => array( array( 'id' => 'opt-code-editor-1', 'type' => 'code_editor', 'title' => 'Code Editor', 'sanitize' => false, 'subtitle' => '<strong>Default Editor</strong> Using: theme: default and mode: htmlmixed', ), ), ), ) ));
CopyCopied!Posted 11 months ago # -
Hi,
Oh you mean in "group" field ? If so, you must write "sanitize => false" to group parameter. for eg:
. .. ... 'id' => 'forum_modules', 'type' => 'group', 'button_title' => '+ 添加新模块', 'accordion_title_auto' => 'true', 'sanitize' => false, // <------------------------------ It must here. 'fields' => array( array( 'id' => 'opt-code-editor-1', 'type' => 'code_editor', 'title' => 'Code Editor', 'subtitle' => '<strong>Default Editor</strong> Using: theme: default and mode: htmlmixed', ), ), ), . .. ...
CopyCopied!Regards, Codestar
Posted 11 months ago # -
According to your code, it still doesn't work. Have you tested it
Posted 11 months ago # -
Hi,
I haven't any idea really, It works correctly in my side.
Hey, I have created "textarea" and "code_editor" in demo. You can test it on: http://codestarthemes.com/plugins/codestar-framework/wp-login.php?login=demo
Btw, my code is like this:
CSF::createSection( $prefix, array( 'title' => 'Jianbo', 'icon' => 'fas fa-check', 'fields' => array( array( 'id' => 'opt-textarea-without-sanitize', 'type' => 'textarea', 'title' => 'Textarea without sanitize', 'sanitize' => false, ), array( 'id' => 'opt-code-editor-without-sanitize', 'type' => 'code_editor', 'title' => 'Code Editor without sanitize', 'sanitize' => false, ), array( 'id' => 'opt-group-without-sanitize', 'type' => 'group', 'title' => 'Group', 'sanitize' => false, 'fields' => array( array( 'id' => 'opt-text', 'type' => 'text', 'title' => 'Text', ), array( 'id' => 'opt-textarea-100', 'type' => 'textarea', 'title' => 'Textarea without sanitize', ), array( 'id' => 'opt-code-editor-100', 'type' => 'code_editor', 'title' => 'Code Editor without sanitize', ), ) ), ) ) );
CopyCopied!Regards, Codestar
Posted 11 months ago #