Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WPGetAPI

    (@wpgetapi)

    Hi,

    Which API are you using and what does your endpoint settings look like?

    Thread Starter hereismine

    (@hereismine)

    I followed exactly as the tutorial did. Only the echo part of the data does not appear. When raw json and var dump, data shows..

    Thread Starter hereismine

    (@hereismine)

    FYI, If I just write echo $data[‘author’]; like your tutorial did and it shows a warning:

    Warning:  Undefined array key “author” in /var/www/html/wp-content/plugins/code-snippets/php/front-end/class-frontend.php(239) : eval()’d code on line 10

    So I changed to echo $data[‘author’] ?? null; and the warning disappeared but no data were shown. I really appreciate it if you can help me. Thank you…

    • This reply was modified 1 year, 10 months ago by hereismine.
    Plugin Author WPGetAPI

    (@wpgetapi)

    You will need to modify the PHP code to suit your own API and the data that it returns.

    Using $data[‘author’] will likely not work as there is probably no key within your data that is named ‘author’.

    If you paste the results of your var dump here, I can assist further.

    Thread Starter hereismine

    (@hereismine)

    Sorry I just gave a response now, I’ve resolved that. Turns out it should be like this $data[0][‘author’]; and the results appear. Thank you for your response!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Blank or no data appear’ is closed to new replies.