Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /../plugins/rm-payment.php

My guess is that you’re accessing $response as an array when it’s a \WP_Error. Check out the possible return values of wp_remote_post: (array|WP_Error) The response or WP_Error on failure. You should modify your code in a couple of ways: $response = wp_remote_post( $remote_url, $request ); if ( is_wp_error( $response ) ) { // handle the … Read more

How to run flush_rewrite_rules on activation after i register my custom post type using WordPress Boilerplate Plugin

After a couple of days trying and trying and trying… i asked a youtuber who develops using the same WordPress Plugin Boilerplate and he pointed me to this article: https://andrezrv.com/2014/08/12/efficiently-flush-rewrite-rules-plugin-activation/ It adds an option inside_option table and it will flush rewrite rules based on that 🙂 It worked perfectly