Esempio n. 1
0
 public function include_actions()
 {
     $files = array();
     foreach ($files as $file) {
         require trailingslashit(donkey()->plugin_dir) . trailingslashit('inc/actions') . $file;
     }
 }
Esempio n. 2
0
 public function includes()
 {
     $files = array('class-shortcode-licenses.php');
     foreach ($files as $file) {
         require trailingslashit(donkey()->plugin_dir) . trailingslashit('inc/shortcodes') . $file;
     }
 }
Esempio n. 3
0
 function locate($template_name, $template_path = 'donkey', $default_path = '')
 {
     $template = locate_template(array(trailingslashit($template_path) . $template_name, $template_name));
     if (!$template && $default_path !== false) {
         $default_path = $default_path ? $default_path : donkey()->plugin_dir . '/templates/';
         if (file_exists(trailingslashit($default_path) . $template_name)) {
             $template = trailingslashit($default_path) . $template_name;
         }
     }
     return apply_filters('donkey_locate_template', $template, $template_name, $template_path);
 }
 public function output_shortcode($atts)
 {
     extract(shortcode_atts(array(), $atts, 'donkey_licenses'));
     $user = donkey_get_user();
     ob_start();
     if (donkey()->flash->has()) {
         donkey()->template->get('notice.php', array('message' => donkey()->flash->get()));
     }
     if (!is_user_logged_in()) {
         return donkey()->template->find('login.php');
     }
     if (!empty($_REQUEST['donkey-page'])) {
         $page = sanitize_title($_REQUEST['donkey-page']);
         if (has_action('donkey_dashboard_content_' . $page)) {
             do_action('donkey_dashboard_content_' . $page, $atts);
             return ob_get_clean();
         }
     }
     donkey()->template->get('licenses.php', array('user' => $user, 'licenses' => $user->get_licenses()));
     return ob_get_clean();
 }
Esempio n. 5
0
function donkey_get_setting($key, $default = false)
{
    return donkey()->settings->get($key, $default);
}