Last active
November 24, 2020 22:24
-
-
Save MaximeCulea/d9f505900e26a31123e8488062fe62c8 to your computer and use it in GitHub Desktop.
Exemple on how load template's files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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