如何在SMOF(wordpress)中使用文本编辑器


how to use text editor in SMOF (wordpress)

我试过了,但它没有显示文本编辑器。那么,如何在SMOF中获取文本编辑器字段??

$of_options[] = array(  "name"      => "Legal Services",
                        "desc"      => "Upload Here content",
                        "id"        => "legal",
                        // Use the shortcodes [site_url] or [site_url_secure] for setting default URLs
                        "std"       => "",
                        "mod"       => "min",
                        "type"      => "text"
                );

请发布更多详细信息,您使用的是什么版本?

更改:

"type"      => "text"

至:

'type' => 'editor'

在第157行的交换机中将以下内容添加到您的class.options_machine.php中

//Wp editor input
case 'editor':
    $editor_value = '';
    if(isset($value['options']) && is_array($value['options']) ){
        $settings = $value['options'];
    } else {
        $settings = array();
    }           
    $editor_value = stripslashes($smof_data[$value['id']]);
    // Turn on the output buffer
    ob_start();
    // Echo the editor to the buffer
    wp_editor( $editor_value, $value['id'], $settings = array() );
    // Store the contents of the buffer in a variable
    $editor_contents = ob_get_clean();
    $output .= $editor_contents;
    break;

由于wp_editor()函数默认情况下会回显,因此绕过它的方法是将其放入缓冲区,然后从中获取内容

这至少是一个开始,