Skip to main content

Mantle is a framework for building large, robust websites and applications with WordPress

Get Started →GitHub

Looking to upgrade your WordPress unit testing?

Check out Mantle Testkit for a drop-in replacement to WordPress core tests via our testing framework that allows you to fluently tests WordPress in a modern way.

Simplicity First

Mantle believes that enterprise-level WordPress development is possible and should have a simple and delightful syntax.

Inspired by Laravel

Enjoy the flexibility of the Laravel Framework inside of WordPress with a baked-in WordPress integration.

Modern Toolkit

Includes a powerful ORM, simple to use routing, blade-powered templating, and a fast independent testing library for WordPress out of the box.

Route::get( '/post/{post}', function ( Post $post ) {
return view( 'post' )->with( 'post', $post );
} );

Route::post( '/upload/', function ( Request $post ) {
$attachment_id = $request->file( 'uploaded_image' )->store_as_attachment();

return response()->json( [
'attachment_id' => $attachment_id,
'message' => 'Image uploaded successfully',
] );
} );

Route::rest_api( 'namespace/v1', '/route-to-use', function() {
return [ ... ];
} );

Flexible RESTful Routing

Use a Symfony-powered routing framework on top of WordPress to respond to requests in your application. Respond to requests using native PHP or Blade templates, both supporting a set of powerful template helpers to help DRY up your templates.

$post = static::factory()->post->create_and_get();

$this->get( $post )
->assertOk()
->assertSee( $post->post_title );

$this->post( '/upload', [
'uploaded_file' => [ ... ],
] )
->assertStatus( 201 )
->assertJsonPath( 'message', 'Image uploaded successfully' );

Independent Test Framework

Use the independent Mantle Test Framework to make writing unit tests simpler than ever. Supports a drop-in replacement for WordPress core testing framework that will run faster and allow IDE-friendly assertions. Runs PHPUnit 9.5+ out of the box.

Mantle is a heavily Laravel-inspired framework for improving the WordPress developer experience. It aims to make the development process delightful for the developer. WordPress can already accomplish great things out of the box. Mantle aims to make it easier and simpler to use. Code should be fluent, reusable, easy to read, testable, and delightful to work with.

Get started here or visit our GitHub to contribute.