• t_a_short

    (@t_a_short)


    As part of a plugin I am writing, I need to put an array of search terms through the Google Search API and then write a new post containing the results. I’ve been able to make it work fine within a standard PHP script (printing the results rather than putting them in a post, of course) but when I transfer the code into my plugin, the plugin activates with no error messages where the search results should be there is nothing at all.

    Here is the relevant code (forgive the ineloquent code, I am still relatively new to writing PHP):

    Pastebin Link

    So where the post should display something like this (example, using ‘wordpress’ as the first search term):

    1. wordpress
    A semantic personal publishing platform with a focus on aesthetics, web standards, and usability. – wordpress.org
    The latest stable release of WordPress (Version 3.1) is available in two … – wordpress.org
    Free blogs managed by the developers of the WordPress software. Includes custom design templates, integrated statistics, automatic spam protection and other … – wordpress.com
    WordPress is an open source Content Management System (CMS), often used as a blog publishing application, powered by PHP and MySQL. … – en.wikipedia.org

    All I get is:

    1. wordpress



    I am really a beginner when it comes to writing plugins (and PHP in general) so any help whatsoever would be much appreciated.

  • The topic ‘Displaying decoded JSON from Google API’ is closed to new replies.