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行: | ||
== Description == | == Description == | ||
== 描述== | |||
Changes double line-breaks in the text into HTML paragraphs (<tt><nowiki><p>...</p></nowiki></tt>). | 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 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 == | == Usage == | ||
== 用法 == | |||
%%% <?php wpautop( $pee, $br = 1 ); ?> %%% | |||
%%% <?php wpautop( $pee, $br = 1 ); ?> %%% | %%% <?php wpautop( $pee, $br = 1 ); ?> %%% | ||
== Parameters == | == Parameters == | ||
== 参数 == | |||
; <var>pee</var> : (string) The text to be formatted. | ; <var>pee</var> : (string) The text to be formatted. | ||
; <var>pee</var> : (string) 需要安排格式的文本。 | |||
; <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>. | ; <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>. | ||
; <var>br</var> : (boolean)保存行分隔符。当设置为正确的,在段落转换为HTML时候,任何行分隔符仍然存在。<tt>script</tt> 和<tt>style</tt>部分的行分隔符不受影响。默认为<var>正确的</var>。 | |||
>> 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) | >> 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) | ||
>>如果真实正确的,那么为什么ohhhhh为什么这麽多地方这麽多人谈论<tt><nowiki><br /></nowiki></tt>被去除了?Docs out of step w/reality...不是个好的征兆。<< --[[WordPress:User:Bentrem|bentrem]] 2007年12月27日,05:09 (UTC) | |||
== References == | == References == | ||
== 参考 == | |||
http://photomatt.net/scripts/autop/ | |||
http://photomatt.net/scripts/autop/ | http://photomatt.net/scripts/autop/ |
2008年7月21日 (一) 17:27的版本
Description
描述
Changes double line-breaks in the text into HTML paragraphs (<p>...</p>).
将文本中的两个行分隔符转变为HTML段落(<p>...</p>)。
Wordpress uses it to filter the content and the excerpt.
WordPress使用这个来filterthe content 和the excerpt。
Usage
用法
%%% <?php wpautop( $pee, $br = 1 ); ?> %%%
%%% <?php wpautop( $pee, $br = 1 ); ?> %%%
Parameters
参数
- pee
- (string) The text to be formatted.
- pee
- (string) 需要安排格式的文本。
- br
- (boolean) Preserve line breaks. When set to true, any line breaks remaining after paragraph conversion are converted to HTML <br />. Line breaks within script and style sections are not affected. Default true.
- br
- (boolean)保存行分隔符。当设置为正确的,在段落转换为HTML时候,任何行分隔符仍然存在。script 和style部分的行分隔符不受影响。默认为正确的。
>> It this is accurate, then why ohhhhh why are so many folk in so many places talking about <br /> being stripped? Docs out of step w/reality ... not a good sign. << --bentrem 05:09, 27 December 2007 (UTC)
>>如果真实正确的,那么为什么ohhhhh为什么这麽多地方这麽多人谈论<br />被去除了?Docs out of step w/reality...不是个好的征兆。<< --bentrem 2007年12月27日,05:09 (UTC)
References
参考
http://photomatt.net/scripts/autop/ http://photomatt.net/scripts/autop/