WordPress: Function Reference/wpautop:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == Description == Changes double line-breaks in the text into HTML paragraphs (<tt><nowiki><p>...</p></nowiki></tt>). Wordpress uses it to filter [[WordPress:Template_Tags/the_content|t...)
 
无编辑摘要
 
(未显示另一用户的1个中间版本)
第1行: 第1行:
== Description ==
== 描述==


Changes double line-breaks in the text into HTML paragraphs (<tt><nowiki><p>...</p></nowiki></tt>).
将文本中的两个行分隔符转变为HTML段落(<tt><nowiki><p>...</p></nowiki></tt>)


Wordpress uses it to filter [[WordPress:Template_Tags/the_content|the content]] and [[WordPress:Template_Tags/the_excerpt|the excerpt]].
WordPress使用这个来filter[[WordPress:Template_Tags/the_content|the content]] [[WordPress:Template_Tags/the_excerpt|the excerpt]]


== Usage ==
== 用法 ==


%%% <?php wpautop( $pee, $br = 1 ); ?> %%%
%%% <?php wpautop( $pee, $br = 1 ); ?> %%%


== Parameters ==
== 参数 ==
; <var>pee</var> : (string) 需要安排格式的文本。


; <var>pee</var> : (string) The text to be formatted.
; <var>br</var> : (boolean)保存行分隔符。当设置为正确的,在段落转换为HTML时候,任何行分隔符仍然存在。<tt>script</tt> 和<tt>style</tt>部分的行分隔符不受影响。默认为<var>true</var>。


; <var>br</var> : (boolean) Preserve line breaks. When set to true, any line breaks remaining after paragraph conversion are converted to HTML <tt><nowiki><br /></nowiki></tt>. Line breaks within <tt>script</tt> and <tt>style</tt> sections are not affected. Default <var>true</var>.
>>如果真实正确的,那么为什么ohhhhh为什么这麽多地方这麽多人谈论<tt><nowiki><br /></nowiki></tt>被去除了?Docs out of step w/reality...不是个好的征兆。<< --[[WordPress:User:Bentrem|bentrem]] 2007年12月27日,05:09 (UTC)
 
>> It this is accurate, then why ohhhhh why are so many folk in so many places talking about <tt><nowiki><br /></nowiki></tt> being stripped? Docs out of step w/reality ... not a good sign. << --[[WordPress:User:Bentrem|bentrem]] 05:09, 27 December 2007 (UTC)
 
== References ==


== 参考 ==
http://photomatt.net/scripts/autop/
http://photomatt.net/scripts/autop/

2008年7月28日 (一) 09:50的最新版本

描述[ ]

将文本中的两个行分隔符转变为HTML段落(<p>...</p>)。

WordPress使用这个来filterthe contentthe excerpt

用法[ ]

%%% <?php wpautop( $pee, $br = 1 ); ?> %%%

参数[ ]

pee
(string) 需要安排格式的文本。
br
(boolean)保存行分隔符。当设置为正确的,在段落转换为HTML时候,任何行分隔符仍然存在。scriptstyle部分的行分隔符不受影响。默认为true

>>如果真实正确的,那么为什么ohhhhh为什么这麽多地方这麽多人谈论<br />被去除了?Docs out of step w/reality...不是个好的征兆。<< --bentrem 2007年12月27日,05:09 (UTC)

参考[ ]

http://photomatt.net/scripts/autop/