公共函数窗体($instance){$实例=wp_parse_args((数组)$实例,阵列(“标题”=>“”,“文本”=>“”,));?><?php if(!$this->is_legacyinstance($instance)):?><?php(电话)if(user_can_richedit()){add_filter('the_editor_content','format_for_editor',10,2);$default_editor='tinymce';}其他{$default_editor=“html”;}/**该过滤器记录在wp-includes/class-wp-editor.php中*/$text=应用过滤器('the_editor_content',$instance['text'],$default_editor);//重置过滤器添加。if(user_can_richedit()){remove_filter('编辑内容','格式_for_editor');}//防止在format_for_editor()不适用或_editor_content过滤器做了错误的事情时过早关闭文本区域。$escaped_text=preg_replace(“#</textarea#i”,“<;/textarea”,$text);?><input id=“<?php echo$this->get_field_id('title');?>”name=“<?php echo$this->get_field_name('titel');”>“class=”title sync-input“type=”hidden“value=”<?php-echo esc_attr($instance['title']);?>>“>”><textarea id=“<?php echo$this->get_field_id('text');?>”name=“<?php echo$this->get_field_name('text`);?>>”class=“text sync-input”隐藏>>?php echo$escaped_text;?></文本区域><input id=“<?php echo$this->get_field_id('filter');?>”name=“<input id=“<?php echo$this->get_field_id('visual');?>”name=“<?php其他:?><input id=“<?php echo$this->get_field_id('visual');?>”name=“<p><label for=“<?php echo$this->get_field_id('title');?>”><?php _e('标题:');?></标签><input class=“widefat”id=“<?php echo$this->get_field_id('title');?>”name=“<?hp echo$this->get_field_name('titel');”>“type=”text“value=”<?php-echo esc_attr($instance['title']);?>>“/></p><?php(电话)if(!isset($instance['visual'])){$widget_info_message=__('此小部件可能包含在“;自定义HTML”;小部件中工作得更好的代码。改为尝试该小部件如何?');}其他{$widget_info_message=__('此小部件可能包含在“;自定义HTML”;小部件中工作得更好的代码。如果您还没有,那么尝试一下该小部件怎么样?');}wp_admin_notice(管理员通知)($widget_info_消息,阵列(“type”=>“info”,“additional_classes”=>数组(“notice-alt”,“inline”),));?><p><label for=“<?php echo$this->get_field_id('text');?>”><?php_e('内容:');?></标签><textarea class=“widefat”rows=“16”cols=“20”id=“<?php echo$this->get_field_id('text');?>”name=“<?hp echo$this->get_field_name('text`);?>>”>?php echo esc_textarea($instance['text']);?></文本区域></p><p><input id=“<?php echo$this->get_field_id('filter');?>”name=“<?php echo$this->get_field_name('filter');?>”type=“checkbox”<?php已检查(!empty($instance['filter']));?>/> <label for=“<?php echo$this->get_field_id('filter');?>”><?php_e('自动添加段落');?></标签></p><?php(电话)endif;}
查看所有引用 在Trac上查看 在GitHub上查看