first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace WPML\LIB\WP;
use WPML\Collect\Support\Traits\Macroable;
use WPML\FP\Either;
use WPML\FP\Fns;
use function WPML\FP\curryN;
/**
* @method static callable|Either post( ...$url, ...$args ) - Curried :: string → array → Left( WP_Error ) | Right(string)
*/
class Http {
use Macroable;
/**
* @return void
*/
public static function init() {
self::macro( 'post', curryN( 2, function ( $url, $args ) {
return WordPress::handleError( Fns::make( \WP_Http::class )->post( $url, $args ) );
} ) );
}
}
Http::init();