• Hi i’m trying to output the checkbox style of categories but I got this error using wp_category_checklist() or wp_terms_checklist();

    Fatal error: Call to undefined function wp_category_checklist()

    my code is :
    <?php
    $selected_cats = array(7,8,9,10,11,12);
    wp_category_checklist( 0, 0, $selected_cats );
    ?>

    I’m using 3.5.2 wordpress, I check the wp-admin/includes/template.php the function is exist.

    I don’t know why this is undefined.

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • where in what template are you trying to call the function?

    Thread Starter denis0826

    (@denis0826)

    I call it on page template that I’d created.

    In WP 3.6 it’s declared as “deprecated” (see /includes/deprecated.php).

    How can we replace it?

    DarioDN, this frunction is not marked as deprecated anywhere.

    I also get this error with wp_terms_checklist(), a taxonomy independent version of wp_category_checklist(). The error apperars only in the frontend.

    Hi,

    We’ve the same issue with wp_category_checklist() and wp_terms_checklist() but it doesn’t declared as deprecated.

    The error is

    Fatal error: Call to undefined function wp_category_checklist() in ‘…’ or
    Fatal error: Call to undefined function wp_terms_checklist() in ‘…’

    Ok,

    functions are available only on admin side.

    The function wp_terms_checklist is defined in the file /wp-admin/includes/template.php

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Undefined function on wp_category_checklist’ is closed to new replies.