wp_insert_term doesn’t work with custom post type’s taxonomy

try init instead of after_setup_theme

function example_insert_category() {
    wp_insert_term(
        'Example Category',
        'friendsof'
    );
}

add_action( 'init', 'example_insert_category' );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)