WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
[resolved] External Controller Path Error (3 posts)

  1. bennybobw
    Member
    Posted 2 years ago #

    So in order to activate my external plugin I have to do this:

    function set_howry_controller_path() {
      return "../wp-content/themes/howry/includes/json.php";
    }
    add_filter('json_api_howry_controller_path', 'set_howry_controller_path');

    Then I get an error when I try to access the controller. The path isn't found on line 29 of json-api/singletons/api.php

    if (file_exists($controller_path)) {

    I have to change the path in my function to this:

    return "wp-content/themes/howry/includes/json.php";

    And it works, but it appears in the admin screen as broken...

    Has anyone found a fix to this or patched the json-api code?

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

  2. Rohan
    Member
    Posted 2 years ago #

    For my custom controller path I just gave the path an absolute value as opposed to a relative one.

  3. bennybobw
    Member
    Posted 2 years ago #

    Ah right. This works for me without fail:

    return get_template_directory() . "/includes/json.php";

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags