wp mkdir p

Solutions on MaxInterview for wp mkdir p by the best coders in the world

showing results for - "wp mkdir p"
Marta
17 Nov 2016
1 public function folders()
2 {
3     global $mf_domain;
4     $dir_list = "";
5     $dir_list2 = "";
6     wp_mkdir_p(MF_FILES_DIR);
7     wp_mkdir_p(MF_CACHE_DIR);
8     if (!is_dir(MF_CACHE_DIR)) {
9         $dir_list2 .= "<li>" . MF_CACHE_DIR . "</li>";
10     } elseif (!is_writable(MF_CACHE_DIR)) {
11         $dir_list .= "<li>" . MF_CACHE_DIR . "</li>";
12     }
13     if (!is_dir(MF_FILES_DIR)) {
14         $dir_list2 .= "<li>" . MF_FILES_DIR . "</li>";
15     } elseif (!is_writable(MF_FILES_DIR)) {
16         $dir_list .= "<li>" . MF_FILES_DIR . "</li>";
17     }
18     if ($dir_list2 != "") {
19         echo "<div id='magic-fields-install-error-message' class='error'><p><strong>" . __('Magic Fields is not ready yet.', $mf_domain) . "</strong> " . __('must create the following folders (and must chmod 777):', $mf_domain) . "</p><ul>";
20         echo $dir_list2;
21         echo "</ul></div>";
22     }
23     if ($dir_list != "") {
24         echo "<div id='magic-fields-install-error-message-2' class='error'><p><strong>" . __('Magic Fields is not ready yet.', $mf_domain) . "</strong> " . __('The following folders must be writable (usually chmod 777 is neccesary):', $mf_domain) . "</p><ul>";
25         echo $dir_list;
26         echo "</ul></div>";
27     }
28 }