airesvsg / acf-to-rest-api

Exposes Advanced Custom Fields Endpoints in the WordPress REST API
https://wordpress.org/plugins/acf-to-rest-api/
1.32k stars 111 forks source link

Not detecting ACF Pro in Mylisting Theme #360

Closed Bruce-ST closed 3 years ago

Bruce-ST commented 3 years ago

Hi, we're using this theme https://mylistingtheme.com/ ACF pro is bundled with the theme. (you don't see it in the plugins though) When installing acf-to-rest-api it doesn't detect that ACF Pro is present, so you cannot go to the settings page. Is there anyway to enable this?

gtsvetanov commented 3 years ago

Hello,

Can you provide an information about following points:

I'm not familiar with your theme but if you can provide us it's directory tree we will be able to help easier :)

Bruce-ST commented 3 years ago

Hi Georgi,

The theme depends on ACF Pro I believe the ACF Pro plugin is located in: Is it wp-content/themes/my-listing/includes/extensions/advanced-custom-fields

We host with Siteground so Fedora

Bruce-ST commented 3 years ago

Hi Georgi,

The vendor confirmed also: The directory is includes/extensions/advanced-custom-fields/plugin Loaded in includes/extensions/advanced-custom-fields/advanced-custom-fields.php

gtsvetanov commented 3 years ago

Hello Bruce12345.

There is a check in class ACF_To_REST_API method is_plugin_installed() on line 112 :) Try to add the path of your acf.php to see what will happen. If this fix the issue then maybe @airesvsg must add a hook for adding custom paths in this check :)

Bruce-ST commented 3 years ago

Hi Georgi,

I added the path to line 112, but it doesn't work. I think it's still looking inside the plugin directory instead of in the theme directory because of $plugin or ABSPATH (?)

airesvsg commented 3 years ago

https://github.com/airesvsg/acf-to-rest-api/issues/253#issuecomment-474680689