@@ 135-155 (lines=21) @@ | ||
132 | * @param int $limitprev |
|
133 | * @param string $excluded_categories |
|
134 | */ |
|
135 | function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { |
|
136 | ||
137 | _deprecated_function( __FUNCTION__, '2.0.0', 'previous_post_link()' ); |
|
138 | ||
139 | if ( empty($in_same_cat) || 'no' == $in_same_cat ) |
|
140 | $in_same_cat = false; |
|
141 | else |
|
142 | $in_same_cat = true; |
|
143 | ||
144 | $post = get_previous_post($in_same_cat, $excluded_categories); |
|
145 | ||
146 | if ( !$post ) |
|
147 | return; |
|
148 | ||
149 | $string = '<a href="'.get_permalink($post->ID).'">'.$previous; |
|
150 | if ( 'yes' == $title ) |
|
151 | $string .= apply_filters('the_title', $post->post_title, $post->ID); |
|
152 | $string .= '</a>'; |
|
153 | $format = str_replace('%', $string, $format); |
|
154 | echo $format; |
|
155 | } |
|
156 | ||
157 | /** |
|
158 | * Prints link to the next post. |
|
@@ 171-190 (lines=20) @@ | ||
168 | * @param int $limitnext |
|
169 | * @param string $excluded_categories |
|
170 | */ |
|
171 | function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { |
|
172 | _deprecated_function( __FUNCTION__, '2.0.0', 'next_post_link()' ); |
|
173 | ||
174 | if ( empty($in_same_cat) || 'no' == $in_same_cat ) |
|
175 | $in_same_cat = false; |
|
176 | else |
|
177 | $in_same_cat = true; |
|
178 | ||
179 | $post = get_next_post($in_same_cat, $excluded_categories); |
|
180 | ||
181 | if ( !$post ) |
|
182 | return; |
|
183 | ||
184 | $string = '<a href="'.get_permalink($post->ID).'">'.$next; |
|
185 | if ( 'yes' == $title ) |
|
186 | $string .= apply_filters('the_title', $post->post_title, $post->ID); |
|
187 | $string .= '</a>'; |
|
188 | $format = str_replace('%', $string, $format); |
|
189 | echo $format; |
|
190 | } |
|
191 | ||
192 | /** |
|
193 | * Whether user can create a post. |