• Resolved barb55

    (@barb55)


    Hi,

    I was just wondering whether Woocommerce is using the same Rest-API as WordPress, or if it is a different one. The reason is that I would like to clean up the header links that WP has set, and I would like to add

    remove_action('wp_head', 'rest_output_link_wp_head');
    remove_action('wp_head', 'wp_oembed_add_discovery_links');
    remove_action('template_redirect', 'rest_output_link_header', 11, 0);
    
    function remove_json_api ()
    {
    
       remove_action('wp_head', 'rest_output_link_wp_head', 10);
       remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
    
       remove_action('rest_api_init', 'wp_oembed_register_route');
    
       add_filter('embed_oembed_discover', '__return_false');
    
       remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);
    
       remove_action('wp_head', 'wp_oembed_add_discovery_links');
    
       remove_action('wp_head', 'wp_oembed_add_host_js');
    
       add_filter('rewrite_rules_array', 'disable_embeds_rewrites');
    }
    add_action('after_setup_theme', 'remove_json_api');

    and I am wondering if this would affect Woocommerce in any way since I do need Woocommerce’s REST-API to work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    WooCommerce’s REST API is based on WordPress’s REST API, extending the core functionalities.

    I am not sure if removing that code will affect WooCommerce. I would say, try and see how it goes! In the worst case, you can just remove the code and use the REST API as usual.

    Plugin Support abwaita a11n

    (@abwaita)

    Hi @barb55,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, the above info was useful!

    If you have further questions, please feel free to open a new topic.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Question API’ is closed to new replies.