Title: Plugin is blocking REST API, can&#8217;t create any new posts
Last modified: April 6, 2023

---

# Plugin is blocking REST API, can’t create any new posts

 *  Resolved [pottypotsworth](https://wordpress.org/support/users/pottypotsworth/)
 * (@pottypotsworth)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/plugin-is-blocking-rest-api-cant-create-any-new-posts/)
 * Hello,
 * All posts on my site are failing to save when updated, and new ones are not saved
   when created. My web hosts were able to report the following.
 * I was able to find the cause of the update error. It is related to one of your
   plugins – woo-gutenberg-products-block (WooCommerce Blocks).
   It seems the plugin
   is blocking REST API and thus the update failed.Here is the error as well:===
   ================================================================When testing 
   the REST API, an unexpected result was returned:REST API Endpoint: [https://www.prettyme.ph/wp-json/wp/v2/types/post?context=edit](https://www.prettyme.ph/wp-json/wp/v2/types/post?context=edit)
   REST API Response: (500) Internal Server Error===============================
   ====================================Once the plugin has been disabled I was able
   to update the changes on the page.The plugin is currently enabled as you requested
   earlier.I locate Stack trace in the error log which is related.I will share it
   with you with advice to contact the plugin support/developers for further insights
   on what may cause the issue:=================================================
   ==================`PHP Fatal error:  Uncaught Error: Call to a member function
   get() on null in /home/prettyme/public_html/wp-content/themes/legenda-child/functions.
   php:170\nStack trace:\n#0 /home/prettyme/public_html/wp-includes/class-wp-hook.
   php(308):bbloomer_gateway_disable_shipping_326()\n#1/home/prettyme/public_html/
   wp-includes/plugin.php(205):WP_Hook->apply_filters()\n#2/home/prettyme/public_html/
   wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(163):apply_filters()\
   n#3/home/prettyme/public_html/wp-content/plugins/woo-gutenberg-products-block/
   src/StoreApi/Schemas/V1/CheckoutSchema.php(122):WC_Payment_Gateways->get_available_payment_gateways()\
   n#4/home/prettyme/public_html/wp-content/plugins/woo-gutenberg-products-block/
   src/StoreApi/Schemas/V1/AbstractSchema.php(62):Automattic\WooCommerce\StoreApi\
   Schemas\V1\CheckoutSchema->get_properties()\n#5 /home/prettyme/public_html/wp-
   content/plugins/woo-gutenberg-products-block/src/StoreApi/Routes/V1/AbstractRoute.
   php(85):Automattic\WooCommerce\StoreApi\Schemas\V1\AbstractSchem in /home/prettyme/
   public_html/wp-content/themes/legenda-child/functions.php on line 170\n======
   =============================================================
 * Disabling the plugin allows posts to be saved again.
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Darren Ethier (nerrad)](https://wordpress.org/support/users/nerrad/)
 * (@nerrad)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/plugin-is-blocking-rest-api-cant-create-any-new-posts/#post-16632884)
 * Hi there! It’s great that you were immediately able to workaround the problem
   by deactivating WooCommerce Blocks, from the stack trace it’s not Woo Blocks 
   that is actually triggering the fatal error. Something in your themes `functions.
   php` file is.
 *     ```wp-block-code
       PHP Fatal error:  Uncaught Error: Call to a member function get() on null in /home/prettyme/public_html/wp-content/themes/legenda-child/functions.php:170\
       ```
   
 * It appears whatever is in this theme file is hooking into something within WooCommerce(
   and via the stack WooCommerce Blocks). My _guess_ (without having access to the
   relevant code in the theme file) is that this particular function in the theme
   is assuming a value is available when it isn’t in this context. Since this is
   a child theme, it may be custom to your site. Have you checked with the developer
   of the theme to learn more about this function in your theme and see why it would
   be throwing this error?
 * The other possibility is that this portion of your PHP logs applies to a different
   error happening elsewhere on your site (and not in the context of the issue you
   are experiencing). One way to rule that out would be to activate WooCommerce 
   Blocks again, and temporarily switch your site’s theme to a WordPress default
   theme (such as Twenty Twenty Three) and see if you still have the issues. If 
   you do, then we know the stack trace you shared isn’t relevant. If you don’t,
   then that confirms the theme is the culprit (and the stack trace is for the right
   context).
 * I hope that helps troubleshoot!
 *  Thread Starter [pottypotsworth](https://wordpress.org/support/users/pottypotsworth/)
 * (@pottypotsworth)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/plugin-is-blocking-rest-api-cant-create-any-new-posts/#post-16635664)
 * Many thanks for the reply, Darren.
 * I will try and troubleshoot this again next week using your advice and report
   back.
 *  Thread Starter [pottypotsworth](https://wordpress.org/support/users/pottypotsworth/)
 * (@pottypotsworth)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/plugin-is-blocking-rest-api-cant-create-any-new-posts/#post-16650904)
 * We managed to get this fixed. It was caused by adding custom code on the functions.
   php for Disable Payment Gateway For Specific Shipping Method.
 * Thanks again for your help, [@nerrad](https://wordpress.org/support/users/nerrad/)
 *  [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * (@xue28)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/plugin-is-blocking-rest-api-cant-create-any-new-posts/#post-16651077)
 * Hi [@pottypotsworth](https://wordpress.org/support/users/pottypotsworth/)
 * You are most welcome and we’re glad that worked! 🙂
 * Meanwhile, if you have a moment to spare, we would love it if you could share
   your thoughts with us by leaving a [review or feedback](https://wordpress.org/support/plugin/woo-gutenberg-products-block/reviews/).
   Your experience and feedback are important to help us improve and ensure we’re
   always providing the best possible support.
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Plugin is blocking REST API, can’t create any new posts’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woo-gutenberg-products-block_71608f.
   svg)
 * [WooCommerce Blocks](https://wordpress.org/plugins/woo-gutenberg-products-block/)
 * [Support Threads](https://wordpress.org/support/plugin/woo-gutenberg-products-block/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-gutenberg-products-block/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-gutenberg-products-block/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-gutenberg-products-block/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/plugin-is-blocking-rest-api-cant-create-any-new-posts/#post-16651077)
 * Status: resolved