コード例 #1
0
ファイル: class-sb-core.php プロジェクト: sb-xs/que-pour-elle
 public static function create_page_template($args = array())
 {
     $plugin_path = isset($args['plugin_path']) ? $args['plugin_path'] : '';
     $folder_path = isset($args['folder_path']) ? $args['folder_path'] : '';
     $templates = isset($args['templates']) ? $args['templates'] : array();
     if (empty($plugin_path) || !is_array($templates)) {
         return;
     }
     $page_template = new SB_Page_Template();
     $page_template->set_plugin_path($plugin_path);
     if (!empty($folder_path)) {
         $page_template->set_folder_path($folder_path);
     }
     $page_template->add_array_templates($templates);
     $page_template->hook();
 }
コード例 #2
0
ファイル: class-sb-core.php プロジェクト: nightsunny2/sb-core
 public static function page_template_init($args = array())
 {
     $plugin_path = isset($args['plugin_path']) ? untrailingslashit($args['plugin_path']) : '';
     $folder_path = isset($args['folder_path']) ? untrailingslashit($args['folder_path']) : '';
     $templates = isset($args['templates']) ? $args['templates'] : array();
     if (empty($plugin_path) || !is_array($templates)) {
         return;
     }
     $page_template = new SB_Page_Template();
     $page_template->set_plugin_path($plugin_path);
     if (!empty($folder_path)) {
         $page_template->set_folder_path($folder_path);
     }
     $page_template->add_array_templates($templates);
     return $page_template;
 }