Changeset 861 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
- Timestamp:
- 09/12/2014 10:52:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r853 r861 882 882 return $text; 883 883 } 884 $text = trim( substr( $text, 1, -1 ) ); 885 $text = str_replace( '@type', "<br \>@type", $text ); 886 return $text; 884 885 $new_text = ''; 886 $text = trim( substr( $text, 1, -1 ) ); 887 $text = str_replace( '@type', "\n@type", $text ); 888 889 $in_list = false; 890 $parts = explode( "\n", $text ); 891 foreach ( $parts as $part ) { 892 $part = preg_replace( '/\s+/', ' ', $part ); 893 list( $wordtype, $type, $name, $description ) = explode( ' ', $part, 4 ); 894 895 if ( '@type' != $wordtype ) { 896 if ( $in_list ) { 897 $in_list = false; 898 $new_text .= "</li></ul>\n"; 899 } 900 901 $new_text .= $part; 902 } else { 903 if ( $in_list ) { 904 $new_text .= '<li>'; 905 } else { 906 $new_text .= '<ul class="param-hash"><li>'; 907 $in_list = true; 908 } 909 910 $new_text .= "<b>'" . substr( $name, 1 ) . "'</b><br /><i><span class='type'>({$type})</span></i> {$description}</li>\n"; 911 } 912 } 913 914 if ( $in_list ) { 915 $new_text .= "</li></ul>\n"; 916 } 917 918 return $new_text; 887 919 } 888 920
Note: See TracChangeset
for help on using the changeset viewer.