wp_link_category_checklist [ WordPress Function ]
wp_link_category_checklist ( $link_id = 0 )
| Parameters: |
|
| Defined at: |
|
Soorgelijke functies: wp_category_checklist, wp_terms_checklist, wp_popular_terms_checklist, wp_list_categories, clean_category_cache
{@internal Missing Short Description}}
Source
<?php
function wp_link_category_checklist( $link_id = 0 ) {
$default = 1;
if ( $link_id ) {
$checked_categories = wp_get_link_cats( $link_id );
// No selected categories, strange
if ( ! count( $checked_categories ) )
$checked_categories[] = $default;
} else {
$checked_categories[] = $default;
}
$categories = get_terms( 'link_category', array( 'orderby' => 'name', 'hide_empty' => 0 ) );
if ( empty( $categories ) )
return;
foreach ( $categories as $category ) {
$cat_id = $category->term_id;
$name = esc_html( apply_filters( 'the_category', $category->name ) );
$checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : '';
echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, "</label></li>";
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- WordPress › Support » Tags — wp_link_category_checklist
(forgot?) Register · WordPress › Support » wp_link_category_checklist ... wp_link_category_checklist - default category selected is 1, 1, jimmyhigh, 2 years ...
wordpress.org - WordPress › Support » wp_link_category_checklist - default ...
wp_link_category_checklist - default category selected is 1 (1 post). jimmyhigh. Member Posted 2 years ago #. Is there a particular reason why '1' is used in this ...
wordpress.org - wp_link_category_checklist
Function and Method Cross Reference. wp_link_category_checklist(). Defined at: /wp-admin/includes/template.php -> line 205. Referenced 4 times: ...
phpxref.ftwr.co.uk - wp_link_category_checklist() WordPress function reference ...
function wp_link_category_checklist( $link_id = 0 ) { $default = 1; if ( $link_id ) { $ checked_categories = wp_get_link_cats( $link_id ); // No selected categories, ...
queryposts.com