stump-cli 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1310) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +18 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +3 -16
  6. data/Rakefile +2 -0
  7. data/bin/stump-cli +58 -0
  8. data/lib/stump-cli/version.rb +3 -0
  9. data/lib/stump.rb +5 -0
  10. data/lib/wp/Movefile-example +62 -0
  11. data/lib/wp/README.md +25 -0
  12. data/lib/wp/index.php +17 -0
  13. data/lib/wp/license.txt +385 -0
  14. data/lib/wp/readme.html +96 -0
  15. data/lib/wp/wp-activate.php +131 -0
  16. data/lib/wp/wp-admin/about.php +193 -0
  17. data/lib/wp/wp-admin/admin-ajax.php +98 -0
  18. data/lib/wp/wp-admin/admin-footer.php +99 -0
  19. data/lib/wp/wp-admin/admin-functions.php +15 -0
  20. data/lib/wp/wp-admin/admin-header.php +243 -0
  21. data/lib/wp/wp-admin/admin-post.php +71 -0
  22. data/lib/wp/wp-admin/admin.php +347 -0
  23. data/lib/wp/wp-admin/async-upload.php +114 -0
  24. data/lib/wp/wp-admin/comment.php +299 -0
  25. data/lib/wp/wp-admin/credits.php +192 -0
  26. data/lib/wp/wp-admin/css/about-rtl.css +446 -0
  27. data/lib/wp/wp-admin/css/about.css +446 -0
  28. data/lib/wp/wp-admin/css/admin-menu-rtl.css +917 -0
  29. data/lib/wp/wp-admin/css/admin-menu.css +917 -0
  30. data/lib/wp/wp-admin/css/color-picker-rtl.css +127 -0
  31. data/lib/wp/wp-admin/css/color-picker-rtl.min.css +1 -0
  32. data/lib/wp/wp-admin/css/color-picker.css +127 -0
  33. data/lib/wp/wp-admin/css/color-picker.min.css +1 -0
  34. data/lib/wp/wp-admin/css/colors/_admin.scss +525 -0
  35. data/lib/wp/wp-admin/css/colors/_mixins.scss +43 -0
  36. data/lib/wp/wp-admin/css/colors/_variables.scss +58 -0
  37. data/lib/wp/wp-admin/css/colors/blue/colors-rtl.css +341 -0
  38. data/lib/wp/wp-admin/css/colors/blue/colors-rtl.min.css +1 -0
  39. data/lib/wp/wp-admin/css/colors/blue/colors.css +341 -0
  40. data/lib/wp/wp-admin/css/colors/blue/colors.min.css +1 -0
  41. data/lib/wp/wp-admin/css/colors/blue/colors.scss +11 -0
  42. data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.css +341 -0
  43. data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.min.css +1 -0
  44. data/lib/wp/wp-admin/css/colors/coffee/colors.css +341 -0
  45. data/lib/wp/wp-admin/css/colors/coffee/colors.min.css +1 -0
  46. data/lib/wp/wp-admin/css/colors/coffee/colors.scss +7 -0
  47. data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.css +341 -0
  48. data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.min.css +1 -0
  49. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.css +341 -0
  50. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.min.css +1 -0
  51. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.scss +8 -0
  52. data/lib/wp/wp-admin/css/colors/light/colors-rtl.css +349 -0
  53. data/lib/wp/wp-admin/css/colors/light/colors-rtl.min.css +1 -0
  54. data/lib/wp/wp-admin/css/colors/light/colors.css +349 -0
  55. data/lib/wp/wp-admin/css/colors/light/colors.min.css +1 -0
  56. data/lib/wp/wp-admin/css/colors/light/colors.scss +38 -0
  57. data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.css +341 -0
  58. data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.min.css +1 -0
  59. data/lib/wp/wp-admin/css/colors/midnight/colors.css +341 -0
  60. data/lib/wp/wp-admin/css/colors/midnight/colors.min.css +1 -0
  61. data/lib/wp/wp-admin/css/colors/midnight/colors.scss +5 -0
  62. data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.css +341 -0
  63. data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.min.css +1 -0
  64. data/lib/wp/wp-admin/css/colors/ocean/colors.css +341 -0
  65. data/lib/wp/wp-admin/css/colors/ocean/colors.min.css +1 -0
  66. data/lib/wp/wp-admin/css/colors/ocean/colors.scss +8 -0
  67. data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.css +341 -0
  68. data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.min.css +1 -0
  69. data/lib/wp/wp-admin/css/colors/sunrise/colors.css +341 -0
  70. data/lib/wp/wp-admin/css/colors/sunrise/colors.min.css +1 -0
  71. data/lib/wp/wp-admin/css/colors/sunrise/colors.scss +6 -0
  72. data/lib/wp/wp-admin/css/common-rtl.css +3212 -0
  73. data/lib/wp/wp-admin/css/common.css +3212 -0
  74. data/lib/wp/wp-admin/css/customize-controls-rtl.css +889 -0
  75. data/lib/wp/wp-admin/css/customize-controls-rtl.min.css +1 -0
  76. data/lib/wp/wp-admin/css/customize-controls.css +889 -0
  77. data/lib/wp/wp-admin/css/customize-controls.min.css +1 -0
  78. data/lib/wp/wp-admin/css/customize-widgets-rtl.css +603 -0
  79. data/lib/wp/wp-admin/css/customize-widgets-rtl.min.css +1 -0
  80. data/lib/wp/wp-admin/css/customize-widgets.css +603 -0
  81. data/lib/wp/wp-admin/css/customize-widgets.min.css +1 -0
  82. data/lib/wp/wp-admin/css/dashboard-rtl.css +1116 -0
  83. data/lib/wp/wp-admin/css/dashboard.css +1116 -0
  84. data/lib/wp/wp-admin/css/deprecated-media-rtl.css +371 -0
  85. data/lib/wp/wp-admin/css/deprecated-media-rtl.min.css +1 -0
  86. data/lib/wp/wp-admin/css/deprecated-media.css +371 -0
  87. data/lib/wp/wp-admin/css/deprecated-media.min.css +1 -0
  88. data/lib/wp/wp-admin/css/edit-rtl.css +1501 -0
  89. data/lib/wp/wp-admin/css/edit.css +1501 -0
  90. data/lib/wp/wp-admin/css/farbtastic-rtl.css +41 -0
  91. data/lib/wp/wp-admin/css/farbtastic.css +41 -0
  92. data/lib/wp/wp-admin/css/forms-rtl.css +992 -0
  93. data/lib/wp/wp-admin/css/forms.css +992 -0
  94. data/lib/wp/wp-admin/css/ie-rtl.css +785 -0
  95. data/lib/wp/wp-admin/css/ie-rtl.min.css +1 -0
  96. data/lib/wp/wp-admin/css/ie.css +785 -0
  97. data/lib/wp/wp-admin/css/ie.min.css +1 -0
  98. data/lib/wp/wp-admin/css/install-rtl.css +389 -0
  99. data/lib/wp/wp-admin/css/install-rtl.min.css +1 -0
  100. data/lib/wp/wp-admin/css/install.css +389 -0
  101. data/lib/wp/wp-admin/css/install.min.css +1 -0
  102. data/lib/wp/wp-admin/css/l10n-rtl.css +101 -0
  103. data/lib/wp/wp-admin/css/l10n.css +101 -0
  104. data/lib/wp/wp-admin/css/list-tables-rtl.css +1875 -0
  105. data/lib/wp/wp-admin/css/list-tables.css +1875 -0
  106. data/lib/wp/wp-admin/css/login-rtl.css +269 -0
  107. data/lib/wp/wp-admin/css/login-rtl.min.css +1 -0
  108. data/lib/wp/wp-admin/css/login.css +269 -0
  109. data/lib/wp/wp-admin/css/login.min.css +1 -0
  110. data/lib/wp/wp-admin/css/media-rtl.css +1196 -0
  111. data/lib/wp/wp-admin/css/media.css +1196 -0
  112. data/lib/wp/wp-admin/css/nav-menus-rtl.css +857 -0
  113. data/lib/wp/wp-admin/css/nav-menus.css +857 -0
  114. data/lib/wp/wp-admin/css/press-this-rtl.css +458 -0
  115. data/lib/wp/wp-admin/css/press-this.css +458 -0
  116. data/lib/wp/wp-admin/css/revisions-rtl.css +574 -0
  117. data/lib/wp/wp-admin/css/revisions.css +574 -0
  118. data/lib/wp/wp-admin/css/themes-rtl.css +1732 -0
  119. data/lib/wp/wp-admin/css/themes.css +1732 -0
  120. data/lib/wp/wp-admin/css/widgets-rtl.css +577 -0
  121. data/lib/wp/wp-admin/css/widgets.css +577 -0
  122. data/lib/wp/wp-admin/css/wp-admin-rtl.css +14 -0
  123. data/lib/wp/wp-admin/css/wp-admin-rtl.min.css +1 -0
  124. data/lib/wp/wp-admin/css/wp-admin.css +14 -0
  125. data/lib/wp/wp-admin/css/wp-admin.min.css +1 -0
  126. data/lib/wp/wp-admin/custom-background.php +482 -0
  127. data/lib/wp/wp-admin/custom-header.php +1366 -0
  128. data/lib/wp/wp-admin/customize.php +278 -0
  129. data/lib/wp/wp-admin/edit-comments.php +254 -0
  130. data/lib/wp/wp-admin/edit-form-advanced.php +636 -0
  131. data/lib/wp/wp-admin/edit-form-comment.php +160 -0
  132. data/lib/wp/wp-admin/edit-link-form.php +150 -0
  133. data/lib/wp/wp-admin/edit-tag-form.php +204 -0
  134. data/lib/wp/wp-admin/edit-tags.php +591 -0
  135. data/lib/wp/wp-admin/edit.php +330 -0
  136. data/lib/wp/wp-admin/export.php +243 -0
  137. data/lib/wp/wp-admin/freedoms.php +57 -0
  138. data/lib/wp/wp-admin/images/align-center-2x.png +0 -0
  139. data/lib/wp/wp-admin/images/align-center.png +0 -0
  140. data/lib/wp/wp-admin/images/align-left-2x.png +0 -0
  141. data/lib/wp/wp-admin/images/align-left.png +0 -0
  142. data/lib/wp/wp-admin/images/align-none-2x.png +0 -0
  143. data/lib/wp/wp-admin/images/align-none.png +0 -0
  144. data/lib/wp/wp-admin/images/align-right-2x.png +0 -0
  145. data/lib/wp/wp-admin/images/align-right.png +0 -0
  146. data/lib/wp/wp-admin/images/arrows-2x.png +0 -0
  147. data/lib/wp/wp-admin/images/arrows.png +0 -0
  148. data/lib/wp/wp-admin/images/bubble_bg-2x.gif +0 -0
  149. data/lib/wp/wp-admin/images/bubble_bg.gif +0 -0
  150. data/lib/wp/wp-admin/images/comment-grey-bubble-2x.png +0 -0
  151. data/lib/wp/wp-admin/images/comment-grey-bubble.png +0 -0
  152. data/lib/wp/wp-admin/images/date-button-2x.gif +0 -0
  153. data/lib/wp/wp-admin/images/date-button.gif +0 -0
  154. data/lib/wp/wp-admin/images/generic.png +0 -0
  155. data/lib/wp/wp-admin/images/icons32-2x.png +0 -0
  156. data/lib/wp/wp-admin/images/icons32-vs-2x.png +0 -0
  157. data/lib/wp/wp-admin/images/icons32-vs.png +0 -0
  158. data/lib/wp/wp-admin/images/icons32.png +0 -0
  159. data/lib/wp/wp-admin/images/imgedit-icons-2x.png +0 -0
  160. data/lib/wp/wp-admin/images/imgedit-icons.png +0 -0
  161. data/lib/wp/wp-admin/images/list-2x.png +0 -0
  162. data/lib/wp/wp-admin/images/list.png +0 -0
  163. data/lib/wp/wp-admin/images/loading.gif +0 -0
  164. data/lib/wp/wp-admin/images/marker.png +0 -0
  165. data/lib/wp/wp-admin/images/mask.png +0 -0
  166. data/lib/wp/wp-admin/images/media-button-2x.png +0 -0
  167. data/lib/wp/wp-admin/images/media-button-image.gif +0 -0
  168. data/lib/wp/wp-admin/images/media-button-music.gif +0 -0
  169. data/lib/wp/wp-admin/images/media-button-other.gif +0 -0
  170. data/lib/wp/wp-admin/images/media-button-video.gif +0 -0
  171. data/lib/wp/wp-admin/images/media-button.png +0 -0
  172. data/lib/wp/wp-admin/images/menu-2x.png +0 -0
  173. data/lib/wp/wp-admin/images/menu-vs-2x.png +0 -0
  174. data/lib/wp/wp-admin/images/menu-vs.png +0 -0
  175. data/lib/wp/wp-admin/images/menu.png +0 -0
  176. data/lib/wp/wp-admin/images/no.png +0 -0
  177. data/lib/wp/wp-admin/images/post-formats-vs.png +0 -0
  178. data/lib/wp/wp-admin/images/post-formats.png +0 -0
  179. data/lib/wp/wp-admin/images/post-formats32-vs.png +0 -0
  180. data/lib/wp/wp-admin/images/post-formats32.png +0 -0
  181. data/lib/wp/wp-admin/images/resize-2x.gif +0 -0
  182. data/lib/wp/wp-admin/images/resize-rtl-2x.gif +0 -0
  183. data/lib/wp/wp-admin/images/resize-rtl.gif +0 -0
  184. data/lib/wp/wp-admin/images/resize.gif +0 -0
  185. data/lib/wp/wp-admin/images/se.png +0 -0
  186. data/lib/wp/wp-admin/images/sort-2x.gif +0 -0
  187. data/lib/wp/wp-admin/images/sort.gif +0 -0
  188. data/lib/wp/wp-admin/images/spinner-2x.gif +0 -0
  189. data/lib/wp/wp-admin/images/spinner.gif +0 -0
  190. data/lib/wp/wp-admin/images/stars-2x.png +0 -0
  191. data/lib/wp/wp-admin/images/stars.png +0 -0
  192. data/lib/wp/wp-admin/images/w-logo-blue.png +0 -0
  193. data/lib/wp/wp-admin/images/w-logo-white.png +0 -0
  194. data/lib/wp/wp-admin/images/wheel.png +0 -0
  195. data/lib/wp/wp-admin/images/wordpress-logo-white.svg +1 -0
  196. data/lib/wp/wp-admin/images/wordpress-logo.png +0 -0
  197. data/lib/wp/wp-admin/images/wordpress-logo.svg +1 -0
  198. data/lib/wp/wp-admin/images/wpspin_light-2x.gif +0 -0
  199. data/lib/wp/wp-admin/images/wpspin_light.gif +0 -0
  200. data/lib/wp/wp-admin/images/xit-2x.gif +0 -0
  201. data/lib/wp/wp-admin/images/xit.gif +0 -0
  202. data/lib/wp/wp-admin/images/yes.png +0 -0
  203. data/lib/wp/wp-admin/import.php +132 -0
  204. data/lib/wp/wp-admin/includes/admin.php +74 -0
  205. data/lib/wp/wp-admin/includes/ajax-actions.php +2762 -0
  206. data/lib/wp/wp-admin/includes/bookmark.php +305 -0
  207. data/lib/wp/wp-admin/includes/class-ftp-pure.php +190 -0
  208. data/lib/wp/wp-admin/includes/class-ftp-sockets.php +250 -0
  209. data/lib/wp/wp-admin/includes/class-ftp.php +907 -0
  210. data/lib/wp/wp-admin/includes/class-pclzip.php +5687 -0
  211. data/lib/wp/wp-admin/includes/class-wp-comments-list-table.php +637 -0
  212. data/lib/wp/wp-admin/includes/class-wp-filesystem-base.php +815 -0
  213. data/lib/wp/wp-admin/includes/class-wp-filesystem-direct.php +384 -0
  214. data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpext.php +415 -0
  215. data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php +352 -0
  216. data/lib/wp/wp-admin/includes/class-wp-filesystem-ssh2.php +392 -0
  217. data/lib/wp/wp-admin/includes/class-wp-importer.php +302 -0
  218. data/lib/wp/wp-admin/includes/class-wp-links-list-table.php +207 -0
  219. data/lib/wp/wp-admin/includes/class-wp-list-table.php +1080 -0
  220. data/lib/wp/wp-admin/includes/class-wp-media-list-table.php +574 -0
  221. data/lib/wp/wp-admin/includes/class-wp-ms-sites-list-table.php +402 -0
  222. data/lib/wp/wp-admin/includes/class-wp-ms-themes-list-table.php +459 -0
  223. data/lib/wp/wp-admin/includes/class-wp-ms-users-list-table.php +303 -0
  224. data/lib/wp/wp-admin/includes/class-wp-plugin-install-list-table.php +490 -0
  225. data/lib/wp/wp-admin/includes/class-wp-plugins-list-table.php +605 -0
  226. data/lib/wp/wp-admin/includes/class-wp-posts-list-table.php +1306 -0
  227. data/lib/wp/wp-admin/includes/class-wp-terms-list-table.php +466 -0
  228. data/lib/wp/wp-admin/includes/class-wp-theme-install-list-table.php +431 -0
  229. data/lib/wp/wp-admin/includes/class-wp-themes-list-table.php +279 -0
  230. data/lib/wp/wp-admin/includes/class-wp-upgrader-skins.php +767 -0
  231. data/lib/wp/wp-admin/includes/class-wp-upgrader.php +2676 -0
  232. data/lib/wp/wp-admin/includes/class-wp-users-list-table.php +459 -0
  233. data/lib/wp/wp-admin/includes/comment.php +171 -0
  234. data/lib/wp/wp-admin/includes/continents-cities.php +493 -0
  235. data/lib/wp/wp-admin/includes/dashboard.php +1333 -0
  236. data/lib/wp/wp-admin/includes/deprecated.php +1190 -0
  237. data/lib/wp/wp-admin/includes/export.php +508 -0
  238. data/lib/wp/wp-admin/includes/file.php +1152 -0
  239. data/lib/wp/wp-admin/includes/image-edit.php +828 -0
  240. data/lib/wp/wp-admin/includes/image.php +598 -0
  241. data/lib/wp/wp-admin/includes/import.php +206 -0
  242. data/lib/wp/wp-admin/includes/list-table.php +113 -0
  243. data/lib/wp/wp-admin/includes/media.php +3012 -0
  244. data/lib/wp/wp-admin/includes/menu.php +322 -0
  245. data/lib/wp/wp-admin/includes/meta-boxes.php +1119 -0
  246. data/lib/wp/wp-admin/includes/misc.php +845 -0
  247. data/lib/wp/wp-admin/includes/ms-deprecated.php +78 -0
  248. data/lib/wp/wp-admin/includes/ms.php +814 -0
  249. data/lib/wp/wp-admin/includes/nav-menu.php +1328 -0
  250. data/lib/wp/wp-admin/includes/plugin-install.php +550 -0
  251. data/lib/wp/wp-admin/includes/plugin.php +1899 -0
  252. data/lib/wp/wp-admin/includes/post.php +1661 -0
  253. data/lib/wp/wp-admin/includes/revision.php +228 -0
  254. data/lib/wp/wp-admin/includes/schema.php +1038 -0
  255. data/lib/wp/wp-admin/includes/screen.php +1179 -0
  256. data/lib/wp/wp-admin/includes/taxonomy.php +284 -0
  257. data/lib/wp/wp-admin/includes/template.php +2157 -0
  258. data/lib/wp/wp-admin/includes/theme-install.php +205 -0
  259. data/lib/wp/wp-admin/includes/theme.php +474 -0
  260. data/lib/wp/wp-admin/includes/translation-install.php +240 -0
  261. data/lib/wp/wp-admin/includes/update-core.php +1186 -0
  262. data/lib/wp/wp-admin/includes/update.php +432 -0
  263. data/lib/wp/wp-admin/includes/upgrade.php +2218 -0
  264. data/lib/wp/wp-admin/includes/user.php +442 -0
  265. data/lib/wp/wp-admin/includes/widgets.php +245 -0
  266. data/lib/wp/wp-admin/index.php +131 -0
  267. data/lib/wp/wp-admin/install-helper.php +199 -0
  268. data/lib/wp/wp-admin/install.php +305 -0
  269. data/lib/wp/wp-admin/js/accordion.js +143 -0
  270. data/lib/wp/wp-admin/js/accordion.min.js +1 -0
  271. data/lib/wp/wp-admin/js/color-picker.js +155 -0
  272. data/lib/wp/wp-admin/js/color-picker.min.js +1 -0
  273. data/lib/wp/wp-admin/js/comment.js +50 -0
  274. data/lib/wp/wp-admin/js/comment.min.js +1 -0
  275. data/lib/wp/wp-admin/js/common.js +804 -0
  276. data/lib/wp/wp-admin/js/common.min.js +1 -0
  277. data/lib/wp/wp-admin/js/custom-background.js +75 -0
  278. data/lib/wp/wp-admin/js/custom-background.min.js +1 -0
  279. data/lib/wp/wp-admin/js/custom-header.js +61 -0
  280. data/lib/wp/wp-admin/js/customize-controls.js +1305 -0
  281. data/lib/wp/wp-admin/js/customize-controls.min.js +1 -0
  282. data/lib/wp/wp-admin/js/customize-widgets.js +1882 -0
  283. data/lib/wp/wp-admin/js/customize-widgets.min.js +1 -0
  284. data/lib/wp/wp-admin/js/dashboard.js +190 -0
  285. data/lib/wp/wp-admin/js/dashboard.min.js +1 -0
  286. data/lib/wp/wp-admin/js/edit-comments.js +625 -0
  287. data/lib/wp/wp-admin/js/edit-comments.min.js +1 -0
  288. data/lib/wp/wp-admin/js/editor-expand.js +705 -0
  289. data/lib/wp/wp-admin/js/editor-expand.min.js +1 -0
  290. data/lib/wp/wp-admin/js/editor.js +324 -0
  291. data/lib/wp/wp-admin/js/editor.min.js +1 -0
  292. data/lib/wp/wp-admin/js/farbtastic.js +276 -0
  293. data/lib/wp/wp-admin/js/gallery.js +237 -0
  294. data/lib/wp/wp-admin/js/gallery.min.js +1 -0
  295. data/lib/wp/wp-admin/js/image-edit.js +633 -0
  296. data/lib/wp/wp-admin/js/image-edit.min.js +1 -0
  297. data/lib/wp/wp-admin/js/inline-edit-post.js +359 -0
  298. data/lib/wp/wp-admin/js/inline-edit-post.min.js +1 -0
  299. data/lib/wp/wp-admin/js/inline-edit-tax.js +142 -0
  300. data/lib/wp/wp-admin/js/inline-edit-tax.min.js +1 -0
  301. data/lib/wp/wp-admin/js/iris.min.js +4 -0
  302. data/lib/wp/wp-admin/js/language-chooser.js +26 -0
  303. data/lib/wp/wp-admin/js/language-chooser.min.js +1 -0
  304. data/lib/wp/wp-admin/js/link.js +69 -0
  305. data/lib/wp/wp-admin/js/link.min.js +1 -0
  306. data/lib/wp/wp-admin/js/media-gallery.js +26 -0
  307. data/lib/wp/wp-admin/js/media-gallery.min.js +1 -0
  308. data/lib/wp/wp-admin/js/media-upload.js +69 -0
  309. data/lib/wp/wp-admin/js/media-upload.min.js +1 -0
  310. data/lib/wp/wp-admin/js/media.js +111 -0
  311. data/lib/wp/wp-admin/js/media.min.js +1 -0
  312. data/lib/wp/wp-admin/js/nav-menu.js +1205 -0
  313. data/lib/wp/wp-admin/js/nav-menu.min.js +1 -0
  314. data/lib/wp/wp-admin/js/password-strength-meter.js +75 -0
  315. data/lib/wp/wp-admin/js/password-strength-meter.min.js +1 -0
  316. data/lib/wp/wp-admin/js/plugin-install.js +76 -0
  317. data/lib/wp/wp-admin/js/plugin-install.min.js +1 -0
  318. data/lib/wp/wp-admin/js/post.js +1094 -0
  319. data/lib/wp/wp-admin/js/post.min.js +1 -0
  320. data/lib/wp/wp-admin/js/postbox.js +199 -0
  321. data/lib/wp/wp-admin/js/postbox.min.js +1 -0
  322. data/lib/wp/wp-admin/js/revisions.js +1110 -0
  323. data/lib/wp/wp-admin/js/revisions.min.js +1 -0
  324. data/lib/wp/wp-admin/js/set-post-thumbnail.js +24 -0
  325. data/lib/wp/wp-admin/js/set-post-thumbnail.min.js +1 -0
  326. data/lib/wp/wp-admin/js/svg-painter.js +240 -0
  327. data/lib/wp/wp-admin/js/svg-painter.min.js +1 -0
  328. data/lib/wp/wp-admin/js/tags.js +72 -0
  329. data/lib/wp/wp-admin/js/tags.min.js +1 -0
  330. data/lib/wp/wp-admin/js/theme.js +1691 -0
  331. data/lib/wp/wp-admin/js/theme.min.js +1 -0
  332. data/lib/wp/wp-admin/js/updates.js +65 -0
  333. data/lib/wp/wp-admin/js/updates.min.js +1 -0
  334. data/lib/wp/wp-admin/js/user-profile.js +127 -0
  335. data/lib/wp/wp-admin/js/user-profile.min.js +1 -0
  336. data/lib/wp/wp-admin/js/user-suggest.js +30 -0
  337. data/lib/wp/wp-admin/js/user-suggest.min.js +1 -0
  338. data/lib/wp/wp-admin/js/widgets.js +494 -0
  339. data/lib/wp/wp-admin/js/widgets.min.js +1 -0
  340. data/lib/wp/wp-admin/js/word-count.js +44 -0
  341. data/lib/wp/wp-admin/js/word-count.min.js +1 -0
  342. data/lib/wp/wp-admin/js/wp-fullscreen.js +704 -0
  343. data/lib/wp/wp-admin/js/wp-fullscreen.min.js +1 -0
  344. data/lib/wp/wp-admin/js/xfn.js +17 -0
  345. data/lib/wp/wp-admin/js/xfn.min.js +1 -0
  346. data/lib/wp/wp-admin/link-add.php +29 -0
  347. data/lib/wp/wp-admin/link-manager.php +99 -0
  348. data/lib/wp/wp-admin/link-parse-opml.php +84 -0
  349. data/lib/wp/wp-admin/link.php +117 -0
  350. data/lib/wp/wp-admin/load-scripts.php +162 -0
  351. data/lib/wp/wp-admin/load-styles.php +153 -0
  352. data/lib/wp/wp-admin/maint/repair.php +124 -0
  353. data/lib/wp/wp-admin/media-new.php +84 -0
  354. data/lib/wp/wp-admin/media-upload.php +100 -0
  355. data/lib/wp/wp-admin/media.php +146 -0
  356. data/lib/wp/wp-admin/menu-header.php +227 -0
  357. data/lib/wp/wp-admin/menu.php +255 -0
  358. data/lib/wp/wp-admin/moderation.php +12 -0
  359. data/lib/wp/wp-admin/ms-admin.php +13 -0
  360. data/lib/wp/wp-admin/ms-delete-site.php +91 -0
  361. data/lib/wp/wp-admin/ms-edit.php +13 -0
  362. data/lib/wp/wp-admin/ms-options.php +12 -0
  363. data/lib/wp/wp-admin/ms-sites.php +13 -0
  364. data/lib/wp/wp-admin/ms-themes.php +13 -0
  365. data/lib/wp/wp-admin/ms-upgrade-network.php +13 -0
  366. data/lib/wp/wp-admin/ms-users.php +13 -0
  367. data/lib/wp/wp-admin/my-sites.php +145 -0
  368. data/lib/wp/wp-admin/nav-menus.php +798 -0
  369. data/lib/wp/wp-admin/network.php +561 -0
  370. data/lib/wp/wp-admin/network/about.php +16 -0
  371. data/lib/wp/wp-admin/network/admin.php +32 -0
  372. data/lib/wp/wp-admin/network/credits.php +16 -0
  373. data/lib/wp/wp-admin/network/edit.php +42 -0
  374. data/lib/wp/wp-admin/network/freedoms.php +16 -0
  375. data/lib/wp/wp-admin/network/index.php +79 -0
  376. data/lib/wp/wp-admin/network/menu.php +63 -0
  377. data/lib/wp/wp-admin/network/plugin-editor.php +16 -0
  378. data/lib/wp/wp-admin/network/plugin-install.php +19 -0
  379. data/lib/wp/wp-admin/network/plugins.php +16 -0
  380. data/lib/wp/wp-admin/network/profile.php +16 -0
  381. data/lib/wp/wp-admin/network/settings.php +347 -0
  382. data/lib/wp/wp-admin/network/setup.php +16 -0
  383. data/lib/wp/wp-admin/network/site-info.php +178 -0
  384. data/lib/wp/wp-admin/network/site-new.php +153 -0
  385. data/lib/wp/wp-admin/network/site-settings.php +173 -0
  386. data/lib/wp/wp-admin/network/site-themes.php +185 -0
  387. data/lib/wp/wp-admin/network/site-users.php +319 -0
  388. data/lib/wp/wp-admin/network/sites.php +275 -0
  389. data/lib/wp/wp-admin/network/theme-editor.php +16 -0
  390. data/lib/wp/wp-admin/network/theme-install.php +19 -0
  391. data/lib/wp/wp-admin/network/themes.php +291 -0
  392. data/lib/wp/wp-admin/network/update-core.php +16 -0
  393. data/lib/wp/wp-admin/network/update.php +19 -0
  394. data/lib/wp/wp-admin/network/upgrade.php +120 -0
  395. data/lib/wp/wp-admin/network/user-edit.php +16 -0
  396. data/lib/wp/wp-admin/network/user-new.php +106 -0
  397. data/lib/wp/wp-admin/network/users.php +296 -0
  398. data/lib/wp/wp-admin/options-discussion.php +273 -0
  399. data/lib/wp/wp-admin/options-general.php +355 -0
  400. data/lib/wp/wp-admin/options-head.php +18 -0
  401. data/lib/wp/wp-admin/options-media.php +136 -0
  402. data/lib/wp/wp-admin/options-permalink.php +289 -0
  403. data/lib/wp/wp-admin/options-reading.php +184 -0
  404. data/lib/wp/wp-admin/options-writing.php +194 -0
  405. data/lib/wp/wp-admin/options.php +265 -0
  406. data/lib/wp/wp-admin/plugin-editor.php +279 -0
  407. data/lib/wp/wp-admin/plugin-install.php +134 -0
  408. data/lib/wp/wp-admin/plugins.php +474 -0
  409. data/lib/wp/wp-admin/post-new.php +74 -0
  410. data/lib/wp/wp-admin/post.php +318 -0
  411. data/lib/wp/wp-admin/press-this.php +691 -0
  412. data/lib/wp/wp-admin/profile.php +18 -0
  413. data/lib/wp/wp-admin/revision.php +221 -0
  414. data/lib/wp/wp-admin/setup-config.php +345 -0
  415. data/lib/wp/wp-admin/theme-editor.php +243 -0
  416. data/lib/wp/wp-admin/theme-install.php +278 -0
  417. data/lib/wp/wp-admin/themes.php +374 -0
  418. data/lib/wp/wp-admin/tools.php +75 -0
  419. data/lib/wp/wp-admin/update-core.php +653 -0
  420. data/lib/wp/wp-admin/update.php +272 -0
  421. data/lib/wp/wp-admin/upgrade-functions.php +12 -0
  422. data/lib/wp/wp-admin/upgrade.php +116 -0
  423. data/lib/wp/wp-admin/upload.php +292 -0
  424. data/lib/wp/wp-admin/user-edit.php +557 -0
  425. data/lib/wp/wp-admin/user-new.php +439 -0
  426. data/lib/wp/wp-admin/user/about.php +13 -0
  427. data/lib/wp/wp-admin/user/admin.php +32 -0
  428. data/lib/wp/wp-admin/user/credits.php +13 -0
  429. data/lib/wp/wp-admin/user/freedoms.php +13 -0
  430. data/lib/wp/wp-admin/user/index.php +12 -0
  431. data/lib/wp/wp-admin/user/menu.php +22 -0
  432. data/lib/wp/wp-admin/user/profile.php +12 -0
  433. data/lib/wp/wp-admin/user/user-edit.php +12 -0
  434. data/lib/wp/wp-admin/users.php +460 -0
  435. data/lib/wp/wp-admin/widgets.php +442 -0
  436. data/lib/wp/wp-blog-header.php +18 -0
  437. data/lib/wp/wp-comments-post.php +164 -0
  438. data/lib/wp/wp-config-sample.php +80 -0
  439. data/lib/wp/wp-content/index.php +2 -0
  440. data/lib/wp/wp-content/plugins/hello.php +82 -0
  441. data/lib/wp/wp-content/plugins/index.php +2 -0
  442. data/lib/wp/wp-content/themes/index.php +2 -0
  443. data/lib/wp/wp-content/themes/stump/.editorconfig +11 -0
  444. data/lib/wp/wp-content/themes/stump/.jshintrc +16 -0
  445. data/lib/wp/wp-content/themes/stump/404.php +13 -0
  446. data/lib/wp/wp-content/themes/stump/CHANGELOG.md +333 -0
  447. data/lib/wp/wp-content/themes/stump/CONTRIBUTING.md +121 -0
  448. data/lib/wp/wp-content/themes/stump/Gruntfile.js +151 -0
  449. data/lib/wp/wp-content/themes/stump/LICENSE.md +19 -0
  450. data/lib/wp/wp-content/themes/stump/assets/coffee/build/.gitkeep +0 -0
  451. data/lib/wp/wp-content/themes/stump/assets/coffee/build/site.js +6 -0
  452. data/lib/wp/wp-content/themes/stump/assets/css/editor-style.css +548 -0
  453. data/lib/wp/wp-content/themes/stump/assets/css/main.min.css +4 -0
  454. data/lib/wp/wp-content/themes/stump/assets/css/main.min.css.map +7 -0
  455. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  456. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  457. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  458. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  459. data/lib/wp/wp-content/themes/stump/assets/img/.gitignore +0 -0
  460. data/lib/wp/wp-content/themes/stump/assets/js/_main.js +63 -0
  461. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/affix.js +137 -0
  462. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/alert.js +88 -0
  463. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/button.js +107 -0
  464. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/carousel.js +205 -0
  465. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/collapse.js +170 -0
  466. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/dropdown.js +147 -0
  467. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/modal.js +243 -0
  468. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/popover.js +110 -0
  469. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/scrollspy.js +153 -0
  470. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tab.js +125 -0
  471. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tooltip.js +399 -0
  472. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/transition.js +48 -0
  473. data/lib/wp/wp-content/themes/stump/assets/js/scripts.min.js +1 -0
  474. data/lib/wp/wp-content/themes/stump/assets/js/vendor/jquery-1.11.0.min.js +4 -0
  475. data/lib/wp/wp-content/themes/stump/assets/js/vendor/modernizr-2.7.0.min.js +4 -0
  476. data/lib/wp/wp-content/themes/stump/assets/sass/app.scss +9 -0
  477. data/lib/wp/wp-content/themes/stump/assets/sass/core/_variables.scss +1 -0
  478. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_alerts.scss +67 -0
  479. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_badges.scss +55 -0
  480. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_bootstrap.scss +49 -0
  481. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_breadcrumbs.scss +26 -0
  482. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_button-groups.scss +226 -0
  483. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_buttons.scss +159 -0
  484. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_carousel.scss +232 -0
  485. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_close.scss +35 -0
  486. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_code.scss +63 -0
  487. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_component-animations.scss +29 -0
  488. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_dropdowns.scss +213 -0
  489. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_forms.scss +436 -0
  490. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_glyphicons.scss +233 -0
  491. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_grid.scss +84 -0
  492. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_input-groups.scss +162 -0
  493. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_jumbotron.scss +44 -0
  494. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_labels.scss +64 -0
  495. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_list-group.scss +110 -0
  496. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_media.scss +56 -0
  497. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_mixins.scss +947 -0
  498. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_modals.scss +139 -0
  499. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navbar.scss +620 -0
  500. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navs.scss +242 -0
  501. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_normalize.scss +423 -0
  502. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pager.scss +55 -0
  503. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pagination.scss +88 -0
  504. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_panels.scss +241 -0
  505. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_popovers.scss +133 -0
  506. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_print.scss +101 -0
  507. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_progress-bars.scss +80 -0
  508. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_responsive-utilities.scss +74 -0
  509. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_scaffolding.scss +134 -0
  510. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tables.scss +233 -0
  511. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_theme.scss +247 -0
  512. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_thumbnails.scss +38 -0
  513. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tooltip.scss +95 -0
  514. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_type.scss +284 -0
  515. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_utilities.scss +56 -0
  516. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_variables.scss +833 -0
  517. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_wells.scss +29 -0
  518. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon-deprecated-upcoming.scss +13 -0
  519. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon.scss +59 -0
  520. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_button.scss +273 -0
  521. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_clearfix.scss +29 -0
  522. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_font-family.scss +5 -0
  523. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_hide-text.scss +5 -0
  524. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_html5-input-types.scss +56 -0
  525. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_position.scss +42 -0
  526. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_prefixer.scss +49 -0
  527. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_retina-image.scss +32 -0
  528. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_size.scss +44 -0
  529. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_timing-functions.scss +32 -0
  530. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_triangle.scss +45 -0
  531. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_animation.scss +52 -0
  532. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_appearance.scss +3 -0
  533. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_backface-visibility.scss +6 -0
  534. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background-image.scss +48 -0
  535. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background.scss +103 -0
  536. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-image.scss +55 -0
  537. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-radius.scss +22 -0
  538. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_box-sizing.scss +4 -0
  539. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_columns.scss +47 -0
  540. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_flex-box.scss +52 -0
  541. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_font-face.scss +23 -0
  542. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_hidpi-media-query.scss +10 -0
  543. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_image-rendering.scss +13 -0
  544. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_inline-block.scss +8 -0
  545. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_keyframes.scss +43 -0
  546. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_linear-gradient.scss +41 -0
  547. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_perspective.scss +8 -0
  548. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_placeholder.scss +29 -0
  549. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_radial-gradient.scss +44 -0
  550. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transform.scss +15 -0
  551. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transition.scss +34 -0
  552. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_user-select.scss +3 -0
  553. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_compact.scss +11 -0
  554. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_flex-grid.scss +39 -0
  555. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_grid-width.scss +13 -0
  556. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_linear-gradient.scss +13 -0
  557. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_modular-scale.scss +40 -0
  558. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_px-to-em.scss +8 -0
  559. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_radial-gradient.scss +23 -0
  560. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_tint-shade.scss +9 -0
  561. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_transition-property-name.scss +22 -0
  562. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_deprecated-webkit-gradient.scss +39 -0
  563. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_gradient-positions-parser.scss +13 -0
  564. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_linear-positions-parser.scss +61 -0
  565. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-arg-parser.scss +69 -0
  566. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-positions-parser.scss +18 -0
  567. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_render-gradients.scss +26 -0
  568. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_shape-size-stripper.scss +10 -0
  569. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan.sass +11 -0
  570. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_grid.sass +161 -0
  571. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_mixins.sass +63 -0
  572. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_utilities.sass +24 -0
  573. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_variables.sass +42 -0
  574. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat-helpers.scss +8 -0
  575. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat.scss +21 -0
  576. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_new-breakpoint.scss +16 -0
  577. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_private.scss +107 -0
  578. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_px-to-em.scss +3 -0
  579. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_fill-parent.scss +7 -0
  580. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_grid.scss +5 -0
  581. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_media.scss +51 -0
  582. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_omega.scss +79 -0
  583. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_outer-container.scss +8 -0
  584. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_pad.scss +8 -0
  585. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_private.scss +50 -0
  586. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_reset.scss +12 -0
  587. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_row.scss +17 -0
  588. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_shift.scss +9 -0
  589. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_span-columns.scss +38 -0
  590. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_to-deprecate.scss +57 -0
  591. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_visual-grid.scss +41 -0
  592. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_grid.scss +7 -0
  593. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_visual-grid.scss +5 -0
  594. data/lib/wp/wp-content/themes/stump/base.php +36 -0
  595. data/lib/wp/wp-content/themes/stump/functions.php +19 -0
  596. data/lib/wp/wp-content/themes/stump/index.php +21 -0
  597. data/lib/wp/wp-content/themes/stump/lang/ar.mo +0 -0
  598. data/lib/wp/wp-content/themes/stump/lang/ar.po +270 -0
  599. data/lib/wp/wp-content/themes/stump/lang/bg_BG.mo +0 -0
  600. data/lib/wp/wp-content/themes/stump/lang/bg_BG.po +338 -0
  601. data/lib/wp/wp-content/themes/stump/lang/ca.mo +0 -0
  602. data/lib/wp/wp-content/themes/stump/lang/ca.po +517 -0
  603. data/lib/wp/wp-content/themes/stump/lang/da_DK.mo +0 -0
  604. data/lib/wp/wp-content/themes/stump/lang/da_DK.po +305 -0
  605. data/lib/wp/wp-content/themes/stump/lang/de_DE.mo +0 -0
  606. data/lib/wp/wp-content/themes/stump/lang/de_DE.po +271 -0
  607. data/lib/wp/wp-content/themes/stump/lang/el.mo +0 -0
  608. data/lib/wp/wp-content/themes/stump/lang/el.po +319 -0
  609. data/lib/wp/wp-content/themes/stump/lang/es_ES.mo +0 -0
  610. data/lib/wp/wp-content/themes/stump/lang/es_ES.po +270 -0
  611. data/lib/wp/wp-content/themes/stump/lang/et.mo +0 -0
  612. data/lib/wp/wp-content/themes/stump/lang/et.po +262 -0
  613. data/lib/wp/wp-content/themes/stump/lang/fa_IR.mo +0 -0
  614. data/lib/wp/wp-content/themes/stump/lang/fa_IR.po +273 -0
  615. data/lib/wp/wp-content/themes/stump/lang/fi_FI.mo +0 -0
  616. data/lib/wp/wp-content/themes/stump/lang/fi_FI.po +367 -0
  617. data/lib/wp/wp-content/themes/stump/lang/fr_FR.mo +0 -0
  618. data/lib/wp/wp-content/themes/stump/lang/fr_FR.po +336 -0
  619. data/lib/wp/wp-content/themes/stump/lang/he_IL.mo +0 -0
  620. data/lib/wp/wp-content/themes/stump/lang/he_IL.po +336 -0
  621. data/lib/wp/wp-content/themes/stump/lang/hu_HU.mo +0 -0
  622. data/lib/wp/wp-content/themes/stump/lang/hu_HU.po +271 -0
  623. data/lib/wp/wp-content/themes/stump/lang/id_ID.mo +0 -0
  624. data/lib/wp/wp-content/themes/stump/lang/id_ID.po +278 -0
  625. data/lib/wp/wp-content/themes/stump/lang/it_IT.mo +0 -0
  626. data/lib/wp/wp-content/themes/stump/lang/it_IT.po +269 -0
  627. data/lib/wp/wp-content/themes/stump/lang/ja.mo +0 -0
  628. data/lib/wp/wp-content/themes/stump/lang/ja.po +267 -0
  629. data/lib/wp/wp-content/themes/stump/lang/ko_KR.mo +0 -0
  630. data/lib/wp/wp-content/themes/stump/lang/ko_KR.po +282 -0
  631. data/lib/wp/wp-content/themes/stump/lang/mk_MK.mo +0 -0
  632. data/lib/wp/wp-content/themes/stump/lang/mk_MK.po +297 -0
  633. data/lib/wp/wp-content/themes/stump/lang/ms_MY.mo +0 -0
  634. data/lib/wp/wp-content/themes/stump/lang/ms_MY.po +342 -0
  635. data/lib/wp/wp-content/themes/stump/lang/nb_NO.mo +0 -0
  636. data/lib/wp/wp-content/themes/stump/lang/nb_NO.po +517 -0
  637. data/lib/wp/wp-content/themes/stump/lang/nl_NL.mo +0 -0
  638. data/lib/wp/wp-content/themes/stump/lang/nl_NL.po +261 -0
  639. data/lib/wp/wp-content/themes/stump/lang/nn_NO.mo +0 -0
  640. data/lib/wp/wp-content/themes/stump/lang/nn_NO.po +517 -0
  641. data/lib/wp/wp-content/themes/stump/lang/pl_PL.mo +0 -0
  642. data/lib/wp/wp-content/themes/stump/lang/pl_PL.po +283 -0
  643. data/lib/wp/wp-content/themes/stump/lang/pt_BR.mo +0 -0
  644. data/lib/wp/wp-content/themes/stump/lang/pt_BR.po +394 -0
  645. data/lib/wp/wp-content/themes/stump/lang/ro_RO.mo +0 -0
  646. data/lib/wp/wp-content/themes/stump/lang/ro_RO.po +271 -0
  647. data/lib/wp/wp-content/themes/stump/lang/roots.pot +244 -0
  648. data/lib/wp/wp-content/themes/stump/lang/ru_RU.mo +0 -0
  649. data/lib/wp/wp-content/themes/stump/lang/ru_RU.po +255 -0
  650. data/lib/wp/wp-content/themes/stump/lang/sk_SK.mo +0 -0
  651. data/lib/wp/wp-content/themes/stump/lang/sk_SK.po +267 -0
  652. data/lib/wp/wp-content/themes/stump/lang/sr_RS.mo +0 -0
  653. data/lib/wp/wp-content/themes/stump/lang/sr_RS.pot +261 -0
  654. data/lib/wp/wp-content/themes/stump/lang/sv_SE.mo +0 -0
  655. data/lib/wp/wp-content/themes/stump/lang/sv_SE.po +323 -0
  656. data/lib/wp/wp-content/themes/stump/lang/tr_TR.mo +0 -0
  657. data/lib/wp/wp-content/themes/stump/lang/tr_TR.po +405 -0
  658. data/lib/wp/wp-content/themes/stump/lang/vi_VN.mo +0 -0
  659. data/lib/wp/wp-content/themes/stump/lang/vi_VN.po +516 -0
  660. data/lib/wp/wp-content/themes/stump/lang/zh_CN.mo +0 -0
  661. data/lib/wp/wp-content/themes/stump/lang/zh_CN.po +329 -0
  662. data/lib/wp/wp-content/themes/stump/lang/zh_TW.mo +0 -0
  663. data/lib/wp/wp-content/themes/stump/lang/zh_TW.po +261 -0
  664. data/lib/wp/wp-content/themes/stump/lib/activation.php +215 -0
  665. data/lib/wp/wp-content/themes/stump/lib/cleanup.php +261 -0
  666. data/lib/wp/wp-content/themes/stump/lib/comments.php +52 -0
  667. data/lib/wp/wp-content/themes/stump/lib/config.php +79 -0
  668. data/lib/wp/wp-content/themes/stump/lib/custom.php +4 -0
  669. data/lib/wp/wp-content/themes/stump/lib/gallery.php +130 -0
  670. data/lib/wp/wp-content/themes/stump/lib/init.php +25 -0
  671. data/lib/wp/wp-content/themes/stump/lib/nav.php +93 -0
  672. data/lib/wp/wp-content/themes/stump/lib/relative-urls.php +50 -0
  673. data/lib/wp/wp-content/themes/stump/lib/scripts.php +67 -0
  674. data/lib/wp/wp-content/themes/stump/lib/sidebar.php +43 -0
  675. data/lib/wp/wp-content/themes/stump/lib/titles.php +37 -0
  676. data/lib/wp/wp-content/themes/stump/lib/utils.php +14 -0
  677. data/lib/wp/wp-content/themes/stump/lib/widgets.php +133 -0
  678. data/lib/wp/wp-content/themes/stump/lib/wrapper.php +49 -0
  679. data/lib/wp/wp-content/themes/stump/package.json +32 -0
  680. data/lib/wp/wp-content/themes/stump/page.php +2 -0
  681. data/lib/wp/wp-content/themes/stump/screenshot.png +0 -0
  682. data/lib/wp/wp-content/themes/stump/single.php +1 -0
  683. data/lib/wp/wp-content/themes/stump/style.css +11 -0
  684. data/lib/wp/wp-content/themes/stump/template-custom.php +8 -0
  685. data/lib/wp/wp-content/themes/stump/templates/comment.php +14 -0
  686. data/lib/wp/wp-content/themes/stump/templates/comments.php +80 -0
  687. data/lib/wp/wp-content/themes/stump/templates/content-page.php +4 -0
  688. data/lib/wp/wp-content/themes/stump/templates/content-single.php +15 -0
  689. data/lib/wp/wp-content/themes/stump/templates/content.php +9 -0
  690. data/lib/wp/wp-content/themes/stump/templates/entry-meta.php +2 -0
  691. data/lib/wp/wp-content/themes/stump/templates/footer.php +8 -0
  692. data/lib/wp/wp-content/themes/stump/templates/head.php +12 -0
  693. data/lib/wp/wp-content/themes/stump/templates/header-top-navbar.php +21 -0
  694. data/lib/wp/wp-content/themes/stump/templates/header.php +14 -0
  695. data/lib/wp/wp-content/themes/stump/templates/page-header.php +5 -0
  696. data/lib/wp/wp-content/themes/stump/templates/searchform.php +9 -0
  697. data/lib/wp/wp-content/themes/stump/templates/sidebar.php +1 -0
  698. data/lib/wp/wp-content/themes/twentyfourteen/404.php +32 -0
  699. data/lib/wp/wp-content/themes/twentyfourteen/archive.php +74 -0
  700. data/lib/wp/wp-content/themes/twentyfourteen/author.php +74 -0
  701. data/lib/wp/wp-content/themes/twentyfourteen/category.php +58 -0
  702. data/lib/wp/wp-content/themes/twentyfourteen/comments.php +66 -0
  703. data/lib/wp/wp-content/themes/twentyfourteen/content-aside.php +57 -0
  704. data/lib/wp/wp-content/themes/twentyfourteen/content-audio.php +57 -0
  705. data/lib/wp/wp-content/themes/twentyfourteen/content-featured-post.php +34 -0
  706. data/lib/wp/wp-content/themes/twentyfourteen/content-gallery.php +57 -0
  707. data/lib/wp/wp-content/themes/twentyfourteen/content-image.php +57 -0
  708. data/lib/wp/wp-content/themes/twentyfourteen/content-link.php +57 -0
  709. data/lib/wp/wp-content/themes/twentyfourteen/content-none.php +31 -0
  710. data/lib/wp/wp-content/themes/twentyfourteen/content-page.php +31 -0
  711. data/lib/wp/wp-content/themes/twentyfourteen/content-quote.php +57 -0
  712. data/lib/wp/wp-content/themes/twentyfourteen/content-video.php +57 -0
  713. data/lib/wp/wp-content/themes/twentyfourteen/content.php +66 -0
  714. data/lib/wp/wp-content/themes/twentyfourteen/css/editor-style.css +717 -0
  715. data/lib/wp/wp-content/themes/twentyfourteen/css/ie.css +1335 -0
  716. data/lib/wp/wp-content/themes/twentyfourteen/featured-content.php +39 -0
  717. data/lib/wp/wp-content/themes/twentyfourteen/footer.php +28 -0
  718. data/lib/wp/wp-content/themes/twentyfourteen/functions.php +519 -0
  719. data/lib/wp/wp-content/themes/twentyfourteen/genericons/COPYING.txt +9 -0
  720. data/lib/wp/wp-content/themes/twentyfourteen/genericons/Genericons-Regular.otf +0 -0
  721. data/lib/wp/wp-content/themes/twentyfourteen/genericons/LICENSE.txt +339 -0
  722. data/lib/wp/wp-content/themes/twentyfourteen/genericons/README.txt +123 -0
  723. data/lib/wp/wp-content/themes/twentyfourteen/genericons/example.html +464 -0
  724. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.eot +0 -0
  725. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.svg +135 -0
  726. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.ttf +0 -0
  727. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.woff +0 -0
  728. data/lib/wp/wp-content/themes/twentyfourteen/genericons/genericons.css +197 -0
  729. data/lib/wp/wp-content/themes/twentyfourteen/header.php +65 -0
  730. data/lib/wp/wp-content/themes/twentyfourteen/image.php +79 -0
  731. data/lib/wp/wp-content/themes/twentyfourteen/images/pattern-dark.svg +16 -0
  732. data/lib/wp/wp-content/themes/twentyfourteen/images/pattern-light.svg +6 -0
  733. data/lib/wp/wp-content/themes/twentyfourteen/inc/back-compat.php +63 -0
  734. data/lib/wp/wp-content/themes/twentyfourteen/inc/custom-header.php +147 -0
  735. data/lib/wp/wp-content/themes/twentyfourteen/inc/customizer.php +114 -0
  736. data/lib/wp/wp-content/themes/twentyfourteen/inc/featured-content.php +531 -0
  737. data/lib/wp/wp-content/themes/twentyfourteen/inc/template-tags.php +203 -0
  738. data/lib/wp/wp-content/themes/twentyfourteen/inc/widgets.php +269 -0
  739. data/lib/wp/wp-content/themes/twentyfourteen/index.php +61 -0
  740. data/lib/wp/wp-content/themes/twentyfourteen/js/customizer.js +38 -0
  741. data/lib/wp/wp-content/themes/twentyfourteen/js/featured-content-admin.js +9 -0
  742. data/lib/wp/wp-content/themes/twentyfourteen/js/functions.js +134 -0
  743. data/lib/wp/wp-content/themes/twentyfourteen/js/html5.js +8 -0
  744. data/lib/wp/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js +21 -0
  745. data/lib/wp/wp-content/themes/twentyfourteen/js/slider.js +598 -0
  746. data/lib/wp/wp-content/themes/twentyfourteen/languages/twentyfourteen.pot +467 -0
  747. data/lib/wp/wp-content/themes/twentyfourteen/page-templates/contributors.php +52 -0
  748. data/lib/wp/wp-content/themes/twentyfourteen/page-templates/full-width.php +42 -0
  749. data/lib/wp/wp-content/themes/twentyfourteen/page.php +48 -0
  750. data/lib/wp/wp-content/themes/twentyfourteen/rtl.css +854 -0
  751. data/lib/wp/wp-content/themes/twentyfourteen/screenshot.png +0 -0
  752. data/lib/wp/wp-content/themes/twentyfourteen/search.php +49 -0
  753. data/lib/wp/wp-content/themes/twentyfourteen/sidebar-content.php +16 -0
  754. data/lib/wp/wp-content/themes/twentyfourteen/sidebar-footer.php +19 -0
  755. data/lib/wp/wp-content/themes/twentyfourteen/sidebar.php +29 -0
  756. data/lib/wp/wp-content/themes/twentyfourteen/single.php +40 -0
  757. data/lib/wp/wp-content/themes/twentyfourteen/style.css +4321 -0
  758. data/lib/wp/wp-content/themes/twentyfourteen/tag.php +60 -0
  759. data/lib/wp/wp-content/themes/twentyfourteen/taxonomy-post_format.php +85 -0
  760. data/lib/wp/wp-cron.php +115 -0
  761. data/lib/wp/wp-includes/ID3/getid3.lib.php +1376 -0
  762. data/lib/wp/wp-includes/ID3/getid3.php +1796 -0
  763. data/lib/wp/wp-includes/ID3/license.commercial.txt +27 -0
  764. data/lib/wp/wp-includes/ID3/license.txt +29 -0
  765. data/lib/wp/wp-includes/ID3/module.audio-video.asf.php +2013 -0
  766. data/lib/wp/wp-includes/ID3/module.audio-video.flv.php +745 -0
  767. data/lib/wp/wp-includes/ID3/module.audio-video.matroska.php +1751 -0
  768. data/lib/wp/wp-includes/ID3/module.audio-video.quicktime.php +2246 -0
  769. data/lib/wp/wp-includes/ID3/module.audio-video.riff.php +2586 -0
  770. data/lib/wp/wp-includes/ID3/module.audio.ac3.php +474 -0
  771. data/lib/wp/wp-includes/ID3/module.audio.dts.php +291 -0
  772. data/lib/wp/wp-includes/ID3/module.audio.flac.php +443 -0
  773. data/lib/wp/wp-includes/ID3/module.audio.mp3.php +2012 -0
  774. data/lib/wp/wp-includes/ID3/module.audio.ogg.php +756 -0
  775. data/lib/wp/wp-includes/ID3/module.tag.apetag.php +371 -0
  776. data/lib/wp/wp-includes/ID3/module.tag.id3v1.php +360 -0
  777. data/lib/wp/wp-includes/ID3/module.tag.id3v2.php +3424 -0
  778. data/lib/wp/wp-includes/ID3/module.tag.lyrics3.php +294 -0
  779. data/lib/wp/wp-includes/ID3/readme.txt +604 -0
  780. data/lib/wp/wp-includes/SimplePie/Author.php +157 -0
  781. data/lib/wp/wp-includes/SimplePie/Cache.php +133 -0
  782. data/lib/wp/wp-includes/SimplePie/Cache/Base.php +114 -0
  783. data/lib/wp/wp-includes/SimplePie/Cache/DB.php +137 -0
  784. data/lib/wp/wp-includes/SimplePie/Cache/File.php +173 -0
  785. data/lib/wp/wp-includes/SimplePie/Cache/Memcache.php +183 -0
  786. data/lib/wp/wp-includes/SimplePie/Cache/MySQL.php +438 -0
  787. data/lib/wp/wp-includes/SimplePie/Caption.php +210 -0
  788. data/lib/wp/wp-includes/SimplePie/Category.php +157 -0
  789. data/lib/wp/wp-includes/SimplePie/Content/Type/Sniffer.php +332 -0
  790. data/lib/wp/wp-includes/SimplePie/Copyright.php +130 -0
  791. data/lib/wp/wp-includes/SimplePie/Core.php +57 -0
  792. data/lib/wp/wp-includes/SimplePie/Credit.php +156 -0
  793. data/lib/wp/wp-includes/SimplePie/Decode/HTML/Entities.php +617 -0
  794. data/lib/wp/wp-includes/SimplePie/Enclosure.php +1380 -0
  795. data/lib/wp/wp-includes/SimplePie/Exception.php +52 -0
  796. data/lib/wp/wp-includes/SimplePie/File.php +292 -0
  797. data/lib/wp/wp-includes/SimplePie/HTTP/Parser.php +500 -0
  798. data/lib/wp/wp-includes/SimplePie/IRI.php +1238 -0
  799. data/lib/wp/wp-includes/SimplePie/Item.php +2964 -0
  800. data/lib/wp/wp-includes/SimplePie/Locator.php +372 -0
  801. data/lib/wp/wp-includes/SimplePie/Misc.php +2247 -0
  802. data/lib/wp/wp-includes/SimplePie/Net/IPv6.php +276 -0
  803. data/lib/wp/wp-includes/SimplePie/Parse/Date.php +983 -0
  804. data/lib/wp/wp-includes/SimplePie/Parser.php +407 -0
  805. data/lib/wp/wp-includes/SimplePie/Rating.php +129 -0
  806. data/lib/wp/wp-includes/SimplePie/Registry.php +225 -0
  807. data/lib/wp/wp-includes/SimplePie/Restriction.php +155 -0
  808. data/lib/wp/wp-includes/SimplePie/Sanitize.php +554 -0
  809. data/lib/wp/wp-includes/SimplePie/Source.php +611 -0
  810. data/lib/wp/wp-includes/SimplePie/XML/Declaration/Parser.php +362 -0
  811. data/lib/wp/wp-includes/SimplePie/gzdecode.php +371 -0
  812. data/lib/wp/wp-includes/Text/Diff.php +450 -0
  813. data/lib/wp/wp-includes/Text/Diff/Engine/native.php +436 -0
  814. data/lib/wp/wp-includes/Text/Diff/Engine/shell.php +162 -0
  815. data/lib/wp/wp-includes/Text/Diff/Engine/string.php +248 -0
  816. data/lib/wp/wp-includes/Text/Diff/Engine/xdiff.php +64 -0
  817. data/lib/wp/wp-includes/Text/Diff/Renderer.php +235 -0
  818. data/lib/wp/wp-includes/Text/Diff/Renderer/inline.php +206 -0
  819. data/lib/wp/wp-includes/admin-bar.php +870 -0
  820. data/lib/wp/wp-includes/atomlib.php +352 -0
  821. data/lib/wp/wp-includes/author-template.php +471 -0
  822. data/lib/wp/wp-includes/bookmark-template.php +298 -0
  823. data/lib/wp/wp-includes/bookmark.php +416 -0
  824. data/lib/wp/wp-includes/cache.php +704 -0
  825. data/lib/wp/wp-includes/canonical.php +586 -0
  826. data/lib/wp/wp-includes/capabilities.php +1539 -0
  827. data/lib/wp/wp-includes/category-template.php +1407 -0
  828. data/lib/wp/wp-includes/category.php +343 -0
  829. data/lib/wp/wp-includes/certificates/ca-bundle.crt +3785 -0
  830. data/lib/wp/wp-includes/class-IXR.php +1100 -0
  831. data/lib/wp/wp-includes/class-feed.php +140 -0
  832. data/lib/wp/wp-includes/class-http.php +2245 -0
  833. data/lib/wp/wp-includes/class-json.php +936 -0
  834. data/lib/wp/wp-includes/class-oembed.php +579 -0
  835. data/lib/wp/wp-includes/class-phpass.php +260 -0
  836. data/lib/wp/wp-includes/class-phpmailer.php +3265 -0
  837. data/lib/wp/wp-includes/class-pop3.php +652 -0
  838. data/lib/wp/wp-includes/class-simplepie.php +3119 -0
  839. data/lib/wp/wp-includes/class-smtp.php +943 -0
  840. data/lib/wp/wp-includes/class-snoopy.php +1256 -0
  841. data/lib/wp/wp-includes/class-wp-admin-bar.php +517 -0
  842. data/lib/wp/wp-includes/class-wp-ajax-response.php +199 -0
  843. data/lib/wp/wp-includes/class-wp-customize-control.php +1124 -0
  844. data/lib/wp/wp-includes/class-wp-customize-manager.php +1272 -0
  845. data/lib/wp/wp-includes/class-wp-customize-panel.php +200 -0
  846. data/lib/wp/wp-includes/class-wp-customize-section.php +196 -0
  847. data/lib/wp/wp-includes/class-wp-customize-setting.php +554 -0
  848. data/lib/wp/wp-includes/class-wp-customize-widgets.php +1556 -0
  849. data/lib/wp/wp-includes/class-wp-editor.php +1435 -0
  850. data/lib/wp/wp-includes/class-wp-embed.php +373 -0
  851. data/lib/wp/wp-includes/class-wp-error.php +276 -0
  852. data/lib/wp/wp-includes/class-wp-http-ixr-client.php +97 -0
  853. data/lib/wp/wp-includes/class-wp-image-editor-gd.php +459 -0
  854. data/lib/wp/wp-includes/class-wp-image-editor-imagick.php +512 -0
  855. data/lib/wp/wp-includes/class-wp-image-editor.php +475 -0
  856. data/lib/wp/wp-includes/class-wp-theme.php +1235 -0
  857. data/lib/wp/wp-includes/class-wp-walker.php +471 -0
  858. data/lib/wp/wp-includes/class-wp-xmlrpc-server.php +5984 -0
  859. data/lib/wp/wp-includes/class-wp.php +782 -0
  860. data/lib/wp/wp-includes/class.wp-dependencies.php +509 -0
  861. data/lib/wp/wp-includes/class.wp-scripts.php +247 -0
  862. data/lib/wp/wp-includes/class.wp-styles.php +210 -0
  863. data/lib/wp/wp-includes/comment-template.php +2286 -0
  864. data/lib/wp/wp-includes/comment.php +2606 -0
  865. data/lib/wp/wp-includes/compat.php +125 -0
  866. data/lib/wp/wp-includes/cron.php +469 -0
  867. data/lib/wp/wp-includes/css/admin-bar-rtl.css +1099 -0
  868. data/lib/wp/wp-includes/css/admin-bar-rtl.min.css +1 -0
  869. data/lib/wp/wp-includes/css/admin-bar.css +1099 -0
  870. data/lib/wp/wp-includes/css/admin-bar.min.css +1 -0
  871. data/lib/wp/wp-includes/css/buttons-rtl.css +364 -0
  872. data/lib/wp/wp-includes/css/buttons-rtl.min.css +1 -0
  873. data/lib/wp/wp-includes/css/buttons.css +364 -0
  874. data/lib/wp/wp-includes/css/buttons.min.css +1 -0
  875. data/lib/wp/wp-includes/css/dashicons.css +893 -0
  876. data/lib/wp/wp-includes/css/dashicons.min.css +1 -0
  877. data/lib/wp/wp-includes/css/editor-rtl.css +1993 -0
  878. data/lib/wp/wp-includes/css/editor-rtl.min.css +1 -0
  879. data/lib/wp/wp-includes/css/editor.css +1993 -0
  880. data/lib/wp/wp-includes/css/editor.min.css +1 -0
  881. data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.css +343 -0
  882. data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.min.css +19 -0
  883. data/lib/wp/wp-includes/css/jquery-ui-dialog.css +343 -0
  884. data/lib/wp/wp-includes/css/jquery-ui-dialog.min.css +19 -0
  885. data/lib/wp/wp-includes/css/media-views-rtl.css +2568 -0
  886. data/lib/wp/wp-includes/css/media-views-rtl.min.css +1 -0
  887. data/lib/wp/wp-includes/css/media-views.css +2568 -0
  888. data/lib/wp/wp-includes/css/media-views.min.css +1 -0
  889. data/lib/wp/wp-includes/css/wp-auth-check-rtl.css +100 -0
  890. data/lib/wp/wp-includes/css/wp-auth-check-rtl.min.css +1 -0
  891. data/lib/wp/wp-includes/css/wp-auth-check.css +100 -0
  892. data/lib/wp/wp-includes/css/wp-auth-check.min.css +1 -0
  893. data/lib/wp/wp-includes/css/wp-pointer-rtl.css +212 -0
  894. data/lib/wp/wp-includes/css/wp-pointer-rtl.min.css +1 -0
  895. data/lib/wp/wp-includes/css/wp-pointer.css +212 -0
  896. data/lib/wp/wp-includes/css/wp-pointer.min.css +1 -0
  897. data/lib/wp/wp-includes/date.php +475 -0
  898. data/lib/wp/wp-includes/default-constants.php +323 -0
  899. data/lib/wp/wp-includes/default-filters.php +307 -0
  900. data/lib/wp/wp-includes/default-widgets.php +1423 -0
  901. data/lib/wp/wp-includes/deprecated.php +3501 -0
  902. data/lib/wp/wp-includes/feed-atom-comments.php +115 -0
  903. data/lib/wp/wp-includes/feed-atom.php +87 -0
  904. data/lib/wp/wp-includes/feed-rdf.php +81 -0
  905. data/lib/wp/wp-includes/feed-rss.php +46 -0
  906. data/lib/wp/wp-includes/feed-rss2-comments.php +97 -0
  907. data/lib/wp/wp-includes/feed-rss2.php +115 -0
  908. data/lib/wp/wp-includes/feed.php +659 -0
  909. data/lib/wp/wp-includes/fonts/dashicons.eot +0 -0
  910. data/lib/wp/wp-includes/fonts/dashicons.svg +250 -0
  911. data/lib/wp/wp-includes/fonts/dashicons.ttf +0 -0
  912. data/lib/wp/wp-includes/fonts/dashicons.woff +0 -0
  913. data/lib/wp/wp-includes/formatting.php +4006 -0
  914. data/lib/wp/wp-includes/functions.php +4631 -0
  915. data/lib/wp/wp-includes/functions.wp-scripts.php +258 -0
  916. data/lib/wp/wp-includes/functions.wp-styles.php +245 -0
  917. data/lib/wp/wp-includes/general-template.php +2982 -0
  918. data/lib/wp/wp-includes/http.php +551 -0
  919. data/lib/wp/wp-includes/images/admin-bar-sprite-2x.png +0 -0
  920. data/lib/wp/wp-includes/images/admin-bar-sprite.png +0 -0
  921. data/lib/wp/wp-includes/images/arrow-pointer-blue-2x.png +0 -0
  922. data/lib/wp/wp-includes/images/arrow-pointer-blue.png +0 -0
  923. data/lib/wp/wp-includes/images/blank.gif +0 -0
  924. data/lib/wp/wp-includes/images/crystal/archive.png +0 -0
  925. data/lib/wp/wp-includes/images/crystal/audio.png +0 -0
  926. data/lib/wp/wp-includes/images/crystal/code.png +0 -0
  927. data/lib/wp/wp-includes/images/crystal/default.png +0 -0
  928. data/lib/wp/wp-includes/images/crystal/document.png +0 -0
  929. data/lib/wp/wp-includes/images/crystal/interactive.png +0 -0
  930. data/lib/wp/wp-includes/images/crystal/license.txt +9 -0
  931. data/lib/wp/wp-includes/images/crystal/spreadsheet.png +0 -0
  932. data/lib/wp/wp-includes/images/crystal/text.png +0 -0
  933. data/lib/wp/wp-includes/images/crystal/video.png +0 -0
  934. data/lib/wp/wp-includes/images/down_arrow-2x.gif +0 -0
  935. data/lib/wp/wp-includes/images/down_arrow.gif +0 -0
  936. data/lib/wp/wp-includes/images/icon-pointer-flag-2x.png +0 -0
  937. data/lib/wp/wp-includes/images/icon-pointer-flag.png +0 -0
  938. data/lib/wp/wp-includes/images/media/archive.png +0 -0
  939. data/lib/wp/wp-includes/images/media/audio.png +0 -0
  940. data/lib/wp/wp-includes/images/media/code.png +0 -0
  941. data/lib/wp/wp-includes/images/media/default.png +0 -0
  942. data/lib/wp/wp-includes/images/media/document.png +0 -0
  943. data/lib/wp/wp-includes/images/media/interactive.png +0 -0
  944. data/lib/wp/wp-includes/images/media/spreadsheet.png +0 -0
  945. data/lib/wp/wp-includes/images/media/text.png +0 -0
  946. data/lib/wp/wp-includes/images/media/video.png +0 -0
  947. data/lib/wp/wp-includes/images/rss-2x.png +0 -0
  948. data/lib/wp/wp-includes/images/rss.png +0 -0
  949. data/lib/wp/wp-includes/images/smilies/icon_arrow.gif +0 -0
  950. data/lib/wp/wp-includes/images/smilies/icon_biggrin.gif +0 -0
  951. data/lib/wp/wp-includes/images/smilies/icon_confused.gif +0 -0
  952. data/lib/wp/wp-includes/images/smilies/icon_cool.gif +0 -0
  953. data/lib/wp/wp-includes/images/smilies/icon_cry.gif +0 -0
  954. data/lib/wp/wp-includes/images/smilies/icon_eek.gif +0 -0
  955. data/lib/wp/wp-includes/images/smilies/icon_evil.gif +0 -0
  956. data/lib/wp/wp-includes/images/smilies/icon_exclaim.gif +0 -0
  957. data/lib/wp/wp-includes/images/smilies/icon_idea.gif +0 -0
  958. data/lib/wp/wp-includes/images/smilies/icon_lol.gif +0 -0
  959. data/lib/wp/wp-includes/images/smilies/icon_mad.gif +0 -0
  960. data/lib/wp/wp-includes/images/smilies/icon_mrgreen.gif +0 -0
  961. data/lib/wp/wp-includes/images/smilies/icon_neutral.gif +0 -0
  962. data/lib/wp/wp-includes/images/smilies/icon_question.gif +0 -0
  963. data/lib/wp/wp-includes/images/smilies/icon_razz.gif +0 -0
  964. data/lib/wp/wp-includes/images/smilies/icon_redface.gif +0 -0
  965. data/lib/wp/wp-includes/images/smilies/icon_rolleyes.gif +0 -0
  966. data/lib/wp/wp-includes/images/smilies/icon_sad.gif +0 -0
  967. data/lib/wp/wp-includes/images/smilies/icon_smile.gif +0 -0
  968. data/lib/wp/wp-includes/images/smilies/icon_surprised.gif +0 -0
  969. data/lib/wp/wp-includes/images/smilies/icon_twisted.gif +0 -0
  970. data/lib/wp/wp-includes/images/smilies/icon_wink.gif +0 -0
  971. data/lib/wp/wp-includes/images/spinner-2x.gif +0 -0
  972. data/lib/wp/wp-includes/images/spinner.gif +0 -0
  973. data/lib/wp/wp-includes/images/toggle-arrow-2x.png +0 -0
  974. data/lib/wp/wp-includes/images/toggle-arrow.png +0 -0
  975. data/lib/wp/wp-includes/images/uploader-icons-2x.png +0 -0
  976. data/lib/wp/wp-includes/images/uploader-icons.png +0 -0
  977. data/lib/wp/wp-includes/images/wlw/wp-comments.png +0 -0
  978. data/lib/wp/wp-includes/images/wlw/wp-icon.png +0 -0
  979. data/lib/wp/wp-includes/images/wlw/wp-watermark.png +0 -0
  980. data/lib/wp/wp-includes/images/wpicons-2x.png +0 -0
  981. data/lib/wp/wp-includes/images/wpicons.png +0 -0
  982. data/lib/wp/wp-includes/images/wpspin-2x.gif +0 -0
  983. data/lib/wp/wp-includes/images/wpspin.gif +0 -0
  984. data/lib/wp/wp-includes/images/xit-2x.gif +0 -0
  985. data/lib/wp/wp-includes/images/xit.gif +0 -0
  986. data/lib/wp/wp-includes/js/admin-bar.js +365 -0
  987. data/lib/wp/wp-includes/js/admin-bar.min.js +1 -0
  988. data/lib/wp/wp-includes/js/autosave.js +589 -0
  989. data/lib/wp/wp-includes/js/autosave.min.js +1 -0
  990. data/lib/wp/wp-includes/js/backbone.min.js +1 -0
  991. data/lib/wp/wp-includes/js/colorpicker.js +707 -0
  992. data/lib/wp/wp-includes/js/colorpicker.min.js +1 -0
  993. data/lib/wp/wp-includes/js/comment-reply.js +47 -0
  994. data/lib/wp/wp-includes/js/comment-reply.min.js +1 -0
  995. data/lib/wp/wp-includes/js/crop/cropper.css +165 -0
  996. data/lib/wp/wp-includes/js/crop/cropper.js +516 -0
  997. data/lib/wp/wp-includes/js/crop/marqueeHoriz.gif +0 -0
  998. data/lib/wp/wp-includes/js/crop/marqueeVert.gif +0 -0
  999. data/lib/wp/wp-includes/js/customize-base.js +617 -0
  1000. data/lib/wp/wp-includes/js/customize-base.min.js +1 -0
  1001. data/lib/wp/wp-includes/js/customize-loader.js +246 -0
  1002. data/lib/wp/wp-includes/js/customize-loader.min.js +1 -0
  1003. data/lib/wp/wp-includes/js/customize-models.js +247 -0
  1004. data/lib/wp/wp-includes/js/customize-models.min.js +1 -0
  1005. data/lib/wp/wp-includes/js/customize-preview-widgets.js +129 -0
  1006. data/lib/wp/wp-includes/js/customize-preview-widgets.min.js +1 -0
  1007. data/lib/wp/wp-includes/js/customize-preview.js +154 -0
  1008. data/lib/wp/wp-includes/js/customize-preview.min.js +1 -0
  1009. data/lib/wp/wp-includes/js/customize-views.js +231 -0
  1010. data/lib/wp/wp-includes/js/customize-views.min.js +1 -0
  1011. data/lib/wp/wp-includes/js/heartbeat.js +738 -0
  1012. data/lib/wp/wp-includes/js/heartbeat.min.js +1 -0
  1013. data/lib/wp/wp-includes/js/hoverIntent.js +115 -0
  1014. data/lib/wp/wp-includes/js/hoverIntent.min.js +1 -0
  1015. data/lib/wp/wp-includes/js/imgareaselect/border-anim-h.gif +0 -0
  1016. data/lib/wp/wp-includes/js/imgareaselect/border-anim-v.gif +0 -0
  1017. data/lib/wp/wp-includes/js/imgareaselect/imgareaselect.css +41 -0
  1018. data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.js +1205 -0
  1019. data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.min.js +1 -0
  1020. data/lib/wp/wp-includes/js/jcrop/Jcrop.gif +0 -0
  1021. data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.css +29 -0
  1022. data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.js +22 -0
  1023. data/lib/wp/wp-includes/js/jquery/jquery-migrate.js +521 -0
  1024. data/lib/wp/wp-includes/js/jquery/jquery-migrate.min.js +2 -0
  1025. data/lib/wp/wp-includes/js/jquery/jquery.color.min.js +2 -0
  1026. data/lib/wp/wp-includes/js/jquery/jquery.form.js +1193 -0
  1027. data/lib/wp/wp-includes/js/jquery/jquery.form.min.js +11 -0
  1028. data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.js +134 -0
  1029. data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.min.js +1 -0
  1030. data/lib/wp/wp-includes/js/jquery/jquery.js +5 -0
  1031. data/lib/wp/wp-includes/js/jquery/jquery.masonry.min.js +11 -0
  1032. data/lib/wp/wp-includes/js/jquery/jquery.query.js +11 -0
  1033. data/lib/wp/wp-includes/js/jquery/jquery.schedule.js +36 -0
  1034. data/lib/wp/wp-includes/js/jquery/jquery.serialize-object.js +31 -0
  1035. data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.js +99 -0
  1036. data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.min.js +1 -0
  1037. data/lib/wp/wp-includes/js/jquery/jquery.ui.touch-punch.js +11 -0
  1038. data/lib/wp/wp-includes/js/jquery/suggest.js +316 -0
  1039. data/lib/wp/wp-includes/js/jquery/suggest.min.js +1 -0
  1040. data/lib/wp/wp-includes/js/jquery/ui/accordion.min.js +11 -0
  1041. data/lib/wp/wp-includes/js/jquery/ui/autocomplete.min.js +11 -0
  1042. data/lib/wp/wp-includes/js/jquery/ui/button.min.js +11 -0
  1043. data/lib/wp/wp-includes/js/jquery/ui/core.min.js +11 -0
  1044. data/lib/wp/wp-includes/js/jquery/ui/datepicker.min.js +12 -0
  1045. data/lib/wp/wp-includes/js/jquery/ui/dialog.min.js +11 -0
  1046. data/lib/wp/wp-includes/js/jquery/ui/draggable.min.js +11 -0
  1047. data/lib/wp/wp-includes/js/jquery/ui/droppable.min.js +11 -0
  1048. data/lib/wp/wp-includes/js/jquery/ui/effect-blind.min.js +11 -0
  1049. data/lib/wp/wp-includes/js/jquery/ui/effect-bounce.min.js +11 -0
  1050. data/lib/wp/wp-includes/js/jquery/ui/effect-clip.min.js +11 -0
  1051. data/lib/wp/wp-includes/js/jquery/ui/effect-drop.min.js +11 -0
  1052. data/lib/wp/wp-includes/js/jquery/ui/effect-explode.min.js +11 -0
  1053. data/lib/wp/wp-includes/js/jquery/ui/effect-fade.min.js +11 -0
  1054. data/lib/wp/wp-includes/js/jquery/ui/effect-fold.min.js +11 -0
  1055. data/lib/wp/wp-includes/js/jquery/ui/effect-highlight.min.js +11 -0
  1056. data/lib/wp/wp-includes/js/jquery/ui/effect-puff.min.js +11 -0
  1057. data/lib/wp/wp-includes/js/jquery/ui/effect-pulsate.min.js +11 -0
  1058. data/lib/wp/wp-includes/js/jquery/ui/effect-scale.min.js +11 -0
  1059. data/lib/wp/wp-includes/js/jquery/ui/effect-shake.min.js +11 -0
  1060. data/lib/wp/wp-includes/js/jquery/ui/effect-size.min.js +11 -0
  1061. data/lib/wp/wp-includes/js/jquery/ui/effect-slide.min.js +11 -0
  1062. data/lib/wp/wp-includes/js/jquery/ui/effect-transfer.min.js +11 -0
  1063. data/lib/wp/wp-includes/js/jquery/ui/effect.min.js +21 -0
  1064. data/lib/wp/wp-includes/js/jquery/ui/menu.min.js +11 -0
  1065. data/lib/wp/wp-includes/js/jquery/ui/mouse.min.js +11 -0
  1066. data/lib/wp/wp-includes/js/jquery/ui/position.min.js +11 -0
  1067. data/lib/wp/wp-includes/js/jquery/ui/progressbar.min.js +11 -0
  1068. data/lib/wp/wp-includes/js/jquery/ui/resizable.min.js +11 -0
  1069. data/lib/wp/wp-includes/js/jquery/ui/selectable.min.js +11 -0
  1070. data/lib/wp/wp-includes/js/jquery/ui/selectmenu.min.js +11 -0
  1071. data/lib/wp/wp-includes/js/jquery/ui/slider.min.js +11 -0
  1072. data/lib/wp/wp-includes/js/jquery/ui/sortable.min.js +11 -0
  1073. data/lib/wp/wp-includes/js/jquery/ui/spinner.min.js +11 -0
  1074. data/lib/wp/wp-includes/js/jquery/ui/tabs.min.js +11 -0
  1075. data/lib/wp/wp-includes/js/jquery/ui/tooltip.min.js +11 -0
  1076. data/lib/wp/wp-includes/js/jquery/ui/widget.min.js +11 -0
  1077. data/lib/wp/wp-includes/js/json2.js +480 -0
  1078. data/lib/wp/wp-includes/js/json2.min.js +1 -0
  1079. data/lib/wp/wp-includes/js/masonry.min.js +1 -0
  1080. data/lib/wp/wp-includes/js/mce-view.js +829 -0
  1081. data/lib/wp/wp-includes/js/mce-view.min.js +1 -0
  1082. data/lib/wp/wp-includes/js/media-audiovideo.js +831 -0
  1083. data/lib/wp/wp-includes/js/media-audiovideo.min.js +1 -0
  1084. data/lib/wp/wp-includes/js/media-editor.js +1114 -0
  1085. data/lib/wp/wp-includes/js/media-editor.min.js +1 -0
  1086. data/lib/wp/wp-includes/js/media-grid.js +732 -0
  1087. data/lib/wp/wp-includes/js/media-grid.min.js +1 -0
  1088. data/lib/wp/wp-includes/js/media-models.js +1362 -0
  1089. data/lib/wp/wp-includes/js/media-models.min.js +1 -0
  1090. data/lib/wp/wp-includes/js/media-views.js +7484 -0
  1091. data/lib/wp/wp-includes/js/media-views.min.js +3 -0
  1092. data/lib/wp/wp-includes/js/mediaelement/background.png +0 -0
  1093. data/lib/wp/wp-includes/js/mediaelement/bigplay.png +0 -0
  1094. data/lib/wp/wp-includes/js/mediaelement/bigplay.svg +1 -0
  1095. data/lib/wp/wp-includes/js/mediaelement/controls.png +0 -0
  1096. data/lib/wp/wp-includes/js/mediaelement/controls.svg +1 -0
  1097. data/lib/wp/wp-includes/js/mediaelement/flashmediaelement.swf +0 -0
  1098. data/lib/wp/wp-includes/js/mediaelement/loading.gif +0 -0
  1099. data/lib/wp/wp-includes/js/mediaelement/mediaelement-and-player.min.js +181 -0
  1100. data/lib/wp/wp-includes/js/mediaelement/mediaelementplayer.min.css +1 -0
  1101. data/lib/wp/wp-includes/js/mediaelement/silverlightmediaelement.xap +0 -0
  1102. data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.css +274 -0
  1103. data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.js +34 -0
  1104. data/lib/wp/wp-includes/js/mediaelement/wp-playlist.js +175 -0
  1105. data/lib/wp/wp-includes/js/plupload/handlers.js +488 -0
  1106. data/lib/wp/wp-includes/js/plupload/handlers.min.js +1 -0
  1107. data/lib/wp/wp-includes/js/plupload/license.txt +339 -0
  1108. data/lib/wp/wp-includes/js/plupload/plupload.flash.swf +0 -0
  1109. data/lib/wp/wp-includes/js/plupload/plupload.full.min.js +28 -0
  1110. data/lib/wp/wp-includes/js/plupload/plupload.silverlight.xap +0 -0
  1111. data/lib/wp/wp-includes/js/plupload/wp-plupload.js +376 -0
  1112. data/lib/wp/wp-includes/js/plupload/wp-plupload.min.js +1 -0
  1113. data/lib/wp/wp-includes/js/quicktags.js +652 -0
  1114. data/lib/wp/wp-includes/js/quicktags.min.js +1 -0
  1115. data/lib/wp/wp-includes/js/shortcode.js +356 -0
  1116. data/lib/wp/wp-includes/js/shortcode.min.js +1 -0
  1117. data/lib/wp/wp-includes/js/swfobject.js +4 -0
  1118. data/lib/wp/wp-includes/js/swfupload/handlers.js +376 -0
  1119. data/lib/wp/wp-includes/js/swfupload/handlers.min.js +1 -0
  1120. data/lib/wp/wp-includes/js/swfupload/license.txt +32 -0
  1121. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js +53 -0
  1122. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.queue.js +98 -0
  1123. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.speed.js +342 -0
  1124. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.swfobject.js +105 -0
  1125. data/lib/wp/wp-includes/js/swfupload/swfupload.js +980 -0
  1126. data/lib/wp/wp-includes/js/swfupload/swfupload.swf +0 -0
  1127. data/lib/wp/wp-includes/js/thickbox/loadingAnimation.gif +0 -0
  1128. data/lib/wp/wp-includes/js/thickbox/macFFBgHack.png +0 -0
  1129. data/lib/wp/wp-includes/js/thickbox/thickbox.css +138 -0
  1130. data/lib/wp/wp-includes/js/thickbox/thickbox.js +314 -0
  1131. data/lib/wp/wp-includes/js/tinymce/langs/wp-langs-en.js +519 -0
  1132. data/lib/wp/wp-includes/js/tinymce/license.txt +504 -0
  1133. data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.js +370 -0
  1134. data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.min.js +1 -0
  1135. data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.js +112 -0
  1136. data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
  1137. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css +212 -0
  1138. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.js +304 -0
  1139. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
  1140. data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.js +64 -0
  1141. data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.min.js +1 -0
  1142. data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.js +136 -0
  1143. data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
  1144. data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.js +30 -0
  1145. data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.min.js +1 -0
  1146. data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.js +450 -0
  1147. data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.min.js +1 -0
  1148. data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.js +786 -0
  1149. data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.min.js +1 -0
  1150. data/lib/wp/wp-includes/js/tinymce/plugins/media/moxieplayer.swf +0 -0
  1151. data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.js +774 -0
  1152. data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.min.js +1 -0
  1153. data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.js +1553 -0
  1154. data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.min.js +1 -0
  1155. data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.js +125 -0
  1156. data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
  1157. data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.js +272 -0
  1158. data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
  1159. data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.js +513 -0
  1160. data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +1 -0
  1161. data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +207 -0
  1162. data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js +1 -0
  1163. data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js +92 -0
  1164. data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.min.js +1 -0
  1165. data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +1035 -0
  1166. data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +1 -0
  1167. data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js +78 -0
  1168. data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.min.js +1 -0
  1169. data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.js +130 -0
  1170. data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.min.js +1 -0
  1171. data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.js +63 -0
  1172. data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.min.js +1 -0
  1173. data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.js +694 -0
  1174. data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.min.js +1 -0
  1175. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
  1176. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.min.css +1 -0
  1177. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
  1178. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
  1179. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +62 -0
  1180. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  1181. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
  1182. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  1183. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg +63 -0
  1184. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  1185. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  1186. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
  1187. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/loader.gif +0 -0
  1188. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/object.gif +0 -0
  1189. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/trans.gif +0 -0
  1190. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
  1191. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.min.css +1 -0
  1192. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/audio.png +0 -0
  1193. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png +0 -0
  1194. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png +0 -0
  1195. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/embedded.png +0 -0
  1196. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png +0 -0
  1197. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery.png +0 -0
  1198. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more-2x.png +0 -0
  1199. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more.png +0 -0
  1200. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak-2x.png +0 -0
  1201. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak.png +0 -0
  1202. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-audio.png +0 -0
  1203. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-video.png +0 -0
  1204. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/video.png +0 -0
  1205. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/wp-content.css +618 -0
  1206. data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.js +617 -0
  1207. data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.min.js +1 -0
  1208. data/lib/wp/wp-includes/js/tinymce/tiny_mce_popup.js +539 -0
  1209. data/lib/wp/wp-includes/js/tinymce/tinymce.min.js +11 -0
  1210. data/lib/wp/wp-includes/js/tinymce/utils/editable_selects.js +70 -0
  1211. data/lib/wp/wp-includes/js/tinymce/utils/form_utils.js +210 -0
  1212. data/lib/wp/wp-includes/js/tinymce/utils/mctabs.js +164 -0
  1213. data/lib/wp/wp-includes/js/tinymce/utils/validate.js +252 -0
  1214. data/lib/wp/wp-includes/js/tinymce/wp-mce-help.php +145 -0
  1215. data/lib/wp/wp-includes/js/tinymce/wp-tinymce.js.gz +0 -0
  1216. data/lib/wp/wp-includes/js/tinymce/wp-tinymce.php +39 -0
  1217. data/lib/wp/wp-includes/js/tw-sack.js +193 -0
  1218. data/lib/wp/wp-includes/js/tw-sack.min.js +1 -0
  1219. data/lib/wp/wp-includes/js/underscore.min.js +1 -0
  1220. data/lib/wp/wp-includes/js/utils.js +197 -0
  1221. data/lib/wp/wp-includes/js/utils.min.js +1 -0
  1222. data/lib/wp/wp-includes/js/wp-ajax-response.js +64 -0
  1223. data/lib/wp/wp-includes/js/wp-ajax-response.min.js +1 -0
  1224. data/lib/wp/wp-includes/js/wp-auth-check.js +112 -0
  1225. data/lib/wp/wp-includes/js/wp-auth-check.min.js +1 -0
  1226. data/lib/wp/wp-includes/js/wp-backbone.js +386 -0
  1227. data/lib/wp/wp-includes/js/wp-backbone.min.js +1 -0
  1228. data/lib/wp/wp-includes/js/wp-list-revisions.js +24 -0
  1229. data/lib/wp/wp-includes/js/wp-list-revisions.min.js +1 -0
  1230. data/lib/wp/wp-includes/js/wp-lists.js +469 -0
  1231. data/lib/wp/wp-includes/js/wp-lists.min.js +1 -0
  1232. data/lib/wp/wp-includes/js/wp-pointer.js +282 -0
  1233. data/lib/wp/wp-includes/js/wp-pointer.min.js +1 -0
  1234. data/lib/wp/wp-includes/js/wp-util.js +106 -0
  1235. data/lib/wp/wp-includes/js/wp-util.min.js +1 -0
  1236. data/lib/wp/wp-includes/js/wpdialog.js +19 -0
  1237. data/lib/wp/wp-includes/js/wpdialog.min.js +1 -0
  1238. data/lib/wp/wp-includes/js/wplink.js +615 -0
  1239. data/lib/wp/wp-includes/js/wplink.min.js +1 -0
  1240. data/lib/wp/wp-includes/js/zxcvbn-async.js +18 -0
  1241. data/lib/wp/wp-includes/js/zxcvbn-async.min.js +1 -0
  1242. data/lib/wp/wp-includes/js/zxcvbn.min.js +47 -0
  1243. data/lib/wp/wp-includes/kses.php +1526 -0
  1244. data/lib/wp/wp-includes/l10n.php +908 -0
  1245. data/lib/wp/wp-includes/link-template.php +3141 -0
  1246. data/lib/wp/wp-includes/load.php +828 -0
  1247. data/lib/wp/wp-includes/locale.php +368 -0
  1248. data/lib/wp/wp-includes/media-template.php +1235 -0
  1249. data/lib/wp/wp-includes/media.php +3329 -0
  1250. data/lib/wp/wp-includes/meta.php +1221 -0
  1251. data/lib/wp/wp-includes/ms-blogs.php +939 -0
  1252. data/lib/wp/wp-includes/ms-default-constants.php +153 -0
  1253. data/lib/wp/wp-includes/ms-default-filters.php +82 -0
  1254. data/lib/wp/wp-includes/ms-deprecated.php +347 -0
  1255. data/lib/wp/wp-includes/ms-files.php +82 -0
  1256. data/lib/wp/wp-includes/ms-functions.php +2476 -0
  1257. data/lib/wp/wp-includes/ms-load.php +458 -0
  1258. data/lib/wp/wp-includes/ms-settings.php +213 -0
  1259. data/lib/wp/wp-includes/nav-menu-template.php +678 -0
  1260. data/lib/wp/wp-includes/nav-menu.php +895 -0
  1261. data/lib/wp/wp-includes/option.php +1440 -0
  1262. data/lib/wp/wp-includes/pluggable-deprecated.php +192 -0
  1263. data/lib/wp/wp-includes/pluggable.php +2283 -0
  1264. data/lib/wp/wp-includes/plugin.php +920 -0
  1265. data/lib/wp/wp-includes/pomo/entry.php +78 -0
  1266. data/lib/wp/wp-includes/pomo/mo.php +262 -0
  1267. data/lib/wp/wp-includes/pomo/po.php +384 -0
  1268. data/lib/wp/wp-includes/pomo/streams.php +209 -0
  1269. data/lib/wp/wp-includes/pomo/translations.php +275 -0
  1270. data/lib/wp/wp-includes/post-formats.php +243 -0
  1271. data/lib/wp/wp-includes/post-template.php +1766 -0
  1272. data/lib/wp/wp-includes/post-thumbnail-template.php +142 -0
  1273. data/lib/wp/wp-includes/post.php +5842 -0
  1274. data/lib/wp/wp-includes/query.php +4666 -0
  1275. data/lib/wp/wp-includes/registration-functions.php +7 -0
  1276. data/lib/wp/wp-includes/registration.php +7 -0
  1277. data/lib/wp/wp-includes/revision.php +657 -0
  1278. data/lib/wp/wp-includes/rewrite.php +2180 -0
  1279. data/lib/wp/wp-includes/rss-functions.php +9 -0
  1280. data/lib/wp/wp-includes/rss.php +936 -0
  1281. data/lib/wp/wp-includes/script-loader.php +1045 -0
  1282. data/lib/wp/wp-includes/session.php +430 -0
  1283. data/lib/wp/wp-includes/shortcodes.php +410 -0
  1284. data/lib/wp/wp-includes/taxonomy.php +4006 -0
  1285. data/lib/wp/wp-includes/template-loader.php +76 -0
  1286. data/lib/wp/wp-includes/template.php +505 -0
  1287. data/lib/wp/wp-includes/theme-compat/comments-popup.php +128 -0
  1288. data/lib/wp/wp-includes/theme-compat/comments.php +101 -0
  1289. data/lib/wp/wp-includes/theme-compat/footer.php +30 -0
  1290. data/lib/wp/wp-includes/theme-compat/header.php +49 -0
  1291. data/lib/wp/wp-includes/theme-compat/sidebar.php +83 -0
  1292. data/lib/wp/wp-includes/theme.php +2014 -0
  1293. data/lib/wp/wp-includes/update.php +674 -0
  1294. data/lib/wp/wp-includes/user.php +2292 -0
  1295. data/lib/wp/wp-includes/vars.php +144 -0
  1296. data/lib/wp/wp-includes/version.php +35 -0
  1297. data/lib/wp/wp-includes/widgets.php +1514 -0
  1298. data/lib/wp/wp-includes/wlwmanifest.xml +43 -0
  1299. data/lib/wp/wp-includes/wp-db.php +2190 -0
  1300. data/lib/wp/wp-includes/wp-diff.php +523 -0
  1301. data/lib/wp/wp-links-opml.php +80 -0
  1302. data/lib/wp/wp-load.php +73 -0
  1303. data/lib/wp/wp-login.php +952 -0
  1304. data/lib/wp/wp-mail.php +260 -0
  1305. data/lib/wp/wp-settings.php +374 -0
  1306. data/lib/wp/wp-signup.php +749 -0
  1307. data/lib/wp/wp-trackback.php +127 -0
  1308. data/lib/wp/xmlrpc.php +101 -0
  1309. data/stump-cli.gemspec +26 -0
  1310. metadata +1332 -4
@@ -0,0 +1,82 @@
1
+ <?php
2
+ /**
3
+ * Multisite upload handler.
4
+ *
5
+ * @since 3.0.0
6
+ *
7
+ * @package WordPress
8
+ * @subpackage Multisite
9
+ */
10
+
11
+ define( 'SHORTINIT', true );
12
+ require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
13
+
14
+ if( !is_multisite() )
15
+ die( 'Multisite support not enabled' );
16
+
17
+ ms_file_constants();
18
+
19
+ error_reporting( 0 );
20
+
21
+ if ( $current_blog->archived == '1' || $current_blog->spam == '1' || $current_blog->deleted == '1' ) {
22
+ status_header( 404 );
23
+ die( '404 &#8212; File not found.' );
24
+ }
25
+
26
+ $file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $_GET[ 'file' ] );
27
+ if ( !is_file( $file ) ) {
28
+ status_header( 404 );
29
+ die( '404 &#8212; File not found.' );
30
+ }
31
+
32
+ $mime = wp_check_filetype( $file );
33
+ if( false === $mime[ 'type' ] && function_exists( 'mime_content_type' ) )
34
+ $mime[ 'type' ] = mime_content_type( $file );
35
+
36
+ if( $mime[ 'type' ] )
37
+ $mimetype = $mime[ 'type' ];
38
+ else
39
+ $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 );
40
+
41
+ header( 'Content-Type: ' . $mimetype ); // always send this
42
+ if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) )
43
+ header( 'Content-Length: ' . filesize( $file ) );
44
+
45
+ // Optional support for X-Sendfile and X-Accel-Redirect
46
+ if ( WPMU_ACCEL_REDIRECT ) {
47
+ header( 'X-Accel-Redirect: ' . str_replace( WP_CONTENT_DIR, '', $file ) );
48
+ exit;
49
+ } elseif ( WPMU_SENDFILE ) {
50
+ header( 'X-Sendfile: ' . $file );
51
+ exit;
52
+ }
53
+
54
+ $last_modified = gmdate( 'D, d M Y H:i:s', filemtime( $file ) );
55
+ $etag = '"' . md5( $last_modified ) . '"';
56
+ header( "Last-Modified: $last_modified GMT" );
57
+ header( 'ETag: ' . $etag );
58
+ header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' );
59
+
60
+ // Support for Conditional GET - use stripslashes to avoid formatting.php dependency
61
+ $client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false;
62
+
63
+ if( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
64
+ $_SERVER['HTTP_IF_MODIFIED_SINCE'] = false;
65
+
66
+ $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
67
+ // If string is empty, return 0. If not, attempt to parse into a timestamp
68
+ $client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;
69
+
70
+ // Make a timestamp for our most recent modification...
71
+ $modified_timestamp = strtotime($last_modified);
72
+
73
+ if ( ( $client_last_modified && $client_etag )
74
+ ? ( ( $client_modified_timestamp >= $modified_timestamp) && ( $client_etag == $etag ) )
75
+ : ( ( $client_modified_timestamp >= $modified_timestamp) || ( $client_etag == $etag ) )
76
+ ) {
77
+ status_header( 304 );
78
+ exit;
79
+ }
80
+
81
+ // If we made it this far, just serve the file
82
+ readfile( $file );
@@ -0,0 +1,2476 @@
1
+ <?php
2
+ /**
3
+ * Multisite WordPress API
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Multisite
7
+ * @since 3.0.0
8
+ */
9
+
10
+ /**
11
+ * Gets the network's site and user counts.
12
+ *
13
+ * @since MU 1.0
14
+ * @uses get_blog_count()
15
+ * @uses get_user_count()
16
+ *
17
+ * @return array Site and user count for the network.
18
+ */
19
+ function get_sitestats() {
20
+ $stats = array(
21
+ 'blogs' => get_blog_count(),
22
+ 'users' => get_user_count(),
23
+ );
24
+
25
+ return $stats;
26
+ }
27
+
28
+ /**
29
+ * Get the admin for a domain/path combination.
30
+ *
31
+ * @since MU 1.0
32
+ *
33
+ * @param string $sitedomain Optional. Site domain.
34
+ * @param string $path Optional. Site path.
35
+ * @return array The network admins
36
+ */
37
+ function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
38
+ global $wpdb;
39
+
40
+ if ( ! $sitedomain )
41
+ $site_id = $wpdb->siteid;
42
+ else
43
+ $site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) );
44
+
45
+ if ( $site_id )
46
+ return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id ), ARRAY_A );
47
+
48
+ return false;
49
+ }
50
+
51
+ /**
52
+ * Get one of a user's active blogs
53
+ *
54
+ * Returns the user's primary blog, if they have one and
55
+ * it is active. If it's inactive, function returns another
56
+ * active blog of the user. If none are found, the user
57
+ * is added as a Subscriber to the Dashboard Blog and that blog
58
+ * is returned.
59
+ *
60
+ * @since MU 1.0
61
+ * @uses get_blogs_of_user()
62
+ * @uses add_user_to_blog()
63
+ * @uses get_blog_details()
64
+ *
65
+ * @param int $user_id The unique ID of the user
66
+ * @return object The blog object
67
+ */
68
+ function get_active_blog_for_user( $user_id ) {
69
+ global $wpdb;
70
+ $blogs = get_blogs_of_user( $user_id );
71
+ if ( empty( $blogs ) )
72
+ return null;
73
+
74
+ if ( !is_multisite() )
75
+ return $blogs[$wpdb->blogid];
76
+
77
+ $primary_blog = get_user_meta( $user_id, 'primary_blog', true );
78
+ $first_blog = current($blogs);
79
+ if ( false !== $primary_blog ) {
80
+ if ( ! isset( $blogs[ $primary_blog ] ) ) {
81
+ update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );
82
+ $primary = get_blog_details( $first_blog->userblog_id );
83
+ } else {
84
+ $primary = get_blog_details( $primary_blog );
85
+ }
86
+ } else {
87
+ //TODO Review this call to add_user_to_blog too - to get here the user must have a role on this blog?
88
+ add_user_to_blog( $first_blog->userblog_id, $user_id, 'subscriber' );
89
+ update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );
90
+ $primary = $first_blog;
91
+ }
92
+
93
+ if ( ( ! is_object( $primary ) ) || ( $primary->archived == 1 || $primary->spam == 1 || $primary->deleted == 1 ) ) {
94
+ $blogs = get_blogs_of_user( $user_id, true ); // if a user's primary blog is shut down, check their other blogs.
95
+ $ret = false;
96
+ if ( is_array( $blogs ) && count( $blogs ) > 0 ) {
97
+ foreach ( (array) $blogs as $blog_id => $blog ) {
98
+ if ( $blog->site_id != $wpdb->siteid )
99
+ continue;
100
+ $details = get_blog_details( $blog_id );
101
+ if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
102
+ $ret = $blog;
103
+ if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id )
104
+ update_user_meta( $user_id, 'primary_blog', $blog_id );
105
+ if ( !get_user_meta($user_id , 'source_domain', true) )
106
+ update_user_meta( $user_id, 'source_domain', $blog->domain );
107
+ break;
108
+ }
109
+ }
110
+ } else {
111
+ return null;
112
+ }
113
+ return $ret;
114
+ } else {
115
+ return $primary;
116
+ }
117
+ }
118
+
119
+ /**
120
+ * The number of active users in your installation.
121
+ *
122
+ * The count is cached and updated twice daily. This is not a live count.
123
+ *
124
+ * @since MU 2.7
125
+ *
126
+ * @return int
127
+ */
128
+ function get_user_count() {
129
+ return get_site_option( 'user_count' );
130
+ }
131
+
132
+ /**
133
+ * The number of active sites on your installation.
134
+ *
135
+ * The count is cached and updated twice daily. This is not a live count.
136
+ *
137
+ * @since MU 1.0
138
+ *
139
+ * @param int $network_id Deprecated, not supported.
140
+ * @return int
141
+ */
142
+ function get_blog_count( $network_id = 0 ) {
143
+ if ( func_num_args() )
144
+ _deprecated_argument( __FUNCTION__, '3.1' );
145
+
146
+ return get_site_option( 'blog_count' );
147
+ }
148
+
149
+ /**
150
+ * Get a blog post from any site on the network.
151
+ *
152
+ * @since MU 1.0
153
+ *
154
+ * @param int $blog_id ID of the blog.
155
+ * @param int $post_id ID of the post you're looking for.
156
+ * @return WP_Post|null WP_Post on success or null on failure
157
+ */
158
+ function get_blog_post( $blog_id, $post_id ) {
159
+ switch_to_blog( $blog_id );
160
+ $post = get_post( $post_id );
161
+ restore_current_blog();
162
+
163
+ return $post;
164
+ }
165
+
166
+ /**
167
+ * Add a user to a blog.
168
+ *
169
+ * Use the 'add_user_to_blog' action to fire an event when
170
+ * users are added to a blog.
171
+ *
172
+ * @since MU 1.0
173
+ *
174
+ * @param int $blog_id ID of the blog you're adding the user to.
175
+ * @param int $user_id ID of the user you're adding.
176
+ * @param string $role The role you want the user to have
177
+ * @return bool
178
+ */
179
+ function add_user_to_blog( $blog_id, $user_id, $role ) {
180
+ switch_to_blog($blog_id);
181
+
182
+ $user = get_userdata( $user_id );
183
+
184
+ if ( ! $user ) {
185
+ restore_current_blog();
186
+ return new WP_Error( 'user_does_not_exist', __( 'The requested user does not exist.' ) );
187
+ }
188
+
189
+ if ( !get_user_meta($user_id, 'primary_blog', true) ) {
190
+ update_user_meta($user_id, 'primary_blog', $blog_id);
191
+ $details = get_blog_details($blog_id);
192
+ update_user_meta($user_id, 'source_domain', $details->domain);
193
+ }
194
+
195
+ $user->set_role($role);
196
+
197
+ /**
198
+ * Fires immediately after a user is added to a site.
199
+ *
200
+ * @since MU
201
+ *
202
+ * @param int $user_id User ID.
203
+ * @param string $role User role.
204
+ * @param int $blog_id Blog ID.
205
+ */
206
+ do_action( 'add_user_to_blog', $user_id, $role, $blog_id );
207
+ wp_cache_delete( $user_id, 'users' );
208
+ restore_current_blog();
209
+ return true;
210
+ }
211
+
212
+ /**
213
+ * Remove a user from a blog.
214
+ *
215
+ * Use the 'remove_user_from_blog' action to fire an event when
216
+ * users are removed from a blog.
217
+ *
218
+ * Accepts an optional $reassign parameter, if you want to
219
+ * reassign the user's blog posts to another user upon removal.
220
+ *
221
+ * @since MU 1.0
222
+ *
223
+ * @param int $user_id ID of the user you're removing.
224
+ * @param int $blog_id ID of the blog you're removing the user from.
225
+ * @param string $reassign Optional. A user to whom to reassign posts.
226
+ * @return bool
227
+ */
228
+ function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') {
229
+ global $wpdb;
230
+ switch_to_blog($blog_id);
231
+ $user_id = (int) $user_id;
232
+ /**
233
+ * Fires before a user is removed from a site.
234
+ *
235
+ * @since MU
236
+ *
237
+ * @param int $user_id User ID.
238
+ * @param int $blog_id Blog ID.
239
+ */
240
+ do_action( 'remove_user_from_blog', $user_id, $blog_id );
241
+
242
+ // If being removed from the primary blog, set a new primary if the user is assigned
243
+ // to multiple blogs.
244
+ $primary_blog = get_user_meta($user_id, 'primary_blog', true);
245
+ if ( $primary_blog == $blog_id ) {
246
+ $new_id = '';
247
+ $new_domain = '';
248
+ $blogs = get_blogs_of_user($user_id);
249
+ foreach ( (array) $blogs as $blog ) {
250
+ if ( $blog->userblog_id == $blog_id )
251
+ continue;
252
+ $new_id = $blog->userblog_id;
253
+ $new_domain = $blog->domain;
254
+ break;
255
+ }
256
+
257
+ update_user_meta($user_id, 'primary_blog', $new_id);
258
+ update_user_meta($user_id, 'source_domain', $new_domain);
259
+ }
260
+
261
+ // wp_revoke_user($user_id);
262
+ $user = get_userdata( $user_id );
263
+ if ( ! $user ) {
264
+ restore_current_blog();
265
+ return new WP_Error('user_does_not_exist', __('That user does not exist.'));
266
+ }
267
+
268
+ $user->remove_all_caps();
269
+
270
+ $blogs = get_blogs_of_user($user_id);
271
+ if ( count($blogs) == 0 ) {
272
+ update_user_meta($user_id, 'primary_blog', '');
273
+ update_user_meta($user_id, 'source_domain', '');
274
+ }
275
+
276
+ if ( $reassign != '' ) {
277
+ $reassign = (int) $reassign;
278
+ $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $user_id ) );
279
+ $link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $user_id ) );
280
+
281
+ if ( ! empty( $post_ids ) ) {
282
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $user_id ) );
283
+ array_walk( $post_ids, 'clean_post_cache' );
284
+ }
285
+
286
+ if ( ! empty( $link_ids ) ) {
287
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $user_id ) );
288
+ array_walk( $link_ids, 'clean_bookmark_cache' );
289
+ }
290
+ }
291
+
292
+ restore_current_blog();
293
+
294
+ return true;
295
+ }
296
+
297
+ /**
298
+ * Create an empty blog.
299
+ *
300
+ * @since MU 1.0
301
+ * @uses install_blog()
302
+ *
303
+ * @param string $domain The new blog's domain.
304
+ * @param string $path The new blog's path.
305
+ * @param string $weblog_title The new blog's title.
306
+ * @param int $site_id Optional. Defaults to 1.
307
+ * @return int The ID of the newly created blog
308
+ */
309
+ function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
310
+ if ( empty($path) )
311
+ $path = '/';
312
+
313
+ // Check if the domain has been used already. We should return an error message.
314
+ if ( domain_exists($domain, $path, $site_id) )
315
+ return __( '<strong>ERROR</strong>: Site URL already taken.' );
316
+
317
+ // Need to back up wpdb table names, and create a new wp_blogs entry for new blog.
318
+ // Need to get blog_id from wp_blogs, and create new table names.
319
+ // Must restore table names at the end of function.
320
+
321
+ if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
322
+ return __( '<strong>ERROR</strong>: problem creating site entry.' );
323
+
324
+ switch_to_blog($blog_id);
325
+ install_blog($blog_id);
326
+ restore_current_blog();
327
+
328
+ return $blog_id;
329
+ }
330
+
331
+ /**
332
+ * Get the permalink for a post on another blog.
333
+ *
334
+ * @since MU 1.0
335
+ *
336
+ * @param int $blog_id ID of the source blog.
337
+ * @param int $post_id ID of the desired post.
338
+ * @return string The post's permalink
339
+ */
340
+ function get_blog_permalink( $blog_id, $post_id ) {
341
+ switch_to_blog( $blog_id );
342
+ $link = get_permalink( $post_id );
343
+ restore_current_blog();
344
+
345
+ return $link;
346
+ }
347
+
348
+ /**
349
+ * Get a blog's numeric ID from its URL.
350
+ *
351
+ * On a subdirectory installation like example.com/blog1/,
352
+ * $domain will be the root 'example.com' and $path the
353
+ * subdirectory '/blog1/'. With subdomains like blog1.example.com,
354
+ * $domain is 'blog1.example.com' and $path is '/'.
355
+ *
356
+ * @since MU 2.6.5
357
+ *
358
+ * @param string $domain
359
+ * @param string $path Optional. Not required for subdomain installations.
360
+ * @return int 0 if no blog found, otherwise the ID of the matching blog
361
+ */
362
+ function get_blog_id_from_url( $domain, $path = '/' ) {
363
+ global $wpdb;
364
+
365
+ $domain = strtolower( $domain );
366
+ $path = strtolower( $path );
367
+ $id = wp_cache_get( md5( $domain . $path ), 'blog-id-cache' );
368
+
369
+ if ( $id == -1 ) // blog does not exist
370
+ return 0;
371
+ elseif ( $id )
372
+ return (int) $id;
373
+
374
+ $id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s and path = %s /* get_blog_id_from_url */", $domain, $path ) );
375
+
376
+ if ( ! $id ) {
377
+ wp_cache_set( md5( $domain . $path ), -1, 'blog-id-cache' );
378
+ return 0;
379
+ }
380
+
381
+ wp_cache_set( md5( $domain . $path ), $id, 'blog-id-cache' );
382
+
383
+ return $id;
384
+ }
385
+
386
+ // Admin functions
387
+
388
+ /**
389
+ * Checks an email address against a list of banned domains.
390
+ *
391
+ * This function checks against the Banned Email Domains list
392
+ * at wp-admin/network/settings.php. The check is only run on
393
+ * self-registrations; user creation at wp-admin/network/users.php
394
+ * bypasses this check.
395
+ *
396
+ * @since MU
397
+ *
398
+ * @param string $user_email The email provided by the user at registration.
399
+ * @return bool Returns true when the email address is banned.
400
+ */
401
+ function is_email_address_unsafe( $user_email ) {
402
+ $banned_names = get_site_option( 'banned_email_domains' );
403
+ if ( $banned_names && ! is_array( $banned_names ) )
404
+ $banned_names = explode( "\n", $banned_names );
405
+
406
+ $is_email_address_unsafe = false;
407
+
408
+ if ( $banned_names && is_array( $banned_names ) ) {
409
+ $banned_names = array_map( 'strtolower', $banned_names );
410
+ $normalized_email = strtolower( $user_email );
411
+
412
+ list( $email_local_part, $email_domain ) = explode( '@', $normalized_email );
413
+
414
+ foreach ( $banned_names as $banned_domain ) {
415
+ if ( ! $banned_domain )
416
+ continue;
417
+
418
+ if ( $email_domain == $banned_domain ) {
419
+ $is_email_address_unsafe = true;
420
+ break;
421
+ }
422
+
423
+ $dotted_domain = ".$banned_domain";
424
+ if ( $dotted_domain === substr( $normalized_email, -strlen( $dotted_domain ) ) ) {
425
+ $is_email_address_unsafe = true;
426
+ break;
427
+ }
428
+ }
429
+ }
430
+
431
+ /**
432
+ * Filter whether an email address is unsafe.
433
+ *
434
+ * @since 3.5.0
435
+ *
436
+ * @param bool $is_email_address_unsafe Whether the email address is "unsafe". Default false.
437
+ * @param string $user_email User email address.
438
+ */
439
+ return apply_filters( 'is_email_address_unsafe', $is_email_address_unsafe, $user_email );
440
+ }
441
+
442
+ /**
443
+ * Processes new user registrations.
444
+ *
445
+ * Checks the data provided by the user during signup. Verifies
446
+ * the validity and uniqueness of user names and user email addresses,
447
+ * and checks email addresses against admin-provided domain
448
+ * whitelists and blacklists.
449
+ *
450
+ * The hook 'wpmu_validate_user_signup' provides an easy way
451
+ * to modify the signup process. The value $result, which is passed
452
+ * to the hook, contains both the user-provided info and the error
453
+ * messages created by the function. 'wpmu_validate_user_signup' allows
454
+ * you to process the data in any way you'd like, and unset the
455
+ * relevant errors if necessary.
456
+ *
457
+ * @since MU
458
+ * @uses is_email_address_unsafe()
459
+ * @uses username_exists()
460
+ * @uses email_exists()
461
+ *
462
+ * @param string $user_name The login name provided by the user.
463
+ * @param string $user_email The email provided by the user.
464
+ * @return array Contains username, email, and error messages.
465
+ */
466
+ function wpmu_validate_user_signup($user_name, $user_email) {
467
+ global $wpdb;
468
+
469
+ $errors = new WP_Error();
470
+
471
+ $orig_username = $user_name;
472
+ $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
473
+
474
+ if ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) {
475
+ $errors->add( 'user_name', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) );
476
+ $user_name = $orig_username;
477
+ }
478
+
479
+ $user_email = sanitize_email( $user_email );
480
+
481
+ if ( empty( $user_name ) )
482
+ $errors->add('user_name', __( 'Please enter a username.' ) );
483
+
484
+ $illegal_names = get_site_option( 'illegal_names' );
485
+ if ( is_array( $illegal_names ) == false ) {
486
+ $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
487
+ add_site_option( 'illegal_names', $illegal_names );
488
+ }
489
+ if ( in_array( $user_name, $illegal_names ) == true )
490
+ $errors->add('user_name', __( 'That username is not allowed.' ) );
491
+
492
+ if ( is_email_address_unsafe( $user_email ) )
493
+ $errors->add('user_email', __('You cannot use that email address to signup. We are having problems with them blocking some of our email. Please use another email provider.'));
494
+
495
+ if ( strlen( $user_name ) < 4 )
496
+ $errors->add('user_name', __( 'Username must be at least 4 characters.' ) );
497
+
498
+ if ( strpos( ' ' . $user_name, '_' ) != false )
499
+ $errors->add( 'user_name', __( 'Sorry, usernames may not contain the character &#8220;_&#8221;!' ) );
500
+
501
+ // all numeric?
502
+ if ( preg_match( '/^[0-9]*$/', $user_name ) )
503
+ $errors->add('user_name', __('Sorry, usernames must have letters too!'));
504
+
505
+ if ( !is_email( $user_email ) )
506
+ $errors->add('user_email', __( 'Please enter a valid email address.' ) );
507
+
508
+ $limited_email_domains = get_site_option( 'limited_email_domains' );
509
+ if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
510
+ $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
511
+ if ( in_array( $emaildomain, $limited_email_domains ) == false )
512
+ $errors->add('user_email', __('Sorry, that email address is not allowed!'));
513
+ }
514
+
515
+ // Check if the username has been used already.
516
+ if ( username_exists($user_name) )
517
+ $errors->add( 'user_name', __( 'Sorry, that username already exists!' ) );
518
+
519
+ // Check if the email address has been used already.
520
+ if ( email_exists($user_email) )
521
+ $errors->add( 'user_email', __( 'Sorry, that email address is already used!' ) );
522
+
523
+ // Has someone already signed up for this username?
524
+ $signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE user_login = %s", $user_name) );
525
+ if ( $signup != null ) {
526
+ $registered_at = mysql2date('U', $signup->registered);
527
+ $now = current_time( 'timestamp', true );
528
+ $diff = $now - $registered_at;
529
+ // If registered more than two days ago, cancel registration and let this signup go through.
530
+ if ( $diff > 2 * DAY_IN_SECONDS )
531
+ $wpdb->delete( $wpdb->signups, array( 'user_login' => $user_name ) );
532
+ else
533
+ $errors->add('user_name', __('That username is currently reserved but may be available in a couple of days.'));
534
+ }
535
+
536
+ $signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE user_email = %s", $user_email) );
537
+ if ( $signup != null ) {
538
+ $diff = current_time( 'timestamp', true ) - mysql2date('U', $signup->registered);
539
+ // If registered more than two days ago, cancel registration and let this signup go through.
540
+ if ( $diff > 2 * DAY_IN_SECONDS )
541
+ $wpdb->delete( $wpdb->signups, array( 'user_email' => $user_email ) );
542
+ else
543
+ $errors->add('user_email', __('That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.'));
544
+ }
545
+
546
+ $result = array('user_name' => $user_name, 'orig_username' => $orig_username, 'user_email' => $user_email, 'errors' => $errors);
547
+
548
+ /**
549
+ * Filter the validated user registration details.
550
+ *
551
+ * This does not allow you to override the username or email of the user during
552
+ * registration. The values are solely used for validation and error handling.
553
+ *
554
+ * @since MU
555
+ *
556
+ * @param array $result {
557
+ * The array of user name, email and the error messages.
558
+ *
559
+ * @type string $user_name Sanitized and unique username.
560
+ * @type string $orig_username Original username.
561
+ * @type string $user_email User email address.
562
+ * @type WP_Error $errors WP_Error object containing any errors found.
563
+ * }
564
+ */
565
+ return apply_filters( 'wpmu_validate_user_signup', $result );
566
+ }
567
+
568
+ /**
569
+ * Processes new site registrations.
570
+ *
571
+ * Checks the data provided by the user during blog signup. Verifies
572
+ * the validity and uniqueness of blog paths and domains.
573
+ *
574
+ * This function prevents the current user from registering a new site
575
+ * with a blogname equivalent to another user's login name. Passing the
576
+ * $user parameter to the function, where $user is the other user, is
577
+ * effectively an override of this limitation.
578
+ *
579
+ * Filter 'wpmu_validate_blog_signup' if you want to modify
580
+ * the way that WordPress validates new site signups.
581
+ *
582
+ * @since MU
583
+ * @uses domain_exists()
584
+ * @uses username_exists()
585
+ *
586
+ * @param string $blogname The blog name provided by the user. Must be unique.
587
+ * @param string $blog_title The blog title provided by the user.
588
+ * @return array Contains the new site data and error messages.
589
+ */
590
+ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
591
+ global $wpdb, $domain;
592
+
593
+ $current_site = get_current_site();
594
+ $base = $current_site->path;
595
+
596
+ $blog_title = strip_tags( $blog_title );
597
+ $blog_title = substr( $blog_title, 0, 50 );
598
+
599
+ $errors = new WP_Error();
600
+ $illegal_names = get_site_option( 'illegal_names' );
601
+ if ( $illegal_names == false ) {
602
+ $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
603
+ add_site_option( 'illegal_names', $illegal_names );
604
+ }
605
+
606
+ /*
607
+ * On sub dir installs, some names are so illegal, only a filter can
608
+ * spring them from jail.
609
+ */
610
+ if ( ! is_subdomain_install() ) {
611
+ $illegal_names = array_merge(
612
+ $illegal_names,
613
+ /**
614
+ * Filter reserved site names on a sub-directory Multisite install.
615
+ *
616
+ * @since 3.0.0
617
+ *
618
+ * @param array $subdirectory_reserved_names Array of reserved names.
619
+ */
620
+ apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) )
621
+ );
622
+ }
623
+
624
+ if ( empty( $blogname ) )
625
+ $errors->add('blogname', __( 'Please enter a site name.' ) );
626
+
627
+ if ( preg_match( '/[^a-z0-9]+/', $blogname ) )
628
+ $errors->add('blogname', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) );
629
+
630
+ if ( in_array( $blogname, $illegal_names ) == true )
631
+ $errors->add('blogname', __( 'That name is not allowed.' ) );
632
+
633
+ if ( strlen( $blogname ) < 4 && !is_super_admin() )
634
+ $errors->add('blogname', __( 'Site name must be at least 4 characters.' ) );
635
+
636
+ if ( strpos( $blogname, '_' ) !== false )
637
+ $errors->add( 'blogname', __( 'Sorry, site names may not contain the character &#8220;_&#8221;!' ) );
638
+
639
+ // do not allow users to create a blog that conflicts with a page on the main blog.
640
+ if ( !is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_site->blog_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) )
641
+ $errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) );
642
+
643
+ // all numeric?
644
+ if ( preg_match( '/^[0-9]*$/', $blogname ) )
645
+ $errors->add('blogname', __('Sorry, site names must have letters too!'));
646
+
647
+ /**
648
+ * Filter the new site name during registration.
649
+ *
650
+ * The name is the site's subdomain or the site's subdirectory
651
+ * path depending on the network settings.
652
+ *
653
+ * @since MU
654
+ *
655
+ * @param string $blogname Site name.
656
+ */
657
+ $blogname = apply_filters( 'newblogname', $blogname );
658
+
659
+ $blog_title = wp_unslash( $blog_title );
660
+
661
+ if ( empty( $blog_title ) )
662
+ $errors->add('blog_title', __( 'Please enter a site title.' ) );
663
+
664
+ // Check if the domain/path has been used already.
665
+ if ( is_subdomain_install() ) {
666
+ $mydomain = $blogname . '.' . preg_replace( '|^www\.|', '', $domain );
667
+ $path = $base;
668
+ } else {
669
+ $mydomain = "$domain";
670
+ $path = $base.$blogname.'/';
671
+ }
672
+ if ( domain_exists($mydomain, $path, $current_site->id) )
673
+ $errors->add( 'blogname', __( 'Sorry, that site already exists!' ) );
674
+
675
+ if ( username_exists( $blogname ) ) {
676
+ if ( is_object( $user ) == false || ( is_object($user) && ( $user->user_login != $blogname ) ) )
677
+ $errors->add( 'blogname', __( 'Sorry, that site is reserved!' ) );
678
+ }
679
+
680
+ // Has someone already signed up for this domain?
681
+ $signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE domain = %s AND path = %s", $mydomain, $path) ); // TODO: Check email too?
682
+ if ( ! empty($signup) ) {
683
+ $diff = current_time( 'timestamp', true ) - mysql2date('U', $signup->registered);
684
+ // If registered more than two days ago, cancel registration and let this signup go through.
685
+ if ( $diff > 2 * DAY_IN_SECONDS )
686
+ $wpdb->delete( $wpdb->signups, array( 'domain' => $mydomain , 'path' => $path ) );
687
+ else
688
+ $errors->add('blogname', __('That site is currently reserved but may be available in a couple days.'));
689
+ }
690
+
691
+ $result = array('domain' => $mydomain, 'path' => $path, 'blogname' => $blogname, 'blog_title' => $blog_title, 'user' => $user, 'errors' => $errors);
692
+
693
+ /**
694
+ * Filter site details and error messages following registration.
695
+ *
696
+ * @since MU
697
+ *
698
+ * @param array $result {
699
+ * Array of domain, path, blog name, blog title, user and error messages.
700
+ *
701
+ * @type string $domain Domain for the site.
702
+ * @type string $path Path for the site. Used in subdirectory installs.
703
+ * @type string $blogname The unique site name (slug).
704
+ * @type string $blog_title Blog title.
705
+ * @type string $user User email address.
706
+ * @type WP_Error $errors WP_Error containing any errors found.
707
+ * }
708
+ */
709
+ return apply_filters( 'wpmu_validate_blog_signup', $result );
710
+ }
711
+
712
+ /**
713
+ * Record site signup information for future activation.
714
+ *
715
+ * @since MU
716
+ * @uses wpmu_signup_blog_notification()
717
+ *
718
+ * @param string $domain The requested domain.
719
+ * @param string $path The requested path.
720
+ * @param string $title The requested site title.
721
+ * @param string $user The user's requested login name.
722
+ * @param string $user_email The user's email address.
723
+ * @param array $meta By default, contains the requested privacy setting and lang_id.
724
+ */
725
+ function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) {
726
+ global $wpdb;
727
+
728
+ $key = substr( md5( time() . rand() . $domain ), 0, 16 );
729
+ $meta = serialize($meta);
730
+
731
+ $wpdb->insert( $wpdb->signups, array(
732
+ 'domain' => $domain,
733
+ 'path' => $path,
734
+ 'title' => $title,
735
+ 'user_login' => $user,
736
+ 'user_email' => $user_email,
737
+ 'registered' => current_time('mysql', true),
738
+ 'activation_key' => $key,
739
+ 'meta' => $meta
740
+ ) );
741
+
742
+ wpmu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta);
743
+ }
744
+
745
+ /**
746
+ * Record user signup information for future activation.
747
+ *
748
+ * This function is used when user registration is open but
749
+ * new site registration is not.
750
+ *
751
+ * @since MU
752
+ * @uses wpmu_signup_user_notification()
753
+ *
754
+ * @param string $user The user's requested login name.
755
+ * @param string $user_email The user's email address.
756
+ * @param array $meta By default, this is an empty array.
757
+ */
758
+ function wpmu_signup_user( $user, $user_email, $meta = array() ) {
759
+ global $wpdb;
760
+
761
+ // Format data
762
+ $user = preg_replace( '/\s+/', '', sanitize_user( $user, true ) );
763
+ $user_email = sanitize_email( $user_email );
764
+ $key = substr( md5( time() . rand() . $user_email ), 0, 16 );
765
+ $meta = serialize($meta);
766
+
767
+ $wpdb->insert( $wpdb->signups, array(
768
+ 'domain' => '',
769
+ 'path' => '',
770
+ 'title' => '',
771
+ 'user_login' => $user,
772
+ 'user_email' => $user_email,
773
+ 'registered' => current_time('mysql', true),
774
+ 'activation_key' => $key,
775
+ 'meta' => $meta
776
+ ) );
777
+
778
+ wpmu_signup_user_notification($user, $user_email, $key, $meta);
779
+ }
780
+
781
+ /**
782
+ * Notify user of signup success.
783
+ *
784
+ * This is the notification function used when site registration
785
+ * is enabled.
786
+ *
787
+ * Filter 'wpmu_signup_blog_notification' to bypass this function or
788
+ * replace it with your own notification behavior.
789
+ *
790
+ * Filter 'wpmu_signup_blog_notification_email' and
791
+ * 'wpmu_signup_blog_notification_subject' to change the content
792
+ * and subject line of the email sent to newly registered users.
793
+ *
794
+ * @since MU
795
+ *
796
+ * @param string $domain The new blog domain.
797
+ * @param string $path The new blog path.
798
+ * @param string $title The site title.
799
+ * @param string $user The user's login name.
800
+ * @param string $user_email The user's email address.
801
+ * @param string $key The activation key created in wpmu_signup_blog()
802
+ * @param array $meta By default, contains the requested privacy setting and lang_id.
803
+ * @return bool
804
+ */
805
+ function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta = array() ) {
806
+ /**
807
+ * Filter whether to bypass the new site email notification.
808
+ *
809
+ * @since MU
810
+ *
811
+ * @param string|bool $domain Site domain.
812
+ * @param string $path Site path.
813
+ * @param string $title Site title.
814
+ * @param string $user User login name.
815
+ * @param string $user_email User email address.
816
+ * @param string $key Activation key created in wpmu_signup_blog().
817
+ * @param array $meta By default, contains the requested privacy setting and lang_id.
818
+ */
819
+ if ( ! apply_filters( 'wpmu_signup_blog_notification', $domain, $path, $title, $user, $user_email, $key, $meta ) ) {
820
+ return false;
821
+ }
822
+
823
+ // Send email with activation link.
824
+ if ( !is_subdomain_install() || get_current_site()->id != 1 )
825
+ $activate_url = network_site_url("wp-activate.php?key=$key");
826
+ else
827
+ $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // @todo use *_url() API
828
+
829
+ $activate_url = esc_url($activate_url);
830
+ $admin_email = get_site_option( 'admin_email' );
831
+ if ( $admin_email == '' )
832
+ $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
833
+ $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
834
+ $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
835
+ $message = sprintf(
836
+ /**
837
+ * Filter the message content of the new blog notification email.
838
+ *
839
+ * Content should be formatted for transmission via wp_mail().
840
+ *
841
+ * @since MU
842
+ *
843
+ * @param string $content Content of the notification email.
844
+ * @param string $domain Site domain.
845
+ * @param string $path Site path.
846
+ * @param string $title Site title.
847
+ * @param string $user User login name.
848
+ * @param string $user_email User email address.
849
+ * @param string $key Activation key created in wpmu_signup_blog().
850
+ * @param array $meta By default, contains the requested privacy setting and lang_id.
851
+ */
852
+ apply_filters( 'wpmu_signup_blog_notification_email',
853
+ __( "To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%s" ),
854
+ $domain, $path, $title, $user, $user_email, $key, $meta
855
+ ),
856
+ $activate_url,
857
+ esc_url( "http://{$domain}{$path}" ),
858
+ $key
859
+ );
860
+ // TODO: Don't hard code activation link.
861
+ $subject = sprintf(
862
+ /**
863
+ * Filter the subject of the new blog notification email.
864
+ *
865
+ * @since MU
866
+ *
867
+ * @param string $subject Subject of the notification email.
868
+ * @param string $domain Site domain.
869
+ * @param string $path Site path.
870
+ * @param string $title Site title.
871
+ * @param string $user User login name.
872
+ * @param string $user_email User email address.
873
+ * @param string $key Activation key created in wpmu_signup_blog().
874
+ * @param array $meta By default, contains the requested privacy setting and lang_id.
875
+ */
876
+ apply_filters( 'wpmu_signup_blog_notification_subject',
877
+ __( '[%1$s] Activate %2$s' ),
878
+ $domain, $path, $title, $user, $user_email, $key, $meta
879
+ ),
880
+ $from_name,
881
+ esc_url( 'http://' . $domain . $path )
882
+ );
883
+ wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
884
+ return true;
885
+ }
886
+
887
+ /**
888
+ * Notify user of signup success.
889
+ *
890
+ * This is the notification function used when no new site has
891
+ * been requested.
892
+ *
893
+ * Filter 'wpmu_signup_user_notification' to bypass this function or
894
+ * replace it with your own notification behavior.
895
+ *
896
+ * Filter 'wpmu_signup_user_notification_email' and
897
+ * 'wpmu_signup_user_notification_subject' to change the content
898
+ * and subject line of the email sent to newly registered users.
899
+ *
900
+ * @since MU
901
+ *
902
+ * @param string $user The user's login name.
903
+ * @param string $user_email The user's email address.
904
+ * @param string $key The activation key created in wpmu_signup_user()
905
+ * @param array $meta By default, an empty array.
906
+ * @return bool
907
+ */
908
+ function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array() ) {
909
+ /**
910
+ * Filter whether to bypass the email notification for new user sign-up.
911
+ *
912
+ * @since MU
913
+ *
914
+ * @param string $user User login name.
915
+ * @param string $user_email User email address.
916
+ * @param string $key Activation key created in wpmu_signup_user().
917
+ * @param array $meta Signup meta data.
918
+ */
919
+ if ( ! apply_filters( 'wpmu_signup_user_notification', $user, $user_email, $key, $meta ) )
920
+ return false;
921
+
922
+ // Send email with activation link.
923
+ $admin_email = get_site_option( 'admin_email' );
924
+ if ( $admin_email == '' )
925
+ $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
926
+ $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
927
+ $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
928
+ $message = sprintf(
929
+ /**
930
+ * Filter the content of the notification email for new user sign-up.
931
+ *
932
+ * Content should be formatted for transmission via wp_mail().
933
+ *
934
+ * @since MU
935
+ *
936
+ * @param string $content Content of the notification email.
937
+ * @param string $user User login name.
938
+ * @param string $user_email User email address.
939
+ * @param string $key Activation key created in wpmu_signup_user().
940
+ * @param array $meta Signup meta data.
941
+ */
942
+ apply_filters( 'wpmu_signup_user_notification_email',
943
+ __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login." ),
944
+ $user, $user_email, $key, $meta
945
+ ),
946
+ site_url( "wp-activate.php?key=$key" )
947
+ );
948
+ // TODO: Don't hard code activation link.
949
+ $subject = sprintf(
950
+ /**
951
+ * Filter the subject of the notification email of new user signup.
952
+ *
953
+ * @since MU
954
+ *
955
+ * @param string $subject Subject of the notification email.
956
+ * @param string $user User login name.
957
+ * @param string $user_email User email address.
958
+ * @param string $key Activation key created in wpmu_signup_user().
959
+ * @param array $meta Signup meta data.
960
+ */
961
+ apply_filters( 'wpmu_signup_user_notification_subject',
962
+ __( '[%1$s] Activate %2$s' ),
963
+ $user, $user_email, $key, $meta
964
+ ),
965
+ $from_name,
966
+ $user
967
+ );
968
+ wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
969
+ return true;
970
+ }
971
+
972
+ /**
973
+ * Activate a signup.
974
+ *
975
+ * Hook to 'wpmu_activate_user' or 'wpmu_activate_blog' for events
976
+ * that should happen only when users or sites are self-created (since
977
+ * those actions are not called when users and sites are created
978
+ * by a Super Admin).
979
+ *
980
+ * @since MU
981
+ * @uses wp_generate_password()
982
+ * @uses wpmu_welcome_user_notification()
983
+ * @uses add_user_to_blog()
984
+ * @uses wpmu_create_user()
985
+ * @uses wpmu_create_blog()
986
+ * @uses wpmu_welcome_notification()
987
+ *
988
+ * @param string $key The activation key provided to the user.
989
+ * @return array An array containing information about the activated user and/or blog
990
+ */
991
+ function wpmu_activate_signup($key) {
992
+ global $wpdb;
993
+
994
+ $signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE activation_key = %s", $key) );
995
+
996
+ if ( empty( $signup ) )
997
+ return new WP_Error( 'invalid_key', __( 'Invalid activation key.' ) );
998
+
999
+ if ( $signup->active ) {
1000
+ if ( empty( $signup->domain ) )
1001
+ return new WP_Error( 'already_active', __( 'The user is already active.' ), $signup );
1002
+ else
1003
+ return new WP_Error( 'already_active', __( 'The site is already active.' ), $signup );
1004
+ }
1005
+
1006
+ $meta = maybe_unserialize($signup->meta);
1007
+ $password = wp_generate_password( 12, false );
1008
+
1009
+ $user_id = username_exists($signup->user_login);
1010
+
1011
+ if ( ! $user_id )
1012
+ $user_id = wpmu_create_user($signup->user_login, $password, $signup->user_email);
1013
+ else
1014
+ $user_already_exists = true;
1015
+
1016
+ if ( ! $user_id )
1017
+ return new WP_Error('create_user', __('Could not create user'), $signup);
1018
+
1019
+ $now = current_time('mysql', true);
1020
+
1021
+ if ( empty($signup->domain) ) {
1022
+ $wpdb->update( $wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $key) );
1023
+
1024
+ if ( isset( $user_already_exists ) )
1025
+ return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup);
1026
+
1027
+ wpmu_welcome_user_notification( $user_id, $password, $meta );
1028
+ /**
1029
+ * Fires immediately after a new user is activated.
1030
+ *
1031
+ * @since MU
1032
+ *
1033
+ * @param int $user_id User ID.
1034
+ * @param int $password User password.
1035
+ * @param array $meta Signup meta data.
1036
+ */
1037
+ do_action( 'wpmu_activate_user', $user_id, $password, $meta );
1038
+ return array( 'user_id' => $user_id, 'password' => $password, 'meta' => $meta );
1039
+ }
1040
+
1041
+ $blog_id = wpmu_create_blog( $signup->domain, $signup->path, $signup->title, $user_id, $meta, $wpdb->siteid );
1042
+
1043
+ // TODO: What to do if we create a user but cannot create a blog?
1044
+ if ( is_wp_error($blog_id) ) {
1045
+ // If blog is taken, that means a previous attempt to activate this blog failed in between creating the blog and
1046
+ // setting the activation flag. Let's just set the active flag and instruct the user to reset their password.
1047
+ if ( 'blog_taken' == $blog_id->get_error_code() ) {
1048
+ $blog_id->add_data( $signup );
1049
+ $wpdb->update( $wpdb->signups, array( 'active' => 1, 'activated' => $now ), array( 'activation_key' => $key ) );
1050
+ }
1051
+ return $blog_id;
1052
+ }
1053
+
1054
+ $wpdb->update( $wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $key) );
1055
+ wpmu_welcome_notification($blog_id, $user_id, $password, $signup->title, $meta);
1056
+ /**
1057
+ * Fires immediately after a site is activated.
1058
+ *
1059
+ * @since MU
1060
+ *
1061
+ * @param int $blog_id Blog ID.
1062
+ * @param int $user_id User ID.
1063
+ * @param int $password User password.
1064
+ * @param string $signup_title Site title.
1065
+ * @param array $meta Signup meta data.
1066
+ */
1067
+ do_action( 'wpmu_activate_blog', $blog_id, $user_id, $password, $signup->title, $meta );
1068
+
1069
+ return array('blog_id' => $blog_id, 'user_id' => $user_id, 'password' => $password, 'title' => $signup->title, 'meta' => $meta);
1070
+ }
1071
+
1072
+ /**
1073
+ * Create a user.
1074
+ *
1075
+ * This function runs when a user self-registers as well as when
1076
+ * a Super Admin creates a new user. Hook to 'wpmu_new_user' for events
1077
+ * that should affect all new users, but only on Multisite (otherwise
1078
+ * use 'user_register').
1079
+ *
1080
+ * @since MU
1081
+ * @uses wp_create_user()
1082
+ *
1083
+ * @param string $user_name The new user's login name.
1084
+ * @param string $password The new user's password.
1085
+ * @param string $email The new user's email address.
1086
+ * @return mixed Returns false on failure, or int $user_id on success
1087
+ */
1088
+ function wpmu_create_user( $user_name, $password, $email ) {
1089
+ $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
1090
+
1091
+ $user_id = wp_create_user( $user_name, $password, $email );
1092
+ if ( is_wp_error( $user_id ) )
1093
+ return false;
1094
+
1095
+ // Newly created users have no roles or caps until they are added to a blog.
1096
+ delete_user_option( $user_id, 'capabilities' );
1097
+ delete_user_option( $user_id, 'user_level' );
1098
+
1099
+ /**
1100
+ * Fires immediately after a new user is created.
1101
+ *
1102
+ * @since MU
1103
+ *
1104
+ * @param int $user_id User ID.
1105
+ */
1106
+ do_action( 'wpmu_new_user', $user_id );
1107
+
1108
+ return $user_id;
1109
+ }
1110
+
1111
+ /**
1112
+ * Create a site.
1113
+ *
1114
+ * This function runs when a user self-registers a new site as well
1115
+ * as when a Super Admin creates a new site. Hook to 'wpmu_new_blog'
1116
+ * for events that should affect all new sites.
1117
+ *
1118
+ * On subdirectory installs, $domain is the same as the main site's
1119
+ * domain, and the path is the subdirectory name (eg 'example.com'
1120
+ * and '/blog1/'). On subdomain installs, $domain is the new subdomain +
1121
+ * root domain (eg 'blog1.example.com'), and $path is '/'.
1122
+ *
1123
+ * @since MU
1124
+ * @uses domain_exists()
1125
+ * @uses insert_blog()
1126
+ * @uses wp_install_defaults()
1127
+ * @uses add_user_to_blog()
1128
+ *
1129
+ * @param string $domain The new site's domain.
1130
+ * @param string $path The new site's path.
1131
+ * @param string $title The new site's title.
1132
+ * @param int $user_id The user ID of the new site's admin.
1133
+ * @param array $meta Optional. Used to set initial site options.
1134
+ * @param int $site_id Optional. Only relevant on multi-network installs.
1135
+ * @return mixed Returns WP_Error object on failure, int $blog_id on success
1136
+ */
1137
+ function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) {
1138
+ $defaults = array( 'public' => 0 );
1139
+ $meta = wp_parse_args( $meta, $defaults );
1140
+
1141
+ $domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) );
1142
+
1143
+ if ( is_subdomain_install() )
1144
+ $domain = str_replace( '@', '', $domain );
1145
+
1146
+ $title = strip_tags( $title );
1147
+ $user_id = (int) $user_id;
1148
+
1149
+ if ( empty($path) )
1150
+ $path = '/';
1151
+
1152
+ // Check if the domain has been used already. We should return an error message.
1153
+ if ( domain_exists($domain, $path, $site_id) )
1154
+ return new WP_Error( 'blog_taken', __( 'Sorry, that site already exists!' ) );
1155
+
1156
+ if ( !defined('WP_INSTALLING') )
1157
+ define( 'WP_INSTALLING', true );
1158
+
1159
+ if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
1160
+ return new WP_Error('insert_blog', __('Could not create site.'));
1161
+
1162
+ switch_to_blog($blog_id);
1163
+ install_blog($blog_id, $title);
1164
+ wp_install_defaults($user_id);
1165
+
1166
+ add_user_to_blog($blog_id, $user_id, 'administrator');
1167
+
1168
+ foreach ( $meta as $key => $value ) {
1169
+ if ( in_array( $key, array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ) ) )
1170
+ update_blog_status( $blog_id, $key, $value );
1171
+ else
1172
+ update_option( $key, $value );
1173
+ }
1174
+
1175
+ add_option( 'WPLANG', get_site_option( 'WPLANG' ) );
1176
+ update_option( 'blog_public', (int) $meta['public'] );
1177
+
1178
+ if ( ! is_super_admin( $user_id ) && ! get_user_meta( $user_id, 'primary_blog', true ) )
1179
+ update_user_meta( $user_id, 'primary_blog', $blog_id );
1180
+
1181
+ restore_current_blog();
1182
+ /**
1183
+ * Fires immediately after a new site is created.
1184
+ *
1185
+ * @since MU
1186
+ *
1187
+ * @param int $blog_id Blog ID.
1188
+ * @param int $user_id User ID.
1189
+ * @param string $domain Site domain.
1190
+ * @param string $path Site path.
1191
+ * @param int $site_id Site ID. Only relevant on multi-network installs.
1192
+ * @param array $meta Meta data. Used to set initial site options.
1193
+ */
1194
+ do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
1195
+
1196
+ return $blog_id;
1197
+ }
1198
+
1199
+ /**
1200
+ * Notifies the network admin that a new site has been activated.
1201
+ *
1202
+ * Filter 'newblog_notify_siteadmin' to change the content of
1203
+ * the notification email.
1204
+ *
1205
+ * @since MU
1206
+ *
1207
+ * @param int $blog_id The new site's ID.
1208
+ * @return bool
1209
+ */
1210
+ function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
1211
+ if ( get_site_option( 'registrationnotification' ) != 'yes' )
1212
+ return false;
1213
+
1214
+ $email = get_site_option( 'admin_email' );
1215
+ if ( is_email($email) == false )
1216
+ return false;
1217
+
1218
+ $options_site_url = esc_url(network_admin_url('settings.php'));
1219
+
1220
+ switch_to_blog( $blog_id );
1221
+ $blogname = get_option( 'blogname' );
1222
+ $siteurl = site_url();
1223
+ restore_current_blog();
1224
+
1225
+ $msg = sprintf( __( 'New Site: %1$s
1226
+ URL: %2$s
1227
+ Remote IP: %3$s
1228
+
1229
+ Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url);
1230
+ /**
1231
+ * Filter the message body of the new site activation email sent
1232
+ * to the network administrator.
1233
+ *
1234
+ * @since MU
1235
+ *
1236
+ * @param string $msg Email body.
1237
+ */
1238
+ $msg = apply_filters( 'newblog_notify_siteadmin', $msg );
1239
+
1240
+ wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg );
1241
+ return true;
1242
+ }
1243
+
1244
+ /**
1245
+ * Notifies the network admin that a new user has been activated.
1246
+ *
1247
+ * Filter 'newuser_notify_siteadmin' to change the content of
1248
+ * the notification email.
1249
+ *
1250
+ * @since MU
1251
+ * @uses apply_filters() Filter newuser_notify_siteadmin to change the content of the email message
1252
+ *
1253
+ * @param int $user_id The new user's ID.
1254
+ * @return bool
1255
+ */
1256
+ function newuser_notify_siteadmin( $user_id ) {
1257
+ if ( get_site_option( 'registrationnotification' ) != 'yes' )
1258
+ return false;
1259
+
1260
+ $email = get_site_option( 'admin_email' );
1261
+
1262
+ if ( is_email($email) == false )
1263
+ return false;
1264
+
1265
+ $user = get_userdata( $user_id );
1266
+
1267
+ $options_site_url = esc_url(network_admin_url('settings.php'));
1268
+ $msg = sprintf(__('New User: %1$s
1269
+ Remote IP: %2$s
1270
+
1271
+ Disable these notifications: %3$s'), $user->user_login, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url);
1272
+
1273
+ /**
1274
+ * Filter the message body of the new user activation email sent
1275
+ * to the network administrator.
1276
+ *
1277
+ * @since MU
1278
+ *
1279
+ * @param string $msg Email body.
1280
+ * @param WP_User $user WP_User instance of the new user.
1281
+ */
1282
+ $msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );
1283
+ wp_mail( $email, sprintf(__('New User Registration: %s'), $user->user_login), $msg );
1284
+ return true;
1285
+ }
1286
+
1287
+ /**
1288
+ * Check whether a blogname is already taken.
1289
+ *
1290
+ * Used during the new site registration process to ensure
1291
+ * that each blogname is unique.
1292
+ *
1293
+ * @since MU
1294
+ *
1295
+ * @param string $domain The domain to be checked.
1296
+ * @param string $path The path to be checked.
1297
+ * @param int $site_id Optional. Relevant only on multi-network installs.
1298
+ * @return int
1299
+ */
1300
+ function domain_exists($domain, $path, $site_id = 1) {
1301
+ global $wpdb;
1302
+ $path = trailingslashit( $path );
1303
+ $result = $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s AND site_id = %d", $domain, $path, $site_id) );
1304
+
1305
+ /**
1306
+ * Filter whether a blogname is taken.
1307
+ *
1308
+ * @since 3.5.0
1309
+ *
1310
+ * @param int|null $result The blog_id if the blogname exists, null otherwise.
1311
+ * @param string $domain Domain to be checked.
1312
+ * @param string $path Path to be checked.
1313
+ * @param int $site_id Site ID. Relevant only on multi-network installs.
1314
+ */
1315
+ return apply_filters( 'domain_exists', $result, $domain, $path, $site_id );
1316
+ }
1317
+
1318
+ /**
1319
+ * Store basic site info in the blogs table.
1320
+ *
1321
+ * This function creates a row in the wp_blogs table and returns
1322
+ * the new blog's ID. It is the first step in creating a new blog.
1323
+ *
1324
+ * @since MU
1325
+ *
1326
+ * @param string $domain The domain of the new site.
1327
+ * @param string $path The path of the new site.
1328
+ * @param int $site_id Unless you're running a multi-network install, be sure to set this value to 1.
1329
+ * @return int The ID of the new row
1330
+ */
1331
+ function insert_blog($domain, $path, $site_id) {
1332
+ global $wpdb;
1333
+
1334
+ $path = trailingslashit($path);
1335
+ $site_id = (int) $site_id;
1336
+
1337
+ $result = $wpdb->insert( $wpdb->blogs, array('site_id' => $site_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time('mysql')) );
1338
+ if ( ! $result )
1339
+ return false;
1340
+
1341
+ $blog_id = $wpdb->insert_id;
1342
+ refresh_blog_details( $blog_id );
1343
+
1344
+ wp_maybe_update_network_site_counts();
1345
+
1346
+ return $blog_id;
1347
+ }
1348
+
1349
+ /**
1350
+ * Install an empty blog.
1351
+ *
1352
+ * Creates the new blog tables and options. If calling this function
1353
+ * directly, be sure to use switch_to_blog() first, so that $wpdb
1354
+ * points to the new blog.
1355
+ *
1356
+ * @since MU
1357
+ * @uses make_db_current_silent()
1358
+ * @uses populate_roles()
1359
+ *
1360
+ * @param int $blog_id The value returned by insert_blog().
1361
+ * @param string $blog_title The title of the new site.
1362
+ */
1363
+ function install_blog( $blog_id, $blog_title = '' ) {
1364
+ global $wpdb, $wp_roles;
1365
+
1366
+ // Cast for security
1367
+ $blog_id = (int) $blog_id;
1368
+
1369
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
1370
+
1371
+ $suppress = $wpdb->suppress_errors();
1372
+ if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ) )
1373
+ die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p></body></html>' );
1374
+ $wpdb->suppress_errors( $suppress );
1375
+
1376
+ $url = get_blogaddress_by_id( $blog_id );
1377
+
1378
+ // Set everything up
1379
+ make_db_current_silent( 'blog' );
1380
+ populate_options();
1381
+ populate_roles();
1382
+ $wp_roles->_init();
1383
+
1384
+ $url = untrailingslashit( $url );
1385
+
1386
+ update_option( 'siteurl', $url );
1387
+ update_option( 'home', $url );
1388
+
1389
+ if ( get_site_option( 'ms_files_rewriting' ) )
1390
+ update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" );
1391
+ else
1392
+ update_option( 'upload_path', get_blog_option( get_current_site()->blog_id, 'upload_path' ) );
1393
+
1394
+ update_option( 'blogname', wp_unslash( $blog_title ) );
1395
+ update_option( 'admin_email', '' );
1396
+
1397
+ // remove all perms
1398
+ $table_prefix = $wpdb->get_blog_prefix();
1399
+ delete_metadata( 'user', 0, $table_prefix . 'user_level', null, true ); // delete all
1400
+ delete_metadata( 'user', 0, $table_prefix . 'capabilities', null, true ); // delete all
1401
+ }
1402
+
1403
+ /**
1404
+ * Set blog defaults.
1405
+ *
1406
+ * This function creates a row in the wp_blogs table.
1407
+ *
1408
+ * @since MU
1409
+ * @deprecated MU
1410
+ * @deprecated Use wp_install_defaults()
1411
+ * @uses wp_install_defaults()
1412
+ *
1413
+ * @param int $blog_id Ignored in this function.
1414
+ * @param int $user_id
1415
+ */
1416
+ function install_blog_defaults($blog_id, $user_id) {
1417
+ global $wpdb;
1418
+
1419
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
1420
+
1421
+ $suppress = $wpdb->suppress_errors();
1422
+
1423
+ wp_install_defaults($user_id);
1424
+
1425
+ $wpdb->suppress_errors( $suppress );
1426
+ }
1427
+
1428
+ /**
1429
+ * Notify a user that their blog activation has been successful.
1430
+ *
1431
+ * Filter 'wpmu_welcome_notification' to disable or bypass.
1432
+ *
1433
+ * Filter 'update_welcome_email' and 'update_welcome_subject' to
1434
+ * modify the content and subject line of the notification email.
1435
+ *
1436
+ * @since MU
1437
+ *
1438
+ * @param int $blog_id
1439
+ * @param int $user_id
1440
+ * @param string $password
1441
+ * @param string $title The new blog's title
1442
+ * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
1443
+ * @return bool
1444
+ */
1445
+ function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = array() ) {
1446
+ $current_site = get_current_site();
1447
+
1448
+ /**
1449
+ * Filter whether to bypass the welcome email after site activation.
1450
+ *
1451
+ * Returning false disables the welcome email.
1452
+ *
1453
+ * @since MU
1454
+ *
1455
+ * @param int|bool $blog_id Blog ID.
1456
+ * @param int $user_id User ID.
1457
+ * @param string $password User password.
1458
+ * @param string $title Site title.
1459
+ * @param array $meta Signup meta data.
1460
+ */
1461
+ if ( ! apply_filters( 'wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta ) )
1462
+ return false;
1463
+
1464
+ $welcome_email = get_site_option( 'welcome_email' );
1465
+ if ( $welcome_email == false )
1466
+ $welcome_email = __( 'Dear User,
1467
+
1468
+ Your new SITE_NAME site has been successfully set up at:
1469
+ BLOG_URL
1470
+
1471
+ You can log in to the administrator account with the following information:
1472
+
1473
+ Log in here: BLOG_URLwp-login.php
1474
+ Username: USERNAME
1475
+ Password: PASSWORD
1476
+
1477
+ We hope you enjoy your new site. Thanks!
1478
+
1479
+ --The Team @ SITE_NAME' );
1480
+
1481
+ $url = get_blogaddress_by_id($blog_id);
1482
+ $user = get_userdata( $user_id );
1483
+
1484
+ $welcome_email = str_replace( 'SITE_NAME', $current_site->site_name, $welcome_email );
1485
+ $welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email );
1486
+ $welcome_email = str_replace( 'BLOG_URL', $url, $welcome_email );
1487
+ $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email );
1488
+ $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email );
1489
+
1490
+ /**
1491
+ * Filter the content of the welcome email after site activation.
1492
+ *
1493
+ * Content should be formatted for transmission via wp_mail().
1494
+ *
1495
+ * @since MU
1496
+ *
1497
+ * @param string $welcome_email Message body of the email.
1498
+ * @param int $blog_id Blog ID.
1499
+ * @param int $user_id User ID.
1500
+ * @param string $password User password.
1501
+ * @param string $title Site title.
1502
+ * @param array $meta Signup meta data.
1503
+ */
1504
+ $welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta );
1505
+ $admin_email = get_site_option( 'admin_email' );
1506
+
1507
+ if ( $admin_email == '' )
1508
+ $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
1509
+
1510
+ $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
1511
+ $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
1512
+ $message = $welcome_email;
1513
+
1514
+ if ( empty( $current_site->site_name ) )
1515
+ $current_site->site_name = 'WordPress';
1516
+
1517
+ /**
1518
+ * Filter the subject of the welcome email after site activation.
1519
+ *
1520
+ * @since MU
1521
+ *
1522
+ * @param string $subject Subject of the email.
1523
+ */
1524
+ $subject = apply_filters( 'update_welcome_subject', sprintf( __( 'New %1$s Site: %2$s' ), $current_site->site_name, wp_unslash( $title ) ) );
1525
+ wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
1526
+ return true;
1527
+ }
1528
+
1529
+ /**
1530
+ * Notify a user that their account activation has been successful.
1531
+ *
1532
+ * Filter 'wpmu_welcome_user_notification' to disable or bypass.
1533
+ *
1534
+ * Filter 'update_welcome_user_email' and 'update_welcome_user_subject' to
1535
+ * modify the content and subject line of the notification email.
1536
+ *
1537
+ * @since MU
1538
+ *
1539
+ * @param int $user_id
1540
+ * @param string $password
1541
+ * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
1542
+ * @return bool
1543
+ */
1544
+ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) {
1545
+ $current_site = get_current_site();
1546
+
1547
+ /**
1548
+ * Filter whether to bypass the welcome email after user activation.
1549
+ *
1550
+ * Returning false disables the welcome email.
1551
+ *
1552
+ * @since MU
1553
+ *
1554
+ * @param int $user_id User ID.
1555
+ * @param string $password User password.
1556
+ * @param array $meta Signup meta data.
1557
+ */
1558
+ if ( ! apply_filters( 'wpmu_welcome_user_notification', $user_id, $password, $meta ) )
1559
+ return false;
1560
+
1561
+ $welcome_email = get_site_option( 'welcome_user_email' );
1562
+
1563
+ $user = get_userdata( $user_id );
1564
+
1565
+ /**
1566
+ * Filter the content of the welcome email after user activation.
1567
+ *
1568
+ * Content should be formatted for transmission via wp_mail().
1569
+ *
1570
+ * @since MU
1571
+ *
1572
+ * @param type $welcome_email The message body of the account activation success email.
1573
+ * @param int $user_id User ID.
1574
+ * @param string $password User password.
1575
+ * @param array $meta Signup meta data.
1576
+ */
1577
+ $welcome_email = apply_filters( 'update_welcome_user_email', $welcome_email, $user_id, $password, $meta );
1578
+ $welcome_email = str_replace( 'SITE_NAME', $current_site->site_name, $welcome_email );
1579
+ $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email );
1580
+ $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email );
1581
+ $welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email );
1582
+
1583
+ $admin_email = get_site_option( 'admin_email' );
1584
+
1585
+ if ( $admin_email == '' )
1586
+ $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
1587
+
1588
+ $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
1589
+ $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
1590
+ $message = $welcome_email;
1591
+
1592
+ if ( empty( $current_site->site_name ) )
1593
+ $current_site->site_name = 'WordPress';
1594
+
1595
+ /**
1596
+ * Filter the subject of the welcome email after user activation.
1597
+ *
1598
+ * @since MU
1599
+ *
1600
+ * @param string $subject Subject of the email.
1601
+ */
1602
+ $subject = apply_filters( 'update_welcome_user_subject', sprintf( __( 'New %1$s User: %2$s' ), $current_site->site_name, $user->user_login) );
1603
+ wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
1604
+ return true;
1605
+ }
1606
+
1607
+ /**
1608
+ * Get the current site info.
1609
+ *
1610
+ * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
1611
+ * properties of the site being viewed.
1612
+ *
1613
+ * @see wpmu_current_site()
1614
+ *
1615
+ * @since MU
1616
+ *
1617
+ * @return object
1618
+ */
1619
+ function get_current_site() {
1620
+ global $current_site;
1621
+ return $current_site;
1622
+ }
1623
+
1624
+ /**
1625
+ * Get a user's most recent post.
1626
+ *
1627
+ * Walks through each of a user's blogs to find the post with
1628
+ * the most recent post_date_gmt.
1629
+ *
1630
+ * @since MU
1631
+ * @uses get_blogs_of_user()
1632
+ *
1633
+ * @param int $user_id
1634
+ * @return array Contains the blog_id, post_id, post_date_gmt, and post_gmt_ts
1635
+ */
1636
+ function get_most_recent_post_of_user( $user_id ) {
1637
+ global $wpdb;
1638
+
1639
+ $user_blogs = get_blogs_of_user( (int) $user_id );
1640
+ $most_recent_post = array();
1641
+
1642
+ // Walk through each blog and get the most recent post
1643
+ // published by $user_id
1644
+ foreach ( (array) $user_blogs as $blog ) {
1645
+ $prefix = $wpdb->get_blog_prefix( $blog->userblog_id );
1646
+ $recent_post = $wpdb->get_row( $wpdb->prepare("SELECT ID, post_date_gmt FROM {$prefix}posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A);
1647
+
1648
+ // Make sure we found a post
1649
+ if ( isset($recent_post['ID']) ) {
1650
+ $post_gmt_ts = strtotime($recent_post['post_date_gmt']);
1651
+
1652
+ // If this is the first post checked or if this post is
1653
+ // newer than the current recent post, make it the new
1654
+ // most recent post.
1655
+ if ( !isset($most_recent_post['post_gmt_ts']) || ( $post_gmt_ts > $most_recent_post['post_gmt_ts'] ) ) {
1656
+ $most_recent_post = array(
1657
+ 'blog_id' => $blog->userblog_id,
1658
+ 'post_id' => $recent_post['ID'],
1659
+ 'post_date_gmt' => $recent_post['post_date_gmt'],
1660
+ 'post_gmt_ts' => $post_gmt_ts
1661
+ );
1662
+ }
1663
+ }
1664
+ }
1665
+
1666
+ return $most_recent_post;
1667
+ }
1668
+
1669
+ // Misc functions
1670
+
1671
+ /**
1672
+ * Get the size of a directory.
1673
+ *
1674
+ * A helper function that is used primarily to check whether
1675
+ * a blog has exceeded its allowed upload space.
1676
+ *
1677
+ * @since MU
1678
+ * @uses recurse_dirsize()
1679
+ *
1680
+ * @param string $directory
1681
+ * @return int
1682
+ */
1683
+ function get_dirsize( $directory ) {
1684
+ $dirsize = get_transient( 'dirsize_cache' );
1685
+ if ( is_array( $dirsize ) && isset( $dirsize[ $directory ][ 'size' ] ) )
1686
+ return $dirsize[ $directory ][ 'size' ];
1687
+
1688
+ if ( false == is_array( $dirsize ) )
1689
+ $dirsize = array();
1690
+
1691
+ $dirsize[ $directory ][ 'size' ] = recurse_dirsize( $directory );
1692
+
1693
+ set_transient( 'dirsize_cache', $dirsize, HOUR_IN_SECONDS );
1694
+ return $dirsize[ $directory ][ 'size' ];
1695
+ }
1696
+
1697
+ /**
1698
+ * Get the size of a directory recursively.
1699
+ *
1700
+ * Used by get_dirsize() to get a directory's size when it contains
1701
+ * other directories.
1702
+ *
1703
+ * @since MU
1704
+ *
1705
+ * @param string $directory
1706
+ * @return int
1707
+ */
1708
+ function recurse_dirsize( $directory ) {
1709
+ $size = 0;
1710
+
1711
+ $directory = untrailingslashit( $directory );
1712
+
1713
+ if ( !file_exists($directory) || !is_dir( $directory ) || !is_readable( $directory ) )
1714
+ return false;
1715
+
1716
+ if ($handle = opendir($directory)) {
1717
+ while(($file = readdir($handle)) !== false) {
1718
+ $path = $directory.'/'.$file;
1719
+ if ($file != '.' && $file != '..') {
1720
+ if (is_file($path)) {
1721
+ $size += filesize($path);
1722
+ } elseif (is_dir($path)) {
1723
+ $handlesize = recurse_dirsize($path);
1724
+ if ($handlesize > 0)
1725
+ $size += $handlesize;
1726
+ }
1727
+ }
1728
+ }
1729
+ closedir($handle);
1730
+ }
1731
+ return $size;
1732
+ }
1733
+
1734
+ /**
1735
+ * Check an array of MIME types against a whitelist.
1736
+ *
1737
+ * WordPress ships with a set of allowed upload filetypes,
1738
+ * which is defined in wp-includes/functions.php in
1739
+ * get_allowed_mime_types(). This function is used to filter
1740
+ * that list against the filetype whitelist provided by Multisite
1741
+ * Super Admins at wp-admin/network/settings.php.
1742
+ *
1743
+ * @since MU
1744
+ *
1745
+ * @param array $mimes
1746
+ * @return array
1747
+ */
1748
+ function check_upload_mimes( $mimes ) {
1749
+ $site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) );
1750
+ $site_mimes = array();
1751
+ foreach ( $site_exts as $ext ) {
1752
+ foreach ( $mimes as $ext_pattern => $mime ) {
1753
+ if ( $ext != '' && strpos( $ext_pattern, $ext ) !== false )
1754
+ $site_mimes[$ext_pattern] = $mime;
1755
+ }
1756
+ }
1757
+ return $site_mimes;
1758
+ }
1759
+
1760
+ /**
1761
+ * Update a blog's post count.
1762
+ *
1763
+ * WordPress MS stores a blog's post count as an option so as
1764
+ * to avoid extraneous COUNTs when a blog's details are fetched
1765
+ * with get_blog_details(). This function is called when posts
1766
+ * are published or unpublished to make sure the count stays current.
1767
+ *
1768
+ * @since MU
1769
+ */
1770
+ function update_posts_count( $deprecated = '' ) {
1771
+ global $wpdb;
1772
+ update_option( 'post_count', (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_status = 'publish' and post_type = 'post'" ) );
1773
+ }
1774
+
1775
+ /**
1776
+ * Logs user registrations.
1777
+ *
1778
+ * @since MU
1779
+ *
1780
+ * @param int $blog_id
1781
+ * @param int $user_id
1782
+ */
1783
+ function wpmu_log_new_registrations( $blog_id, $user_id ) {
1784
+ global $wpdb;
1785
+ $user = get_userdata( (int) $user_id );
1786
+ if ( $user )
1787
+ $wpdb->insert( $wpdb->registration_log, array('email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ), 'blog_id' => $blog_id, 'date_registered' => current_time('mysql')) );
1788
+ }
1789
+
1790
+ /**
1791
+ * Maintains a canonical list of terms by syncing terms created for each blog with the global terms table.
1792
+ *
1793
+ * @since 3.0.0
1794
+ *
1795
+ * @see term_id_filter
1796
+ *
1797
+ * @param int $term_id An ID for a term on the current blog.
1798
+ * @return int An ID from the global terms table mapped from $term_id.
1799
+ */
1800
+ function global_terms( $term_id, $deprecated = '' ) {
1801
+ global $wpdb;
1802
+ static $global_terms_recurse = null;
1803
+
1804
+ if ( !global_terms_enabled() )
1805
+ return $term_id;
1806
+
1807
+ // prevent a race condition
1808
+ $recurse_start = false;
1809
+ if ( $global_terms_recurse === null ) {
1810
+ $recurse_start = true;
1811
+ $global_terms_recurse = 1;
1812
+ } elseif ( 10 < $global_terms_recurse++ ) {
1813
+ return $term_id;
1814
+ }
1815
+
1816
+ $term_id = intval( $term_id );
1817
+ $c = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE term_id = %d", $term_id ) );
1818
+
1819
+ $global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE category_nicename = %s", $c->slug ) );
1820
+ if ( $global_id == null ) {
1821
+ $used_global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE cat_ID = %d", $c->term_id ) );
1822
+ if ( null == $used_global_id ) {
1823
+ $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) );
1824
+ $global_id = $wpdb->insert_id;
1825
+ if ( empty( $global_id ) )
1826
+ return $term_id;
1827
+ } else {
1828
+ $max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" );
1829
+ $max_local_id = $wpdb->get_var( "SELECT MAX(term_id) FROM $wpdb->terms" );
1830
+ $new_global_id = max( $max_global_id, $max_local_id ) + mt_rand( 100, 400 );
1831
+ $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $new_global_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) );
1832
+ $global_id = $wpdb->insert_id;
1833
+ }
1834
+ } elseif ( $global_id != $term_id ) {
1835
+ $local_id = $wpdb->get_row( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE term_id = %d", $global_id ) );
1836
+ if ( null != $local_id )
1837
+ $local_id = global_terms( $local_id );
1838
+ if ( 10 < $global_terms_recurse )
1839
+ $global_id = $term_id;
1840
+ }
1841
+
1842
+ if ( $global_id != $term_id ) {
1843
+ if ( get_option( 'default_category' ) == $term_id )
1844
+ update_option( 'default_category', $global_id );
1845
+
1846
+ $wpdb->update( $wpdb->terms, array('term_id' => $global_id), array('term_id' => $term_id) );
1847
+ $wpdb->update( $wpdb->term_taxonomy, array('term_id' => $global_id), array('term_id' => $term_id) );
1848
+ $wpdb->update( $wpdb->term_taxonomy, array('parent' => $global_id), array('parent' => $term_id) );
1849
+
1850
+ clean_term_cache($term_id);
1851
+ }
1852
+ if( $recurse_start )
1853
+ $global_terms_recurse = null;
1854
+
1855
+ return $global_id;
1856
+ }
1857
+
1858
+ /**
1859
+ * Ensure that the current site's domain is listed in the allowed redirect host list.
1860
+ *
1861
+ * @see wp_validate_redirect()
1862
+ * @since MU
1863
+ *
1864
+ * @return array The current site's domain
1865
+ */
1866
+ function redirect_this_site( $deprecated = '' ) {
1867
+ return array( get_current_site()->domain );
1868
+ }
1869
+
1870
+ /**
1871
+ * Check whether an upload is too big.
1872
+ *
1873
+ * @since MU
1874
+ *
1875
+ * @param array $upload
1876
+ * @return mixed If the upload is under the size limit, $upload is returned. Otherwise returns an error message.
1877
+ */
1878
+ function upload_is_file_too_big( $upload ) {
1879
+ if ( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) )
1880
+ return $upload;
1881
+
1882
+ if ( strlen( $upload['bits'] ) > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
1883
+ return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '<br />', get_site_option( 'fileupload_maxk', 1500 ));
1884
+
1885
+ return $upload;
1886
+ }
1887
+
1888
+ /**
1889
+ * Add a nonce field to the signup page.
1890
+ *
1891
+ * @since MU
1892
+ * @uses wp_nonce_field()
1893
+ */
1894
+ function signup_nonce_fields() {
1895
+ $id = mt_rand();
1896
+ echo "<input type='hidden' name='signup_form_id' value='{$id}' />";
1897
+ wp_nonce_field('signup_form_' . $id, '_signup_form', false);
1898
+ }
1899
+
1900
+ /**
1901
+ * Process the signup nonce created in signup_nonce_fields().
1902
+ *
1903
+ * @since MU
1904
+ * @uses wp_create_nonce()
1905
+ *
1906
+ * @param array $result
1907
+ * @return array
1908
+ */
1909
+ function signup_nonce_check( $result ) {
1910
+ if ( !strpos( $_SERVER[ 'PHP_SELF' ], 'wp-signup.php' ) )
1911
+ return $result;
1912
+
1913
+ if ( wp_create_nonce('signup_form_' . $_POST[ 'signup_form_id' ]) != $_POST['_signup_form'] )
1914
+ wp_die( __( 'Please try again.' ) );
1915
+
1916
+ return $result;
1917
+ }
1918
+
1919
+ /**
1920
+ * Correct 404 redirects when NOBLOGREDIRECT is defined.
1921
+ *
1922
+ * @since MU
1923
+ */
1924
+ function maybe_redirect_404() {
1925
+ /**
1926
+ * Filter the redirect URL for 404s on the main site.
1927
+ *
1928
+ * The filter is only evaluated if the NOBLOGREDIRECT constant is defined.
1929
+ *
1930
+ * @since 3.0.0
1931
+ *
1932
+ * @param string $no_blog_redirect The redirect URL defined in NOBLOGREDIRECT.
1933
+ */
1934
+ if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) && ( $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT ) ) ) {
1935
+ if ( $destination == '%siteurl%' )
1936
+ $destination = network_home_url();
1937
+ wp_redirect( $destination );
1938
+ exit();
1939
+ }
1940
+ }
1941
+
1942
+ /**
1943
+ * Add a new user to a blog by visiting /newbloguser/username/.
1944
+ *
1945
+ * This will only work when the user's details are saved as an option
1946
+ * keyed as 'new_user_x', where 'x' is the username of the user to be
1947
+ * added, as when a user is invited through the regular WP Add User interface.
1948
+ *
1949
+ * @since MU
1950
+ * @uses add_existing_user_to_blog()
1951
+ */
1952
+ function maybe_add_existing_user_to_blog() {
1953
+ if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) )
1954
+ return false;
1955
+
1956
+ $parts = explode( '/', $_SERVER[ 'REQUEST_URI' ] );
1957
+ $key = array_pop( $parts );
1958
+
1959
+ if ( $key == '' )
1960
+ $key = array_pop( $parts );
1961
+
1962
+ $details = get_option( 'new_user_' . $key );
1963
+ if ( !empty( $details ) )
1964
+ delete_option( 'new_user_' . $key );
1965
+
1966
+ if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) )
1967
+ wp_die( sprintf(__('An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.'), home_url() ) );
1968
+
1969
+ wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress &rsaquo; Success' ) );
1970
+ }
1971
+
1972
+ /**
1973
+ * Add a user to a blog based on details from maybe_add_existing_user_to_blog().
1974
+ *
1975
+ * @since MU
1976
+ * @uses add_user_to_blog()
1977
+ *
1978
+ * @param array $details
1979
+ */
1980
+ function add_existing_user_to_blog( $details = false ) {
1981
+ global $blog_id;
1982
+
1983
+ if ( is_array( $details ) ) {
1984
+ $result = add_user_to_blog( $blog_id, $details[ 'user_id' ], $details[ 'role' ] );
1985
+ /**
1986
+ * Fires immediately after an existing user is added to a site.
1987
+ *
1988
+ * @since MU
1989
+ *
1990
+ * @param int $user_id User ID.
1991
+ * @param mixed $result True on success or a WP_Error object if the user doesn't exist.
1992
+ */
1993
+ do_action( 'added_existing_user', $details['user_id'], $result );
1994
+ }
1995
+ return $result;
1996
+ }
1997
+
1998
+ /**
1999
+ * Add a newly created user to the appropriate blog
2000
+ *
2001
+ * To add a user in general, use add_user_to_blog(). This function
2002
+ * is specifically hooked into the wpmu_activate_user action.
2003
+ *
2004
+ * @since MU
2005
+ * @see add_user_to_blog()
2006
+ *
2007
+ * @param int $user_id
2008
+ * @param mixed $password Ignored.
2009
+ * @param array $meta
2010
+ */
2011
+ function add_new_user_to_blog( $user_id, $password, $meta ) {
2012
+ if ( !empty( $meta[ 'add_to_blog' ] ) ) {
2013
+ $blog_id = $meta[ 'add_to_blog' ];
2014
+ $role = $meta[ 'new_role' ];
2015
+ remove_user_from_blog($user_id, get_current_site()->blog_id); // remove user from main blog.
2016
+ add_user_to_blog( $blog_id, $user_id, $role );
2017
+ update_user_meta( $user_id, 'primary_blog', $blog_id );
2018
+ }
2019
+ }
2020
+
2021
+ /**
2022
+ * Correct From host on outgoing mail to match the site domain
2023
+ *
2024
+ * @since MU
2025
+ */
2026
+ function fix_phpmailer_messageid( $phpmailer ) {
2027
+ $phpmailer->Hostname = get_current_site()->domain;
2028
+ }
2029
+
2030
+ /**
2031
+ * Check to see whether a user is marked as a spammer, based on user login.
2032
+ *
2033
+ * @since MU
2034
+ * @uses get_user_by()
2035
+ *
2036
+ * @param string|WP_User $user Optional. Defaults to current user. WP_User object,
2037
+ * or user login name as a string.
2038
+ * @return bool
2039
+ */
2040
+ function is_user_spammy( $user = null ) {
2041
+ if ( ! is_a( $user, 'WP_User' ) ) {
2042
+ if ( $user )
2043
+ $user = get_user_by( 'login', $user );
2044
+ else
2045
+ $user = wp_get_current_user();
2046
+ }
2047
+
2048
+ return $user && isset( $user->spam ) && 1 == $user->spam;
2049
+ }
2050
+
2051
+ /**
2052
+ * Update this blog's 'public' setting in the global blogs table.
2053
+ *
2054
+ * Public blogs have a setting of 1, private blogs are 0.
2055
+ *
2056
+ * @since MU
2057
+ * @uses update_blog_status()
2058
+ *
2059
+ * @param int $old_value
2060
+ * @param int $value The new public value
2061
+ * @return bool
2062
+ */
2063
+ function update_blog_public( $old_value, $value ) {
2064
+ update_blog_status( get_current_blog_id(), 'public', (int) $value );
2065
+ }
2066
+ add_action('update_option_blog_public', 'update_blog_public', 10, 2);
2067
+
2068
+ /**
2069
+ * Check whether a usermeta key has to do with the current blog.
2070
+ *
2071
+ * @since MU
2072
+ * @uses wp_get_current_user()
2073
+ *
2074
+ * @param string $key
2075
+ * @param int $user_id Optional. Defaults to current user.
2076
+ * @param int $blog_id Optional. Defaults to current blog.
2077
+ * @return bool
2078
+ */
2079
+ function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
2080
+ global $wpdb;
2081
+
2082
+ $current_user = wp_get_current_user();
2083
+ if ( $blog_id == 0 ) {
2084
+ $blog_id = $wpdb->blogid;
2085
+ }
2086
+ $local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
2087
+
2088
+ if ( isset( $current_user->$local_key ) )
2089
+ return true;
2090
+
2091
+ return false;
2092
+ }
2093
+
2094
+ /**
2095
+ * Check whether users can self-register, based on Network settings.
2096
+ *
2097
+ * @since MU
2098
+ *
2099
+ * @return bool
2100
+ */
2101
+ function users_can_register_signup_filter() {
2102
+ $registration = get_site_option('registration');
2103
+ if ( $registration == 'all' || $registration == 'user' )
2104
+ return true;
2105
+
2106
+ return false;
2107
+ }
2108
+ add_filter('option_users_can_register', 'users_can_register_signup_filter');
2109
+
2110
+ /**
2111
+ * Ensure that the welcome message is not empty. Currently unused.
2112
+ *
2113
+ * @since MU
2114
+ *
2115
+ * @param string $text
2116
+ * @return string
2117
+ */
2118
+ function welcome_user_msg_filter( $text ) {
2119
+ if ( !$text ) {
2120
+ remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
2121
+ $text = __( 'Dear User,
2122
+
2123
+ Your new account is set up.
2124
+
2125
+ You can log in with the following information:
2126
+ Username: USERNAME
2127
+ Password: PASSWORD
2128
+ LOGINLINK
2129
+
2130
+ Thanks!
2131
+
2132
+ --The Team @ SITE_NAME' );
2133
+ update_site_option( 'welcome_user_email', $text );
2134
+ }
2135
+ return $text;
2136
+ }
2137
+ add_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
2138
+
2139
+ /**
2140
+ * Whether to force SSL on content.
2141
+ *
2142
+ * @since 2.8.5
2143
+ *
2144
+ * @param string|bool $force
2145
+ * @return bool True if forced, false if not forced.
2146
+ */
2147
+ function force_ssl_content( $force = '' ) {
2148
+ static $forced_content;
2149
+
2150
+ if ( '' != $force ) {
2151
+ $old_forced = $forced_content;
2152
+ $forced_content = $force;
2153
+ return $old_forced;
2154
+ }
2155
+
2156
+ return $forced_content;
2157
+ }
2158
+
2159
+ /**
2160
+ * Formats a URL to use https.
2161
+ *
2162
+ * Useful as a filter.
2163
+ *
2164
+ * @since 2.8.5
2165
+ *
2166
+ * @param string URL
2167
+ * @return string URL with https as the scheme
2168
+ */
2169
+ function filter_SSL( $url ) {
2170
+ if ( ! is_string( $url ) )
2171
+ return get_bloginfo( 'url' ); // Return home blog url with proper scheme
2172
+
2173
+ if ( force_ssl_content() && is_ssl() )
2174
+ $url = set_url_scheme( $url, 'https' );
2175
+
2176
+ return $url;
2177
+ }
2178
+
2179
+ /**
2180
+ * Schedule update of the network-wide counts for the current network.
2181
+ *
2182
+ * @since 3.1.0
2183
+ */
2184
+ function wp_schedule_update_network_counts() {
2185
+ if ( !is_main_site() )
2186
+ return;
2187
+
2188
+ if ( !wp_next_scheduled('update_network_counts') && !defined('WP_INSTALLING') )
2189
+ wp_schedule_event(time(), 'twicedaily', 'update_network_counts');
2190
+ }
2191
+
2192
+ /**
2193
+ * Update the network-wide counts for the current network.
2194
+ *
2195
+ * @since 3.1.0
2196
+ */
2197
+ function wp_update_network_counts() {
2198
+ wp_update_network_user_counts();
2199
+ wp_update_network_site_counts();
2200
+ }
2201
+
2202
+ /**
2203
+ * Update the count of sites for the current network.
2204
+ *
2205
+ * If enabled through the 'enable_live_network_counts' filter, update the sites count
2206
+ * on a network when a site is created or its status is updated.
2207
+ *
2208
+ * @since 3.7.0
2209
+ *
2210
+ * @uses wp_update_network_site_counts()
2211
+ */
2212
+ function wp_maybe_update_network_site_counts() {
2213
+ $is_small_network = ! wp_is_large_network( 'sites' );
2214
+
2215
+ /**
2216
+ * Filter whether to update network site or user counts when a new site is created.
2217
+ *
2218
+ * @since 3.7.0
2219
+ *
2220
+ * @see wp_is_large_network()
2221
+ *
2222
+ * @param bool $small_network Whether the network is considered small.
2223
+ * @param string $context Context. Either 'users' or 'sites'.
2224
+ */
2225
+ if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) )
2226
+ return;
2227
+
2228
+ wp_update_network_site_counts();
2229
+ }
2230
+
2231
+ /**
2232
+ * Update the network-wide users count.
2233
+ *
2234
+ * If enabled through the 'enable_live_network_counts' filter, update the users count
2235
+ * on a network when a user is created or its status is updated.
2236
+ *
2237
+ * @since 3.7.0
2238
+ *
2239
+ * @uses wp_update_network_user_counts()
2240
+ */
2241
+ function wp_maybe_update_network_user_counts() {
2242
+ $is_small_network = ! wp_is_large_network( 'users' );
2243
+
2244
+ /** This filter is documented in wp-includes/ms-functions.php */
2245
+ if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) )
2246
+ return;
2247
+
2248
+ wp_update_network_user_counts();
2249
+ }
2250
+
2251
+ /**
2252
+ * Update the network-wide site count.
2253
+ *
2254
+ * @since 3.7.0
2255
+ */
2256
+ function wp_update_network_site_counts() {
2257
+ global $wpdb;
2258
+
2259
+ $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $wpdb->siteid) );
2260
+ update_site_option( 'blog_count', $count );
2261
+ }
2262
+
2263
+ /**
2264
+ * Update the network-wide user count.
2265
+ *
2266
+ * @since 3.7.0
2267
+ */
2268
+ function wp_update_network_user_counts() {
2269
+ global $wpdb;
2270
+
2271
+ $count = $wpdb->get_var( "SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'" );
2272
+ update_site_option( 'user_count', $count );
2273
+ }
2274
+
2275
+ /**
2276
+ * Returns the space used by the current blog.
2277
+ *
2278
+ * @since 3.5.0
2279
+ *
2280
+ * @return int Used space in megabytes
2281
+ */
2282
+ function get_space_used() {
2283
+ /**
2284
+ * Filter the amount of storage space used by the current site.
2285
+ *
2286
+ * @since 3.5.0
2287
+ *
2288
+ * @param int|bool $space_used The amount of used space, in megabytes. Default false.
2289
+ */
2290
+ $space_used = apply_filters( 'pre_get_space_used', false );
2291
+ if ( false === $space_used ) {
2292
+ $upload_dir = wp_upload_dir();
2293
+ $space_used = get_dirsize( $upload_dir['basedir'] ) / 1024 / 1024;
2294
+ }
2295
+
2296
+ return $space_used;
2297
+ }
2298
+
2299
+ /**
2300
+ * Returns the upload quota for the current blog.
2301
+ *
2302
+ * @since MU
2303
+ *
2304
+ * @return int Quota in megabytes
2305
+ */
2306
+ function get_space_allowed() {
2307
+ $space_allowed = get_option( 'blog_upload_space' );
2308
+
2309
+ if ( ! is_numeric( $space_allowed ) )
2310
+ $space_allowed = get_site_option( 'blog_upload_space' );
2311
+
2312
+ if ( empty( $space_allowed ) || ! is_numeric( $space_allowed ) )
2313
+ $space_allowed = 100;
2314
+
2315
+ /**
2316
+ * Filter the upload quota for the current site.
2317
+ *
2318
+ * @since 3.7.0
2319
+ *
2320
+ * @param int $space_allowed Upload quota in megabytes for the current blog.
2321
+ */
2322
+ return apply_filters( 'get_space_allowed', $space_allowed );
2323
+ }
2324
+
2325
+ /**
2326
+ * Determines if there is any upload space left in the current blog's quota.
2327
+ *
2328
+ * @since 3.0.0
2329
+ *
2330
+ * @return int of upload space available in bytes
2331
+ */
2332
+ function get_upload_space_available() {
2333
+ $space_allowed = get_space_allowed() * 1024 * 1024;
2334
+ if ( get_site_option( 'upload_space_check_disabled' ) )
2335
+ return $space_allowed;
2336
+
2337
+ $space_used = get_space_used() * 1024 * 1024;
2338
+
2339
+ if ( ( $space_allowed - $space_used ) <= 0 )
2340
+ return 0;
2341
+
2342
+ return $space_allowed - $space_used;
2343
+ }
2344
+
2345
+ /**
2346
+ * Determines if there is any upload space left in the current blog's quota.
2347
+ *
2348
+ * @since 3.0.0
2349
+ * @return bool True if space is available, false otherwise.
2350
+ */
2351
+ function is_upload_space_available() {
2352
+ if ( get_site_option( 'upload_space_check_disabled' ) )
2353
+ return true;
2354
+
2355
+ return (bool) get_upload_space_available();
2356
+ }
2357
+
2358
+ /**
2359
+ * @since 3.0.0
2360
+ *
2361
+ * @return int of upload size limit in bytes
2362
+ */
2363
+ function upload_size_limit_filter( $size ) {
2364
+ $fileupload_maxk = 1024 * get_site_option( 'fileupload_maxk', 1500 );
2365
+ if ( get_site_option( 'upload_space_check_disabled' ) )
2366
+ return min( $size, $fileupload_maxk );
2367
+
2368
+ return min( $size, $fileupload_maxk, get_upload_space_available() );
2369
+ }
2370
+
2371
+ /**
2372
+ * Whether or not we have a large network.
2373
+ *
2374
+ * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
2375
+ * Plugins can alter this criteria using the 'wp_is_large_network' filter.
2376
+ *
2377
+ * @since 3.3.0
2378
+ * @param string $using 'sites or 'users'. Default is 'sites'.
2379
+ * @return bool True if the network meets the criteria for large. False otherwise.
2380
+ */
2381
+ function wp_is_large_network( $using = 'sites' ) {
2382
+ if ( 'users' == $using ) {
2383
+ $count = get_user_count();
2384
+ /**
2385
+ * Filter whether the network is considered large.
2386
+ *
2387
+ * @since 3.3.0
2388
+ *
2389
+ * @param bool $is_large_network Whether the network has more than 10000 users or sites.
2390
+ * @param string $component The component to count. Accepts 'users', or 'sites'.
2391
+ * @param int $count The count of items for the component.
2392
+ */
2393
+ return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count );
2394
+ }
2395
+
2396
+ $count = get_blog_count();
2397
+ /** This filter is documented in wp-includes/ms-functions.php */
2398
+ return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );
2399
+ }
2400
+
2401
+
2402
+ /**
2403
+ * Return an array of sites for a network or networks.
2404
+ *
2405
+ * @since 3.7.0
2406
+ *
2407
+ * @param array $args {
2408
+ * Array of default arguments. Optional.
2409
+ *
2410
+ * @type int|array $network_id A network ID or array of network IDs. Set to null to retrieve sites
2411
+ * from all networks. Defaults to current network ID.
2412
+ * @type int $public Retrieve public or non-public sites. Default null, for any.
2413
+ * @type int $archived Retrieve archived or non-archived sites. Default null, for any.
2414
+ * @type int $mature Retrieve mature or non-mature sites. Default null, for any.
2415
+ * @type int $spam Retrieve spam or non-spam sites. Default null, for any.
2416
+ * @type int $deleted Retrieve deleted or non-deleted sites. Default null, for any.
2417
+ * @type int $limit Number of sites to limit the query to. Default 100.
2418
+ * @type int $offset Exclude the first x sites. Used in combination with the $limit parameter. Default 0.
2419
+ * }
2420
+ * @return array An empty array if the install is considered "large" via wp_is_large_network(). Otherwise,
2421
+ * an associative array of site data arrays, each containing the site (network) ID, blog ID,
2422
+ * site domain and path, dates registered and modified, and the language ID. Also, boolean
2423
+ * values for whether the site is public, archived, mature, spam, and/or deleted.
2424
+ */
2425
+ function wp_get_sites( $args = array() ) {
2426
+ global $wpdb;
2427
+
2428
+ if ( wp_is_large_network() )
2429
+ return array();
2430
+
2431
+ $defaults = array(
2432
+ 'network_id' => $wpdb->siteid,
2433
+ 'public' => null,
2434
+ 'archived' => null,
2435
+ 'mature' => null,
2436
+ 'spam' => null,
2437
+ 'deleted' => null,
2438
+ 'limit' => 100,
2439
+ 'offset' => 0,
2440
+ );
2441
+
2442
+ $args = wp_parse_args( $args, $defaults );
2443
+
2444
+ $query = "SELECT * FROM $wpdb->blogs WHERE 1=1 ";
2445
+
2446
+ if ( isset( $args['network_id'] ) && ( is_array( $args['network_id'] ) || is_numeric( $args['network_id'] ) ) ) {
2447
+ $network_ids = implode( ',', wp_parse_id_list( $args['network_id'] ) );
2448
+ $query .= "AND site_id IN ($network_ids) ";
2449
+ }
2450
+
2451
+ if ( isset( $args['public'] ) )
2452
+ $query .= $wpdb->prepare( "AND public = %d ", $args['public'] );
2453
+
2454
+ if ( isset( $args['archived'] ) )
2455
+ $query .= $wpdb->prepare( "AND archived = %d ", $args['archived'] );
2456
+
2457
+ if ( isset( $args['mature'] ) )
2458
+ $query .= $wpdb->prepare( "AND mature = %d ", $args['mature'] );
2459
+
2460
+ if ( isset( $args['spam'] ) )
2461
+ $query .= $wpdb->prepare( "AND spam = %d ", $args['spam'] );
2462
+
2463
+ if ( isset( $args['deleted'] ) )
2464
+ $query .= $wpdb->prepare( "AND deleted = %d ", $args['deleted'] );
2465
+
2466
+ if ( isset( $args['limit'] ) && $args['limit'] ) {
2467
+ if ( isset( $args['offset'] ) && $args['offset'] )
2468
+ $query .= $wpdb->prepare( "LIMIT %d , %d ", $args['offset'], $args['limit'] );
2469
+ else
2470
+ $query .= $wpdb->prepare( "LIMIT %d ", $args['limit'] );
2471
+ }
2472
+
2473
+ $site_results = $wpdb->get_results( $query, ARRAY_A );
2474
+
2475
+ return $site_results;
2476
+ }