vtrotot / geko-post-type
Geko Custom Post Type for WordPress Theme
1.0.4
2021-09-01 06:35 UTC
Requires
- php: >=7
- symfony/http-foundation: ^5.3
- timber/timber: ^1.18
README
GekoPostType est un package permettant d'ajouter un Custom Post Type vt_geko
à un theme WordPress.
Ce Custom Post Type ajoute deux metadata : un nom et une url pour le fichier PDF.
La classe VincentTrotot\Geko\GekoPostType
paramètre le Custom Post Type tandis que la classe VincentTrotot\Geko\Geko
est une espèce de wrapper du Post (la classe hérite de la classe Timber\TimberPost
).
Installation
composer require vtrotot/Geko-post-type
Utilisation
Votre theme doit instancier la classe GekoPostType
new VincentTrotot\Geko\GekoPostType();
Vous pouvez ensuite récupérer un Post de type Geko:
$post = new VincentTrotot\Geko\Geko();
Ou récupérer plusieurs posts avec :
$args = [ 'post_type' => 'vt_geko', ... ]; $posts = new Timber\TimberRequest($args, VincentTrotot\Geko\Geko::class);