• Hi.

    I use your plugin to get google spreadsheet values and output it as shortcode.. after upgrading to the latest wordpress no shortcode output works anymore!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Can you provide a screenshot of what your snippet looks like, or at least the code so I can test it out myself?

    Thread Starter openaspace

    (@openaspace)

    Hello this is the code:

    function get_sheet_value_prezzi($atts) {
    $API = 'API-SERIAL';
    $google_spreadsheet_ID = 'GOOGLE-DOC-ID';
    $api_key = esc_attr( $API);
    
    $location = $atts['location'];
    
    $get_cell = new WP_Http();
    $cell_url = "https://sheets.googleapis.com/v4/spreadsheets/$google_spreadsheet_ID/values/$location?&key=$api_key";
    $cell_response = $get_cell -> get( $cell_url);
    $json_body = json_decode($cell_response['body'],true);
    $cell_value = $json_body['values'][0][0];
    return $cell_value;
    }
    add_shortcode('prezzi', 'get_sheet_value_prezzi');
    
    • This reply was modified 1 year, 11 months ago by openaspace.
    • This reply was modified 1 year, 11 months ago by openaspace.
    Thread Starter openaspace

    (@openaspace)

    I have correct the pasted code for formatting errors.

    • This reply was modified 1 year, 11 months ago by openaspace.

    Mine the same, I have 1 particular page the there is no output and I cannot understand why. Other pages are ok. Only 1 particular page has an issue.

    Thread Starter openaspace

    (@openaspace)

    I have verified that other plugins/code using Google API, after the latest WordPress upgrade are not working anymore.

    On different websites on different hosting the problem is with http referer, it you force it inside the API call your code will work…

    • This reply was modified 1 year, 11 months ago by openaspace.
    Plugin Author Shea Bunge

    (@bungeshea)

    It sounds like this has to do with the Google API not working correctly, instead of anything that can be fixed within Code Snippets.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘After latest wordpress upgrade no shortcode output’ is closed to new replies.