daily pastebin goal
75%
SHARE
TWEET

WordPress - Include Library / croque-pixel.com

a guest Dec 13th, 2017 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* *************************************************
  2.  * Include Library
  3.  * *************************************************/
  4.  
  5.  // Order to include files
  6. $files_to_include = array(
  7.     array (
  8.         'file'             => 'class-tgm-plugin-activation.php',
  9.         'include_in_admin' => true,
  10.         'include_in_front' => false
  11.     ),
  12.     array (
  13.         'file'             => 'core.php',
  14.         'include_in_admin' => true,
  15.         'include_in_front' => true
  16.     ),
  17.     array (
  18.         'file'             => 'back-general.php',
  19.         'include_in_admin' => true,
  20.         'include_in_front' => false
  21.     ),
  22.     array (
  23.         'file'             => 'sidebars.php',
  24.         'include_in_admin' => true,
  25.         'include_in_front' => true
  26.     ),
  27.     array (
  28.         'file'             => 'widgets.php',
  29.         'include_in_admin' => true,
  30.         'include_in_front' => true
  31.     ),
  32.     array (
  33.         'file'             => 'front-general.php',
  34.         'include_in_admin' => false,
  35.         'include_in_front' => true
  36.     ),
  37.     array (
  38.         'file'             => 'enqueued.php',
  39.         'include_in_admin' => false,
  40.         'include_in_front' => true
  41.     ),
  42. );
  43.  
  44. // Require files in Front & Back-office if necessary
  45. foreach ( $files_to_include as $file ) {
  46.     if(
  47.         ( true == $file['include_in_admin'] && is_admin() ) || // Back Office
  48.         ( true == $file['include_in_front'] && !is_admin() )   // Front Office
  49.     ) {
  50.         require_once( get_template_directory() . '/library/' . $file['file'] );
  51.     }
  52. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top