wp_terms_checklist() – Output an unordered list of checkbox input elements labelled with term names.

You appear to be a bot. Output may be restricted

Description

Outputs an unordered list of checkbox input elements labelled with term names.

Taxonomy-independent version of wp_category_checklist().

Usage

$string = wp_terms_checklist( $post_id, $args );

Parameters

$post_id
( int ) optional – Optional. Post ID. Default 0.
$args
( array|string ) optional – { Optional. Array or string of arguments for generating a terms checklist. Default empty array.
$descendants_and_self
( int ) optional – ID of the category to output along with its descendants. Default 0.
$selected_cats
( int[] ) optional – Array of category IDs to mark as checked. Default false.
$popular_cats
( int[] ) optional – Array of category IDs to receive the "popular-category" class. Default false.
$walker
( Walker ) optional – Walker object to use to build the output. Default empty which results in a Walker_Category_Checklist instance being used.
$taxonomy
( string ) optional – Taxonomy to generate the checklist for. Default 'category'.
$checked_ontop
( bool ) optional – Whether to move checked items out of the hierarchy and to the top of the list. Default true.
$echo
( bool ) optional – Whether to echo the generated markup. False to return the markup instead of echoing it. Default true. }

Returns

string HTML list of input elements.

Source

File name: wordpress/wp-admin/includes/template.php
Lines:

101 to 111 of 111
    $output .= $walker->walk( $checked_categories, 0, $args );
  }
  // Then the rest of them.
  $output .= $walker->walk( $categories, 0, $args );

  if ( $parsed_args['echo'] ) {
    echo $output;
  }

  return $output;
}
 

 View on GitHub View on Trac