equal
deleted
inserted
replaced
181 * function with only the new values set inside $catarr. |
181 * function with only the new values set inside $catarr. |
182 * |
182 * |
183 * @since 2.0.0 |
183 * @since 2.0.0 |
184 * |
184 * |
185 * @param array $catarr The 'cat_ID' value is required. All other keys are optional. |
185 * @param array $catarr The 'cat_ID' value is required. All other keys are optional. |
186 * @return int|bool The ID number of the new or updated Category on success. Zero or FALSE on failure. |
186 * @return int|false The ID number of the new or updated Category on success. Zero or FALSE on failure. |
187 */ |
187 */ |
188 function wp_update_category( $catarr ) { |
188 function wp_update_category( $catarr ) { |
189 $cat_ID = (int) $catarr['cat_ID']; |
189 $cat_ID = (int) $catarr['cat_ID']; |
190 |
190 |
191 if ( isset( $catarr['category_parent'] ) && ( $cat_ID == $catarr['category_parent'] ) ) { |
191 if ( isset( $catarr['category_parent'] ) && ( $cat_ID == $catarr['category_parent'] ) ) { |
238 * |
238 * |
239 * @since 2.3.0 |
239 * @since 2.3.0 |
240 * |
240 * |
241 * @param int $post_id |
241 * @param int $post_id |
242 * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'. |
242 * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'. |
243 * @return string|bool|WP_Error |
243 * @return string|false|WP_Error |
244 */ |
244 */ |
245 function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) { |
245 function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) { |
246 return get_terms_to_edit( $post_id, $taxonomy ); |
246 return get_terms_to_edit( $post_id, $taxonomy ); |
247 } |
247 } |
248 |
248 |
251 * |
251 * |
252 * @since 2.8.0 |
252 * @since 2.8.0 |
253 * |
253 * |
254 * @param int $post_id |
254 * @param int $post_id |
255 * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'. |
255 * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'. |
256 * @return string|bool|WP_Error |
256 * @return string|false|WP_Error |
257 */ |
257 */ |
258 function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) { |
258 function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) { |
259 $post_id = (int) $post_id; |
259 $post_id = (int) $post_id; |
260 if ( ! $post_id ) { |
260 if ( ! $post_id ) { |
261 return false; |
261 return false; |
276 $term_names = array(); |
276 $term_names = array(); |
277 foreach ( $terms as $term ) { |
277 foreach ( $terms as $term ) { |
278 $term_names[] = $term->name; |
278 $term_names[] = $term->name; |
279 } |
279 } |
280 |
280 |
281 $terms_to_edit = esc_attr( join( ',', $term_names ) ); |
281 $terms_to_edit = esc_attr( implode( ',', $term_names ) ); |
282 |
282 |
283 /** |
283 /** |
284 * Filters the comma-separated list of terms available to edit. |
284 * Filters the comma-separated list of terms available to edit. |
285 * |
285 * |
286 * @since 2.8.0 |
286 * @since 2.8.0 |