private static function create_files()
 {
     $upload_dir = RCL()->upload_dir();
     $files = array(array('base' => $upload_dir['basedir'], 'file' => 'index.html', 'content' => ''), array('base' => RCL_TAKEPATH, 'file' => '.htaccess', 'content' => 'Options -indexes'), array('base' => RCL_TAKEPATH, 'file' => 'index.html', 'content' => ''), array('base' => RCL_TAKEPATH . 'add-on', 'file' => 'index.html', 'content' => ''), array('base' => RCL_TAKEPATH . 'themes', 'file' => 'index.html', 'content' => ''), array('base' => RCL_TAKEPATH . 'templates', 'file' => 'index.html', 'content' => ''), array('base' => RCL_UPLOAD_PATH, 'file' => 'index.html', 'content' => ''));
     foreach ($files as $file) {
         if (wp_mkdir_p($file['base']) && !file_exists(trailingslashit($file['base']) . $file['file'])) {
             if ($file_handle = @fopen(trailingslashit($file['base']) . $file['file'], 'w')) {
                 fwrite($file_handle, $file['content']);
                 fclose($file_handle);
             }
         }
     }
 }
Пример #2
0
    public function upload_dir()
    {
        if (defined('MULTISITE')) {
            $upload_dir = array('basedir' => WP_CONTENT_DIR . '/uploads', 'baseurl' => WP_CONTENT_URL . '/uploads');
        } else {
            $upload_dir = wp_upload_dir();
        }
        if (is_ssl()) {
            $upload_dir['baseurl'] = str_replace('http://', 'https://', $upload_dir['baseurl']);
        }
        return apply_filters('wp_recall_upload_dir', $upload_dir, $this);
    }
}
/*
 * Возвращает класс WP_Recall
 * @return WP_Recall
 */
function RCL()
{
    return WP_Recall::instance();
}
/*
 * Теперь у нас есть глобальная переменная $wprecall
 * Которая содержит в себе основной класс WP_Recall
 * $
 */
$GLOBALS['wprecall'] = RCL();
function wp_recall()
{
    rcl_include_template('cabinet.php');
}