WordPress.org

Forums

JSON API
[resolved] Bug report: get_bloginfo('home') deprecated in attachment.php (5 posts)

  1. flacoman91
    Member
    Posted 2 years ago #

    Hi,

    Thanks for making this plugin.
    When wp_debug is set to true in wp-config.php the following error is thrown on a basic json call http://mysite.local/?json=1

    The php warning is:

    Notice: get_bloginfo was called with an argument that is deprecated since version 2.2! The home option is deprecated for the family of bloginfo() functions. Use the url option instead.

    The error occurs in
    json-api/models/attachment.php

    line 44:
    $home = get_bloginfo('home');

    should be changed to

    $home = get_bloginfo('url');

    http://wordpress.org/extend/plugins/json-api/

  2. flacoman91
    Member
    Posted 2 years ago #

    Another warning appears on the json api config page:

    Notice: Undefined index: url in /Users/flacoman91/Sites/wordpress/wp-content/plugins/json-api/singletons/api.php on line 175

    http://harmony.sonymusic.local/wp-admin/options-general.php?page=json-api

    just a simple check if url is a valid index fixes the error:

    if ( isset($info['url']) ) {

  3. MrCollins
    Member
    Posted 2 years ago #

    I am having the same issue. And even though the json is returning after the notice about get_bloginfo, it is causing my ajax request to fail.

    Error:

    Notice: get_bloginfo was called with an argument that is deprecated since version 2.2! The home option is deprecated for the family of bloginfo() functions. Use the url option instead. in C:\---\wp-includes\functions.php on line <i>2923

    Setting define('WP_DEBUG', false); in wp-config.php fixes the issue but in development I obviously need error reporting on.

  4. flacoman91
    Member
    Posted 2 years ago #

    MrCollins, If you fix the errors in each of the 2 posts I had above, the plugin should run without any errors.

  5. dphiffer
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for the bug reports. These will be fixed in the next point release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • JSON API
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags