Download the PHP package undefinedfr/undefined-wp-framework without Composer

On this page you can find all versions of the php package undefinedfr/undefined-wp-framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package undefined-wp-framework

Undefined WP Framework

Mini Framework MVC pour WordPress basé sur Timber/Twig.

Installation

Dans votre functions.php :

Dépendances

Structure recommandée


Custom Post Types

Créez vos CPT dans app/PostType/ en étendant PostType :

Options de configuration

Option Type Default Description
singulier string ucfirst(slug) Nom singulier
pluriel string singulier + 's' Nom pluriel
feminin bool false Genre féminin (labels FR)
public bool true Accessible publiquement
show_in_rest bool true API REST & Gutenberg
menu_icon string null Dashicon ou SVG
supports array [...] Fonctionnalités supportées
taxonomies array ['post_tag', 'category'] Taxonomies associées
rewrite string/array slug Règles de réécriture

Custom Taxonomies

Créez vos taxonomies dans app/Taxonomy/ :


Blocs Gutenberg (ACF)

Structure Timber-style (recommandée)

Exemple de bloc

Template Twig

Hooks disponibles

Hook Description
undfnd_block_icon_paths Chemins de recherche pour l'icône
undfnd_block_assets Assets CSS/JS du bloc
undfnd_block_args Arguments d'enregistrement du bloc
undfnd_block_prepared Données préparées du bloc
undfnd_block_field_group Groupe de champs ACF
undfnd_block_preview_template Template de preview vide

Controllers & Routing

Créer un contrôleur

Définir les routes

Méthodes du contrôleur

Méthode Description
render($data) Rend le template Twig
_setTitle($title) Définit le titre de la page
_setData($data, $merge) Ajoute des données au contexte
_redirect($url) Redirige vers une URL
_addNotice($type, $message) Ajoute une notification session
getNotices() Récupère les notifications
isCurrentRoute($route) Vérifie la route actuelle

Request

Gestion des requêtes HTTP inspirée de Symfony :

ParameterBag - Méthodes de sanitization


Actions & Filters

Actions

Filters


Ajax

Appel côté JavaScript


Assets

Cache-busting avec hash.json

Créez public/assets/hash.json pour le versioning :

Hook pour le nom de l'objet localisé


Mail

Envoi d'emails avec templates Twig :

Variables globales disponibles

Template email


WP-CLI Commands

Usage :


Security

Le module Security désactive automatiquement l'endpoint REST /wp/v2/users pour éviter l'énumération des utilisateurs.


App Singleton

Classe de base pour créer une instance unique de votre application :

Helper global


Hooks & Filtres de référence

Blocs

Hook Args Description
undfnd_acf_blocks_path $path Chemin des blocs ACF legacy
undfnd_gutenberg_blocks_path $path Chemin des blocs Timber
undfnd_block_namespaces $namespaces Namespaces de recherche
undfnd_block_icon_paths $paths, $block Chemins des icônes
undfnd_block_assets $assets, $block Assets du bloc
undfnd_block_args $args, $block Args d'enregistrement
undfnd_block_prepared $block, $this Block préparé
undfnd_block_field_group $group, $name Champs ACF

CPT & Taxonomies

Hook Args Description
undfnd_cpt_save_post_priority $priority, $post_type Priorité du hook save
undfnd_cpt_save_post_accepted_args $args, $post_type Nombre d'args

Assets

Hook Args Description
undfnd_hash_assets_path $path Chemin du fichier hash.json
undfnd_assets_{handle}_object_name $name Nom de l'objet JS

Templating

Hook Args Description
timber_default_options $options Options par défaut
timber_global_context_data $data Données globales
undfnd_controller_wp_title_action $action Action pour wp_title

Licence

GPL-3.0-or-later

Auteur

Nicolas RIVIERE - undefined.fr


All versions of undefined-wp-framework with dependencies

PHP Build Version
Package Version
Requires timber/timber Version ^2.0
vinkla/extended-acf Version ^14.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package undefinedfr/undefined-wp-framework contains the following files

Loading the files please wait ...