Skip to content

Instantly share code, notes, and snippets.

@MaximeCulea
Last active November 24, 2020 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaximeCulea/d9f505900e26a31123e8488062fe62c8 to your computer and use it in GitHub Desktop.
Save MaximeCulea/d9f505900e26a31123e8488062fe62c8 to your computer and use it in GitHub Desktop.
Exemple on how load template's files.
<?php
$dependencies = [
'inc' => [
'assets',
'manage-plugins',
'options',
'languages',
],
'theme' => [
'wysiwyg',
'title'
]
];
foreach ( $dependencies as $folder => $files ) {
if ( ! is_dir( dirname( __FILE__ ) . '/' . $folder ) ) {
continue;
}
foreach ( $files as $file ) {
get_template_part( $folder . '/' . $file );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment