如何将image_send_to_editor过滤器添加到特定的wp_editor实例

时间:2016-04-23 16:50:45

标签: wordpress plugins add-filter wp-editor

我想将过滤器添加到元数据库中的自定义wp_editor。有没有办法获得editor_id所以它不适用于所有编辑器?谢谢!

    $args = array(
         'quicktags' => true,
         'media_buttons' => true,
           'tinymce' => array(
                'toolbar1' => 'p123553_mce_button_headings,p123553_mce_button_quotes,',
                'toolbar2' => false,
                'plugins' => '',
              ),
            );
    wp_editor('This is the default text!', 'p123553', $args);


public function p123553_filter_image_send_to_editor($content)
{
    $content .= $editor_id.'<p>Unicorns are awesome.</p>';

    return $content;
}


add_filter('image_send_to_editor',  'p123553_filter_image_send_to_editor');

0 个答案:

没有答案