• Hey there,
    First of all, thanks for the great work on this plugin, it helped me a lot.
    My (hopefully simple) question:
    I want to obtain an array (not an HTML list) of characters for a specific post. Right now I’m looping through all the posts. I can get most relevant info, but I’m struggling with the get_webcomic_characters() function, which only seems to return all characters (of a collection). I’m not sure which and how to use its parameters.

    Reference code (abstracted):

    $comics = get_webcomics();
    foreach ( $comics as $comic ) {
        $characters = get_webcomic_characters([$comic]); //this line is the problem, tried different functions and parameters
        $var_dump($characters);

    I’m still a PHP noob so thanks for the help ??

Viewing 1 replies (of 1 total)
  • Thread Starter salhamander

    (@salhamander)

    Solved it myself. Not sure if the most efficient way, but it works.

    
    $comics = get_webcomics();
    foreach ( $comics as $comic ) {
        $args = [
             'type' => 'storyline',
            'object_ids' => $comic->ID
        ];
        $storylines = get_webcomic_terms($args);
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Getting an array of characters for a specific post’ is closed to new replies.