plugin = wpify_woo(); } public function setup() { add_filter( 'http_request_args', array( $this, 'allow_unsafe_request_args' ), 20, 2 ); } function allow_unsafe_request_args( $args, $url ) { $args['reject_unsafe_urls'] = false; return $args; } /** * Prints a greeting. * * ## OPTIONS * * * : The ID of the feed to generate. * ## EXAMPLES * * wp example hello Newman * * @when after_wp_load */ public function generate_feed( $args ) { $module = $this->plugin->get_api(FeedApi::class)->get_module($args[0]); if ( ! $module ) { return new \WP_Error( 'module-not-found', __( 'Module not found', 'wpify-woo' ) ); } $module->get_feed()->delete_tmp_file(); $module->get_feed()->generate_feed(); } }