Site logo

[Support request] Prevent loading theme when using REST API

Home Forums Support [Support request] Prevent loading theme when using REST API

Home Forums Support Prevent loading theme when using REST API

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2503897
    Roel

    Hi,

    I have developed my own plugin which is partly frontend-html and the larger part is an extended REST API, defined my own schema’s, etc…
    Works like a charm.

    Did some debugging and found out that when REST calls are being made, all the theme-options of GeneratePress are loaded. Obviously you don’t need these if it’s just a REST call.

    SELECT option_value FROM wphx_options WHERE option_name = 'generate_package_secondary_nav' LIMIT 1
    SELECT option_value FROM wphx_options WHERE option_name = 'generate_package_woocommerce' LIMIT 1
    SELECT option_value FROM wphx_options WHERE option_name = 'generate_package_hooks' LIMIT 1
    
    ... and many more ...
    

    Is there a way to prevent them from loading?

    #2504431
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    If you open wp-content/plugins/gp-premium/inc/rest.php, you will find all of the REST endpoints that GP Premium registers in the register_routes() function.

    You can unregister these if you wish. However, doing so will break certain aspects of the plugin (activating/deactivating modules, import/export, licensing key activation etc…).

    Let me know if you need more info 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.