stump-cli 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
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,57 @@
1
+ <?php
2
+ /**
3
+ * Your Rights administration panel.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Administration
7
+ */
8
+
9
+ /** WordPress Administration Bootstrap */
10
+ require_once( dirname( __FILE__ ) . '/admin.php' );
11
+
12
+ $title = __( 'Freedoms' );
13
+
14
+ list( $display_version ) = explode( '-', $wp_version );
15
+
16
+ include( ABSPATH . 'wp-admin/admin-header.php' );
17
+ ?>
18
+ <div class="wrap about-wrap">
19
+
20
+ <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
21
+
22
+ <div class="about-text"><?php printf( __( 'Thank you for updating! WordPress %s brings you a smoother writing and management experience.' ), $display_version ); ?></div>
23
+
24
+ <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
25
+
26
+ <h2 class="nav-tab-wrapper">
27
+ <a href="about.php" class="nav-tab">
28
+ <?php _e( 'What&#8217;s New' ); ?>
29
+ </a><a href="credits.php" class="nav-tab">
30
+ <?php _e( 'Credits' ); ?>
31
+ </a><a href="freedoms.php" class="nav-tab nav-tab-active">
32
+ <?php _e( 'Freedoms' ); ?>
33
+ </a>
34
+ </h2>
35
+
36
+ <p class="about-description"><?php printf( __( 'WordPress is Free and open source software, built by a distributed community of mostly volunteer developers from around the world. WordPress comes with some awesome, worldview-changing rights courtesy of its <a href="%s">license</a>, the GPL.' ), 'https://wordpress.org/about/license/' ); ?></p>
37
+
38
+ <ol start="0">
39
+ <li><p><?php _e( 'You have the freedom to run the program, for any purpose.' ); ?></p></li>
40
+ <li><p><?php _e( 'You have access to the source code, the freedom to study how the program works, and the freedom to change it to make it do what you wish.' ); ?></p></li>
41
+ <li><p><?php _e( 'You have the freedom to redistribute copies of the original program so you can help your neighbor.' ); ?></p></li>
42
+ <li><p><?php _e( 'You have the freedom to distribute copies of your modified versions to others. By doing this you can give the whole community a chance to benefit from your changes.' ); ?></p></li>
43
+ </ol>
44
+
45
+ <p><?php printf( __( 'WordPress grows when people like you tell their friends about it, and the thousands of businesses and services that are built on and around WordPress share that fact with their users. We&#8217;re flattered every time someone spreads the good word, just make sure to <a href="%s">check out our trademark guidelines</a> first.' ), 'http://wordpressfoundation.org/trademark-policy/' ); ?></p>
46
+
47
+ <p><?php
48
+
49
+ $plugins_url = current_user_can( 'activate_plugins' ) ? admin_url( 'plugins.php' ) : 'https://wordpress.org/plugins/';
50
+ $themes_url = current_user_can( 'switch_themes' ) ? admin_url( 'themes.php' ) : 'https://wordpress.org/themes/';
51
+
52
+ printf( __( 'Every plugin and theme in WordPress.org&#8217;s directory is 100%% GPL or a similarly free and compatible license, so you can feel safe finding <a href="%1$s">plugins</a> and <a href="%2$s">themes</a> there. If you get a plugin or theme from another source, make sure to <a href="%3$s">ask them if it&#8217;s GPL</a> first. If they don&#8217;t respect the WordPress license, we don&#8217;t recommend them.' ), $plugins_url, $themes_url, 'https://wordpress.org/about/license/' ); ?></p>
53
+
54
+ <p><?php _e( 'Don&#8217;t you wish all software came with these freedoms? So do we! For more information, check out the <a href="http://www.fsf.org/">Free Software Foundation</a>.' ); ?></p>
55
+
56
+ </div>
57
+ <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve"><style>.style0{fill:#fff;}</style><g><g><path d="M4.548 31.999c0 10.9 6.3 20.3 15.5 24.706L6.925 20.827C5.402 24.2 4.5 28 4.5 31.999z M50.531 30.614c0-3.394-1.219-5.742-2.264-7.57c-1.391-2.263-2.695-4.177-2.695-6.439c0-2.523 1.912-4.872 4.609-4.872 c0.121 0 0.2 0 0.4 0.022C45.653 7.3 39.1 4.5 32 4.548c-9.591 0-18.027 4.921-22.936 12.4 c0.645 0 1.3 0 1.8 0.033c2.871 0 7.316-0.349 7.316-0.349c1.479-0.086 1.7 2.1 0.2 2.3 c0 0-1.487 0.174-3.142 0.261l9.997 29.735l6.008-18.017l-4.276-11.718c-1.479-0.087-2.879-0.261-2.879-0.261 c-1.48-0.087-1.306-2.349 0.174-2.262c0 0 4.5 0.3 7.2 0.349c2.87 0 7.317-0.349 7.317-0.349 c1.479-0.086 1.7 2.1 0.2 2.262c0 0-1.489 0.174-3.142 0.261l9.92 29.508l2.739-9.148 C49.628 35.7 50.5 33 50.5 30.614z M32.481 34.4l-8.237 23.934c2.46 0.7 5.1 1.1 7.8 1.1 c3.197 0 6.262-0.552 9.116-1.556c-0.072-0.118-0.141-0.243-0.196-0.379L32.481 34.4z M56.088 18.8 c0.119 0.9 0.2 1.8 0.2 2.823c0 2.785-0.521 5.916-2.088 9.832l-8.385 24.242c8.161-4.758 13.65-13.6 13.65-23.728 C59.451 27.2 58.2 22.7 56.1 18.83z M32 0c-17.645 0-32 14.355-32 32C0 49.6 14.4 64 32 64s32-14.355 32-32.001 C64 14.4 49.6 0 32 0z M32 62.533c-16.835 0-30.533-13.698-30.533-30.534C1.467 15.2 15.2 1.5 32 1.5 s30.534 13.7 30.5 30.532C62.533 48.8 48.8 62.5 32 62.533z" class="style0"/></g></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve"><style>.style0{fill: #0074A2;}</style><g><g><path d="M4.548 31.999c0 10.9 6.3 20.3 15.5 24.706L6.925 20.827C5.402 24.2 4.5 28 4.5 31.999z M50.531 30.614c0-3.394-1.219-5.742-2.264-7.57c-1.391-2.263-2.695-4.177-2.695-6.439c0-2.523 1.912-4.872 4.609-4.872 c0.121 0 0.2 0 0.4 0.022C45.653 7.3 39.1 4.5 32 4.548c-9.591 0-18.027 4.921-22.936 12.4 c0.645 0 1.3 0 1.8 0.033c2.871 0 7.316-0.349 7.316-0.349c1.479-0.086 1.7 2.1 0.2 2.3 c0 0-1.487 0.174-3.142 0.261l9.997 29.735l6.008-18.017l-4.276-11.718c-1.479-0.087-2.879-0.261-2.879-0.261 c-1.48-0.087-1.306-2.349 0.174-2.262c0 0 4.5 0.3 7.2 0.349c2.87 0 7.317-0.349 7.317-0.349 c1.479-0.086 1.7 2.1 0.2 2.262c0 0-1.489 0.174-3.142 0.261l9.92 29.508l2.739-9.148 C49.628 35.7 50.5 33 50.5 30.614z M32.481 34.4l-8.237 23.934c2.46 0.7 5.1 1.1 7.8 1.1 c3.197 0 6.262-0.552 9.116-1.556c-0.072-0.118-0.141-0.243-0.196-0.379L32.481 34.4z M56.088 18.8 c0.119 0.9 0.2 1.8 0.2 2.823c0 2.785-0.521 5.916-2.088 9.832l-8.385 24.242c8.161-4.758 13.65-13.6 13.65-23.728 C59.451 27.2 58.2 22.7 56.1 18.83z M32 0c-17.645 0-32 14.355-32 32C0 49.6 14.4 64 32 64s32-14.355 32-32.001 C64 14.4 49.6 0 32 0z M32 62.533c-16.835 0-30.533-13.698-30.533-30.534C1.467 15.2 15.2 1.5 32 1.5 s30.534 13.7 30.5 30.532C62.533 48.8 48.8 62.5 32 62.533z" class="style0"/></g></g></svg>
Binary file
Binary file
Binary file
@@ -0,0 +1,132 @@
1
+ <?php
2
+ /**
3
+ * Import WordPress Administration Screen
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Administration
7
+ */
8
+
9
+ define('WP_LOAD_IMPORTERS', true);
10
+
11
+ /** Load WordPress Bootstrap */
12
+ require_once( dirname( __FILE__ ) . '/admin.php' );
13
+
14
+ if ( !current_user_can('import') )
15
+ wp_die(__('You do not have sufficient permissions to import content in this site.'));
16
+
17
+ $title = __('Import');
18
+
19
+ get_current_screen()->add_help_tab( array(
20
+ 'id' => 'overview',
21
+ 'title' => __('Overview'),
22
+ 'content' => '<p>' . __('This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.') . '</p>' .
23
+ '<p>' . __('In previous versions of WordPress, all importers were built-in. They have been turned into plugins since most people only use them once or infrequently.') . '</p>',
24
+ ) );
25
+
26
+ get_current_screen()->set_help_sidebar(
27
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
28
+ '<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_Screen" target="_blank">Documentation on Import</a>') . '</p>' .
29
+ '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
30
+ );
31
+
32
+ if ( current_user_can( 'install_plugins' ) )
33
+ $popular_importers = wp_get_popular_importers();
34
+ else
35
+ $popular_importers = array();
36
+
37
+ // Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'
38
+ if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) {
39
+ $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id'];
40
+ if ( $importer_id != $_GET['invalid'] ) { // Prevent redirect loops.
41
+ wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) );
42
+ exit;
43
+ }
44
+ unset( $importer_id );
45
+ }
46
+
47
+ add_thickbox();
48
+ wp_enqueue_script( 'plugin-install' );
49
+
50
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
51
+ $parent_file = 'tools.php';
52
+ ?>
53
+
54
+ <div class="wrap">
55
+ <h2><?php echo esc_html( $title ); ?></h2>
56
+ <?php if ( ! empty( $_GET['invalid'] ) ) : ?>
57
+ <div class="error"><p><strong><?php _e('ERROR:')?></strong> <?php printf( __('The <strong>%s</strong> importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?></p></div>
58
+ <?php endif; ?>
59
+ <p><?php _e('If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:'); ?></p>
60
+
61
+ <?php
62
+
63
+ $importers = get_importers();
64
+
65
+ // If a popular importer is not registered, create a dummy registration that links to the plugin installer.
66
+ foreach ( $popular_importers as $pop_importer => $pop_data ) {
67
+ if ( isset( $importers[ $pop_importer ] ) )
68
+ continue;
69
+ if ( isset( $importers[ $pop_data['importer-id'] ] ) )
70
+ continue;
71
+ $importers[ $pop_data['importer-id'] ] = array( $pop_data['name'], $pop_data['description'], 'install' => $pop_data['plugin-slug'] );
72
+ }
73
+
74
+ if ( empty( $importers ) ) {
75
+ echo '<p>' . __('No importers are available.') . '</p>'; // TODO: make more helpful
76
+ } else {
77
+ uasort( $importers, '_usort_by_first_member' );
78
+ ?>
79
+ <table class="widefat importers">
80
+
81
+ <?php
82
+ $alt = '';
83
+ foreach ($importers as $importer_id => $data) {
84
+ $action = '';
85
+ if ( isset( $data['install'] ) ) {
86
+ $plugin_slug = $data['install'];
87
+ if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) {
88
+ // Looks like Importer is installed, But not active
89
+ $plugins = get_plugins( '/' . $plugin_slug );
90
+ if ( !empty($plugins) ) {
91
+ $keys = array_keys($plugins);
92
+ $plugin_file = $plugin_slug . '/' . $keys[0];
93
+ $action = '<a href="' . esc_url(wp_nonce_url(admin_url('plugins.php?action=activate&plugin=' . $plugin_file . '&from=import'), 'activate-plugin_' . $plugin_file)) .
94
+ '"title="' . esc_attr__('Activate importer') . '"">' . $data[0] . '</a>';
95
+ }
96
+ }
97
+ if ( empty($action) ) {
98
+ if ( is_main_site() ) {
99
+ $action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
100
+ '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
101
+ esc_attr__('Install importer') . '">' . $data[0] . '</a>';
102
+ } else {
103
+ $action = $data[0];
104
+ $data[1] = sprintf( __( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ), get_admin_url( $current_site->blog_id, 'import.php' ) );
105
+ }
106
+ }
107
+ } else {
108
+ $action = "<a href='" . esc_url( "admin.php?import=$importer_id" ) . "' title='" . esc_attr( wptexturize( strip_tags( $data[1] ) ) ) ."'>{$data[0]}</a>";
109
+ }
110
+
111
+ $alt = $alt ? '' : ' class="alternate"';
112
+ echo "
113
+ <tr$alt>
114
+ <td class='import-system row-title'>$action</td>
115
+ <td class='desc'>{$data[1]}</td>
116
+ </tr>";
117
+ }
118
+ ?>
119
+
120
+ </table>
121
+ <?php
122
+ }
123
+
124
+ if ( current_user_can('install_plugins') )
125
+ echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugin directory</a> to see if an importer is available.'), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
126
+ ?>
127
+
128
+ </div>
129
+
130
+ <?php
131
+
132
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
@@ -0,0 +1,74 @@
1
+ <?php
2
+ /**
3
+ * Includes all of the WordPress Administration API files.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Administration
7
+ */
8
+
9
+ if ( ! defined('WP_ADMIN') ) {
10
+ /*
11
+ * This file is being included from a file other than wp-admin/admin.php, so
12
+ * some setup was skipped. Make sure the admin message catalog is loaded since
13
+ * load_default_textdomain() will not have done so in this context.
14
+ */
15
+ load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' );
16
+ }
17
+
18
+ /** WordPress Bookmark Administration API */
19
+ require_once(ABSPATH . 'wp-admin/includes/bookmark.php');
20
+
21
+ /** WordPress Comment Administration API */
22
+ require_once(ABSPATH . 'wp-admin/includes/comment.php');
23
+
24
+ /** WordPress Administration File API */
25
+ require_once(ABSPATH . 'wp-admin/includes/file.php');
26
+
27
+ /** WordPress Image Administration API */
28
+ require_once(ABSPATH . 'wp-admin/includes/image.php');
29
+
30
+ /** WordPress Media Administration API */
31
+ require_once(ABSPATH . 'wp-admin/includes/media.php');
32
+
33
+ /** WordPress Import Administration API */
34
+ require_once(ABSPATH . 'wp-admin/includes/import.php');
35
+
36
+ /** WordPress Misc Administration API */
37
+ require_once(ABSPATH . 'wp-admin/includes/misc.php');
38
+
39
+ /** WordPress Plugin Administration API */
40
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
41
+
42
+ /** WordPress Post Administration API */
43
+ require_once(ABSPATH . 'wp-admin/includes/post.php');
44
+
45
+ /** WordPress Administration Screen API */
46
+ require_once(ABSPATH . 'wp-admin/includes/screen.php');
47
+
48
+ /** WordPress Taxonomy Administration API */
49
+ require_once(ABSPATH . 'wp-admin/includes/taxonomy.php');
50
+
51
+ /** WordPress Template Administration API */
52
+ require_once(ABSPATH . 'wp-admin/includes/template.php');
53
+
54
+ /** WordPress List Table Administration API and base class */
55
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
56
+ require_once(ABSPATH . 'wp-admin/includes/list-table.php');
57
+
58
+ /** WordPress Theme Administration API */
59
+ require_once(ABSPATH . 'wp-admin/includes/theme.php');
60
+
61
+ /** WordPress User Administration API */
62
+ require_once(ABSPATH . 'wp-admin/includes/user.php');
63
+
64
+ /** WordPress Update Administration API */
65
+ require_once(ABSPATH . 'wp-admin/includes/update.php');
66
+
67
+ /** WordPress Deprecated Administration API */
68
+ require_once(ABSPATH . 'wp-admin/includes/deprecated.php');
69
+
70
+ /** WordPress Multisite support API */
71
+ if ( is_multisite() ) {
72
+ require_once(ABSPATH . 'wp-admin/includes/ms.php');
73
+ require_once(ABSPATH . 'wp-admin/includes/ms-deprecated.php');
74
+ }
@@ -0,0 +1,2762 @@
1
+ <?php
2
+ /**
3
+ * WordPress Core Ajax Handlers.
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Administration
7
+ */
8
+
9
+ //
10
+ // No-privilege Ajax handlers.
11
+ //
12
+
13
+ /**
14
+ * Ajax handler for the Heartbeat API in
15
+ * the no-privilege context.
16
+ *
17
+ * Runs when the user is not logged in.
18
+ *
19
+ * @since 3.6.0
20
+ */
21
+ function wp_ajax_nopriv_heartbeat() {
22
+ $response = array();
23
+
24
+ // screen_id is the same as $current_screen->id and the JS global 'pagenow'.
25
+ if ( ! empty($_POST['screen_id']) )
26
+ $screen_id = sanitize_key($_POST['screen_id']);
27
+ else
28
+ $screen_id = 'front';
29
+
30
+ if ( ! empty($_POST['data']) ) {
31
+ $data = wp_unslash( (array) $_POST['data'] );
32
+
33
+ /**
34
+ * Filter Heartbeat AJAX response in no-privilege environments.
35
+ *
36
+ * @since 3.6.0
37
+ *
38
+ * @param array|object $response The no-priv Heartbeat response object or array.
39
+ * @param array $data An array of data passed via $_POST.
40
+ * @param string $screen_id The screen id.
41
+ */
42
+ $response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );
43
+ }
44
+
45
+ /**
46
+ * Filter Heartbeat AJAX response when no data is passed.
47
+ *
48
+ * @since 3.6.0
49
+ *
50
+ * @param array|object $response The Heartbeat response object or array.
51
+ * @param string $screen_id The screen id.
52
+ */
53
+ $response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id );
54
+
55
+ /**
56
+ * Fires when Heartbeat ticks in no-privilege environments.
57
+ *
58
+ * Allows the transport to be easily replaced with long-polling.
59
+ *
60
+ * @since 3.6.0
61
+ *
62
+ * @param array|object $response The no-priv Heartbeat response.
63
+ * @param string $screen_id The screen id.
64
+ */
65
+ do_action( 'heartbeat_nopriv_tick', $response, $screen_id );
66
+
67
+ // Send the current time according to the server.
68
+ $response['server_time'] = time();
69
+
70
+ wp_send_json($response);
71
+ }
72
+
73
+ //
74
+ // GET-based Ajax handlers.
75
+ //
76
+
77
+ /**
78
+ * Ajax handler for fetching a list table.
79
+ *
80
+ * @since 3.1.0
81
+ */
82
+ function wp_ajax_fetch_list() {
83
+ global $wp_list_table;
84
+
85
+ $list_class = $_GET['list_args']['class'];
86
+ check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
87
+
88
+ $wp_list_table = _get_list_table( $list_class, array( 'screen' => $_GET['list_args']['screen']['id'] ) );
89
+ if ( ! $wp_list_table )
90
+ wp_die( 0 );
91
+
92
+ if ( ! $wp_list_table->ajax_user_can() )
93
+ wp_die( -1 );
94
+
95
+ $wp_list_table->ajax_response();
96
+
97
+ wp_die( 0 );
98
+ }
99
+
100
+ /**
101
+ * Ajax handler for tag search.
102
+ *
103
+ * @since 3.1.0
104
+ */
105
+ function wp_ajax_ajax_tag_search() {
106
+ if ( isset( $_GET['tax'] ) ) {
107
+ $taxonomy = sanitize_key( $_GET['tax'] );
108
+ $tax = get_taxonomy( $taxonomy );
109
+ if ( ! $tax )
110
+ wp_die( 0 );
111
+ if ( ! current_user_can( $tax->cap->assign_terms ) )
112
+ wp_die( -1 );
113
+ } else {
114
+ wp_die( 0 );
115
+ }
116
+
117
+ $s = wp_unslash( $_GET['q'] );
118
+
119
+ $comma = _x( ',', 'tag delimiter' );
120
+ if ( ',' !== $comma )
121
+ $s = str_replace( $comma, ',', $s );
122
+ if ( false !== strpos( $s, ',' ) ) {
123
+ $s = explode( ',', $s );
124
+ $s = $s[count( $s ) - 1];
125
+ }
126
+ $s = trim( $s );
127
+
128
+ /**
129
+ * Filter the minimum number of characters required to fire a tag search via AJAX.
130
+ *
131
+ * @since 4.0.0
132
+ *
133
+ * @param int $characters The minimum number of characters required. Default 2.
134
+ * @param object $tax The taxonomy object.
135
+ * @param string $s The search term.
136
+ */
137
+ $term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $tax, $s );
138
+
139
+ /*
140
+ * Require $term_search_min_chars chars for matching (default: 2)
141
+ * ensure it's a non-negative, non-zero integer.
142
+ */
143
+ if ( ( $term_search_min_chars == 0 ) || ( strlen( $s ) < $term_search_min_chars ) ){
144
+ wp_die();
145
+ }
146
+
147
+ $results = get_terms( $taxonomy, array( 'name__like' => $s, 'fields' => 'names', 'hide_empty' => false ) );
148
+
149
+ echo join( $results, "\n" );
150
+ wp_die();
151
+ }
152
+
153
+ /**
154
+ * Ajax handler for compression testing.
155
+ *
156
+ * @since 3.1.0
157
+ */
158
+ function wp_ajax_wp_compression_test() {
159
+ if ( !current_user_can( 'manage_options' ) )
160
+ wp_die( -1 );
161
+
162
+ if ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ) {
163
+ update_site_option('can_compress_scripts', 0);
164
+ wp_die( 0 );
165
+ }
166
+
167
+ if ( isset($_GET['test']) ) {
168
+ header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
169
+ header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
170
+ header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
171
+ header( 'Pragma: no-cache' );
172
+ header('Content-Type: application/x-javascript; charset=UTF-8');
173
+ $force_gzip = ( defined('ENFORCE_GZIP') && ENFORCE_GZIP );
174
+ $test_str = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."';
175
+
176
+ if ( 1 == $_GET['test'] ) {
177
+ echo $test_str;
178
+ wp_die();
179
+ } elseif ( 2 == $_GET['test'] ) {
180
+ if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
181
+ wp_die( -1 );
182
+ if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
183
+ header('Content-Encoding: deflate');
184
+ $out = gzdeflate( $test_str, 1 );
185
+ } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
186
+ header('Content-Encoding: gzip');
187
+ $out = gzencode( $test_str, 1 );
188
+ } else {
189
+ wp_die( -1 );
190
+ }
191
+ echo $out;
192
+ wp_die();
193
+ } elseif ( 'no' == $_GET['test'] ) {
194
+ update_site_option('can_compress_scripts', 0);
195
+ } elseif ( 'yes' == $_GET['test'] ) {
196
+ update_site_option('can_compress_scripts', 1);
197
+ }
198
+ }
199
+
200
+ wp_die( 0 );
201
+ }
202
+
203
+ /**
204
+ * Ajax handler for image editor previews.
205
+ *
206
+ * @since 3.1.0
207
+ */
208
+ function wp_ajax_imgedit_preview() {
209
+ $post_id = intval($_GET['postid']);
210
+ if ( empty($post_id) || !current_user_can('edit_post', $post_id) )
211
+ wp_die( -1 );
212
+
213
+ check_ajax_referer( "image_editor-$post_id" );
214
+
215
+ include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
216
+ if ( ! stream_preview_image($post_id) )
217
+ wp_die( -1 );
218
+
219
+ wp_die();
220
+ }
221
+
222
+ /**
223
+ * Ajax handler for oEmbed caching.
224
+ *
225
+ * @since 3.1.0
226
+ */
227
+ function wp_ajax_oembed_cache() {
228
+ $GLOBALS['wp_embed']->cache_oembed( $_GET['post'] );
229
+ wp_die( 0 );
230
+ }
231
+
232
+ /**
233
+ * Ajax handler for user autocomplete.
234
+ *
235
+ * @since 3.4.0
236
+ */
237
+ function wp_ajax_autocomplete_user() {
238
+ if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) )
239
+ wp_die( -1 );
240
+
241
+ /** This filter is documented in wp-admin/user-new.php */
242
+ if ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
243
+ wp_die( -1 );
244
+
245
+ $return = array();
246
+
247
+ // Check the type of request
248
+ // Current allowed values are `add` and `search`
249
+ if ( isset( $_REQUEST['autocomplete_type'] ) && 'search' === $_REQUEST['autocomplete_type'] ) {
250
+ $type = $_REQUEST['autocomplete_type'];
251
+ } else {
252
+ $type = 'add';
253
+ }
254
+
255
+ // Check the desired field for value
256
+ // Current allowed values are `user_email` and `user_login`
257
+ if ( isset( $_REQUEST['autocomplete_field'] ) && 'user_email' === $_REQUEST['autocomplete_field'] ) {
258
+ $field = $_REQUEST['autocomplete_field'];
259
+ } else {
260
+ $field = 'user_login';
261
+ }
262
+
263
+ // Exclude current users of this blog
264
+ if ( isset( $_REQUEST['site_id'] ) ) {
265
+ $id = absint( $_REQUEST['site_id'] );
266
+ } else {
267
+ $id = get_current_blog_id();
268
+ }
269
+
270
+ $include_blog_users = ( $type == 'search' ? get_users( array( 'blog_id' => $id, 'fields' => 'ID' ) ) : array() );
271
+ $exclude_blog_users = ( $type == 'add' ? get_users( array( 'blog_id' => $id, 'fields' => 'ID' ) ) : array() );
272
+
273
+ $users = get_users( array(
274
+ 'blog_id' => false,
275
+ 'search' => '*' . $_REQUEST['term'] . '*',
276
+ 'include' => $include_blog_users,
277
+ 'exclude' => $exclude_blog_users,
278
+ 'search_columns' => array( 'user_login', 'user_nicename', 'user_email' ),
279
+ ) );
280
+
281
+ foreach ( $users as $user ) {
282
+ $return[] = array(
283
+ /* translators: 1: user_login, 2: user_email */
284
+ 'label' => sprintf( __( '%1$s (%2$s)' ), $user->user_login, $user->user_email ),
285
+ 'value' => $user->$field,
286
+ );
287
+ }
288
+
289
+ wp_die( json_encode( $return ) );
290
+ }
291
+
292
+ /**
293
+ * Ajax handler for dashboard widgets.
294
+ *
295
+ * @since 3.4.0
296
+ */
297
+ function wp_ajax_dashboard_widgets() {
298
+ require_once ABSPATH . 'wp-admin/includes/dashboard.php';
299
+
300
+ $pagenow = $_GET['pagenow'];
301
+ if ( $pagenow === 'dashboard-user' || $pagenow === 'dashboard-network' || $pagenow === 'dashboard' ) {
302
+ set_current_screen( $pagenow );
303
+ }
304
+
305
+ switch ( $_GET['widget'] ) {
306
+ case 'dashboard_primary' :
307
+ wp_dashboard_primary();
308
+ break;
309
+ }
310
+ wp_die();
311
+ }
312
+
313
+ /**
314
+ * Ajax handler for Customizer preview logged-in status.
315
+ *
316
+ * @since 3.4.0
317
+ */
318
+ function wp_ajax_logged_in() {
319
+ wp_die( 1 );
320
+ }
321
+
322
+ //
323
+ // Ajax helpers.
324
+ //
325
+
326
+ /**
327
+ * Sends back current comment total and new page links if they need to be updated.
328
+ *
329
+ * Contrary to normal success AJAX response ("1"), die with time() on success.
330
+ *
331
+ * @since 2.7.0
332
+ *
333
+ * @param int $comment_id
334
+ * @return die
335
+ */
336
+ function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {
337
+ $total = isset( $_POST['_total'] ) ? (int) $_POST['_total'] : 0;
338
+ $per_page = isset( $_POST['_per_page'] ) ? (int) $_POST['_per_page'] : 0;
339
+ $page = isset( $_POST['_page'] ) ? (int) $_POST['_page'] : 0;
340
+ $url = isset( $_POST['_url'] ) ? esc_url_raw( $_POST['_url'] ) : '';
341
+
342
+ // JS didn't send us everything we need to know. Just die with success message
343
+ if ( !$total || !$per_page || !$page || !$url )
344
+ wp_die( time() );
345
+
346
+ $total += $delta;
347
+ if ( $total < 0 )
348
+ $total = 0;
349
+
350
+ // Only do the expensive stuff on a page-break, and about 1 other time per page
351
+ if ( 0 == $total % $per_page || 1 == mt_rand( 1, $per_page ) ) {
352
+ $post_id = 0;
353
+ $status = 'total_comments'; // What type of comment count are we looking for?
354
+ $parsed = parse_url( $url );
355
+ if ( isset( $parsed['query'] ) ) {
356
+ parse_str( $parsed['query'], $query_vars );
357
+ if ( !empty( $query_vars['comment_status'] ) )
358
+ $status = $query_vars['comment_status'];
359
+ if ( !empty( $query_vars['p'] ) )
360
+ $post_id = (int) $query_vars['p'];
361
+ }
362
+
363
+ $comment_count = wp_count_comments($post_id);
364
+
365
+ // We're looking for a known type of comment count.
366
+ if ( isset( $comment_count->$status ) )
367
+ $total = $comment_count->$status;
368
+ // Else use the decremented value from above.
369
+ }
370
+
371
+ // The time since the last comment count.
372
+ $time = time();
373
+
374
+ $x = new WP_Ajax_Response( array(
375
+ 'what' => 'comment',
376
+ // Here for completeness - not used.
377
+ 'id' => $comment_id,
378
+ 'supplemental' => array(
379
+ 'total_items_i18n' => sprintf( _n( '1 item', '%s items', $total ), number_format_i18n( $total ) ),
380
+ 'total_pages' => ceil( $total / $per_page ),
381
+ 'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ),
382
+ 'total' => $total,
383
+ 'time' => $time
384
+ )
385
+ ) );
386
+ $x->send();
387
+ }
388
+
389
+ //
390
+ // POST-based Ajax handlers.
391
+ //
392
+
393
+ /**
394
+ * Ajax handler for adding a hierarchical term.
395
+ *
396
+ * @since 3.1.0
397
+ */
398
+ function _wp_ajax_add_hierarchical_term() {
399
+ $action = $_POST['action'];
400
+ $taxonomy = get_taxonomy(substr($action, 4));
401
+ check_ajax_referer( $action, '_ajax_nonce-add-' . $taxonomy->name );
402
+ if ( !current_user_can( $taxonomy->cap->edit_terms ) )
403
+ wp_die( -1 );
404
+ $names = explode(',', $_POST['new'.$taxonomy->name]);
405
+ $parent = isset($_POST['new'.$taxonomy->name.'_parent']) ? (int) $_POST['new'.$taxonomy->name.'_parent'] : 0;
406
+ if ( 0 > $parent )
407
+ $parent = 0;
408
+ if ( $taxonomy->name == 'category' )
409
+ $post_category = isset($_POST['post_category']) ? (array) $_POST['post_category'] : array();
410
+ else
411
+ $post_category = ( isset($_POST['tax_input']) && isset($_POST['tax_input'][$taxonomy->name]) ) ? (array) $_POST['tax_input'][$taxonomy->name] : array();
412
+ $checked_categories = array_map( 'absint', (array) $post_category );
413
+ $popular_ids = wp_popular_terms_checklist($taxonomy->name, 0, 10, false);
414
+
415
+ foreach ( $names as $cat_name ) {
416
+ $cat_name = trim($cat_name);
417
+ $category_nicename = sanitize_title($cat_name);
418
+ if ( '' === $category_nicename )
419
+ continue;
420
+ if ( !$cat_id = term_exists( $cat_name, $taxonomy->name, $parent ) )
421
+ $cat_id = wp_insert_term( $cat_name, $taxonomy->name, array( 'parent' => $parent ) );
422
+ if ( is_wp_error( $cat_id ) )
423
+ continue;
424
+ else if ( is_array( $cat_id ) )
425
+ $cat_id = $cat_id['term_id'];
426
+ $checked_categories[] = $cat_id;
427
+ if ( $parent ) // Do these all at once in a second
428
+ continue;
429
+ ob_start();
430
+ wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name, 'descendants_and_self' => $cat_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids ));
431
+ $data = ob_get_contents();
432
+ ob_end_clean();
433
+ $add = array(
434
+ 'what' => $taxonomy->name,
435
+ 'id' => $cat_id,
436
+ 'data' => str_replace( array("\n", "\t"), '', $data),
437
+ 'position' => -1
438
+ );
439
+ }
440
+
441
+ if ( $parent ) { // Foncy - replace the parent and all its children
442
+ $parent = get_term( $parent, $taxonomy->name );
443
+ $term_id = $parent->term_id;
444
+
445
+ while ( $parent->parent ) { // get the top parent
446
+ $parent = get_term( $parent->parent, $taxonomy->name );
447
+ if ( is_wp_error( $parent ) )
448
+ break;
449
+ $term_id = $parent->term_id;
450
+ }
451
+
452
+ ob_start();
453
+ wp_terms_checklist( 0, array('taxonomy' => $taxonomy->name, 'descendants_and_self' => $term_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids));
454
+ $data = ob_get_contents();
455
+ ob_end_clean();
456
+ $add = array(
457
+ 'what' => $taxonomy->name,
458
+ 'id' => $term_id,
459
+ 'data' => str_replace( array("\n", "\t"), '', $data),
460
+ 'position' => -1
461
+ );
462
+ }
463
+
464
+ ob_start();
465
+ wp_dropdown_categories( array(
466
+ 'taxonomy' => $taxonomy->name, 'hide_empty' => 0, 'name' => 'new'.$taxonomy->name.'_parent', 'orderby' => 'name',
467
+ 'hierarchical' => 1, 'show_option_none' => '&mdash; '.$taxonomy->labels->parent_item.' &mdash;'
468
+ ) );
469
+ $sup = ob_get_contents();
470
+ ob_end_clean();
471
+ $add['supplemental'] = array( 'newcat_parent' => $sup );
472
+
473
+ $x = new WP_Ajax_Response( $add );
474
+ $x->send();
475
+ }
476
+
477
+ /**
478
+ * Ajax handler for deleting a comment.
479
+ *
480
+ * @since 3.1.0
481
+ */
482
+ function wp_ajax_delete_comment() {
483
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
484
+
485
+ if ( !$comment = get_comment( $id ) )
486
+ wp_die( time() );
487
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) )
488
+ wp_die( -1 );
489
+
490
+ check_ajax_referer( "delete-comment_$id" );
491
+ $status = wp_get_comment_status( $comment->comment_ID );
492
+
493
+ $delta = -1;
494
+ if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
495
+ if ( 'trash' == $status )
496
+ wp_die( time() );
497
+ $r = wp_trash_comment( $comment->comment_ID );
498
+ } elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) {
499
+ if ( 'trash' != $status )
500
+ wp_die( time() );
501
+ $r = wp_untrash_comment( $comment->comment_ID );
502
+ if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash' ) // undo trash, not in trash
503
+ $delta = 1;
504
+ } elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
505
+ if ( 'spam' == $status )
506
+ wp_die( time() );
507
+ $r = wp_spam_comment( $comment->comment_ID );
508
+ } elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) {
509
+ if ( 'spam' != $status )
510
+ wp_die( time() );
511
+ $r = wp_unspam_comment( $comment->comment_ID );
512
+ if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam' ) // undo spam, not in spam
513
+ $delta = 1;
514
+ } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
515
+ $r = wp_delete_comment( $comment->comment_ID );
516
+ } else {
517
+ wp_die( -1 );
518
+ }
519
+
520
+ if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts
521
+ _wp_ajax_delete_comment_response( $comment->comment_ID, $delta );
522
+ wp_die( 0 );
523
+ }
524
+
525
+ /**
526
+ * Ajax handler for deleting a tag.
527
+ *
528
+ * @since 3.1.0
529
+ */
530
+ function wp_ajax_delete_tag() {
531
+ $tag_id = (int) $_POST['tag_ID'];
532
+ check_ajax_referer( "delete-tag_$tag_id" );
533
+
534
+ $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
535
+ $tax = get_taxonomy($taxonomy);
536
+
537
+ if ( !current_user_can( $tax->cap->delete_terms ) )
538
+ wp_die( -1 );
539
+
540
+ $tag = get_term( $tag_id, $taxonomy );
541
+ if ( !$tag || is_wp_error( $tag ) )
542
+ wp_die( 1 );
543
+
544
+ if ( wp_delete_term($tag_id, $taxonomy))
545
+ wp_die( 1 );
546
+ else
547
+ wp_die( 0 );
548
+ }
549
+
550
+ /**
551
+ * Ajax handler for deleting a link.
552
+ *
553
+ * @since 3.1.0
554
+ */
555
+ function wp_ajax_delete_link() {
556
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
557
+
558
+ check_ajax_referer( "delete-bookmark_$id" );
559
+ if ( !current_user_can( 'manage_links' ) )
560
+ wp_die( -1 );
561
+
562
+ $link = get_bookmark( $id );
563
+ if ( !$link || is_wp_error( $link ) )
564
+ wp_die( 1 );
565
+
566
+ if ( wp_delete_link( $id ) )
567
+ wp_die( 1 );
568
+ else
569
+ wp_die( 0 );
570
+ }
571
+
572
+ /**
573
+ * Ajax handler for deleting meta.
574
+ *
575
+ * @since 3.1.0
576
+ */
577
+ function wp_ajax_delete_meta() {
578
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
579
+
580
+ check_ajax_referer( "delete-meta_$id" );
581
+ if ( !$meta = get_metadata_by_mid( 'post', $id ) )
582
+ wp_die( 1 );
583
+
584
+ if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $meta->post_id, $meta->meta_key ) )
585
+ wp_die( -1 );
586
+ if ( delete_meta( $meta->meta_id ) )
587
+ wp_die( 1 );
588
+ wp_die( 0 );
589
+ }
590
+
591
+ /**
592
+ * Ajax handler for deleting a post.
593
+ *
594
+ * @since 3.1.0
595
+ *
596
+ * @param string $action Action to perform.
597
+ */
598
+ function wp_ajax_delete_post( $action ) {
599
+ if ( empty( $action ) )
600
+ $action = 'delete-post';
601
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
602
+
603
+ check_ajax_referer( "{$action}_$id" );
604
+ if ( !current_user_can( 'delete_post', $id ) )
605
+ wp_die( -1 );
606
+
607
+ if ( !get_post( $id ) )
608
+ wp_die( 1 );
609
+
610
+ if ( wp_delete_post( $id ) )
611
+ wp_die( 1 );
612
+ else
613
+ wp_die( 0 );
614
+ }
615
+
616
+ /**
617
+ * Ajax handler for sending a post to the trash.
618
+ *
619
+ * @since 3.1.0
620
+ *
621
+ * @param string $action Action to perform.
622
+ */
623
+ function wp_ajax_trash_post( $action ) {
624
+ if ( empty( $action ) )
625
+ $action = 'trash-post';
626
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
627
+
628
+ check_ajax_referer( "{$action}_$id" );
629
+ if ( !current_user_can( 'delete_post', $id ) )
630
+ wp_die( -1 );
631
+
632
+ if ( !get_post( $id ) )
633
+ wp_die( 1 );
634
+
635
+ if ( 'trash-post' == $action )
636
+ $done = wp_trash_post( $id );
637
+ else
638
+ $done = wp_untrash_post( $id );
639
+
640
+ if ( $done )
641
+ wp_die( 1 );
642
+
643
+ wp_die( 0 );
644
+ }
645
+
646
+ /**
647
+ * Ajax handler to restore a post from the trash.
648
+ *
649
+ * @since 3.1.0
650
+ *
651
+ * @param string $action Action to perform.
652
+ */
653
+ function wp_ajax_untrash_post( $action ) {
654
+ if ( empty( $action ) )
655
+ $action = 'untrash-post';
656
+ wp_ajax_trash_post( $action );
657
+ }
658
+
659
+ function wp_ajax_delete_page( $action ) {
660
+ if ( empty( $action ) )
661
+ $action = 'delete-page';
662
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
663
+
664
+ check_ajax_referer( "{$action}_$id" );
665
+ if ( !current_user_can( 'delete_page', $id ) )
666
+ wp_die( -1 );
667
+
668
+ if ( ! get_post( $id ) )
669
+ wp_die( 1 );
670
+
671
+ if ( wp_delete_post( $id ) )
672
+ wp_die( 1 );
673
+ else
674
+ wp_die( 0 );
675
+ }
676
+
677
+ /**
678
+ * Ajax handler to dim a comment.
679
+ *
680
+ * @since 3.1.0
681
+ */
682
+ function wp_ajax_dim_comment() {
683
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
684
+
685
+ if ( !$comment = get_comment( $id ) ) {
686
+ $x = new WP_Ajax_Response( array(
687
+ 'what' => 'comment',
688
+ 'id' => new WP_Error('invalid_comment', sprintf(__('Comment %d does not exist'), $id))
689
+ ) );
690
+ $x->send();
691
+ }
692
+
693
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && ! current_user_can( 'moderate_comments' ) )
694
+ wp_die( -1 );
695
+
696
+ $current = wp_get_comment_status( $comment->comment_ID );
697
+ if ( isset( $_POST['new'] ) && $_POST['new'] == $current )
698
+ wp_die( time() );
699
+
700
+ check_ajax_referer( "approve-comment_$id" );
701
+ if ( in_array( $current, array( 'unapproved', 'spam' ) ) )
702
+ $result = wp_set_comment_status( $comment->comment_ID, 'approve', true );
703
+ else
704
+ $result = wp_set_comment_status( $comment->comment_ID, 'hold', true );
705
+
706
+ if ( is_wp_error($result) ) {
707
+ $x = new WP_Ajax_Response( array(
708
+ 'what' => 'comment',
709
+ 'id' => $result
710
+ ) );
711
+ $x->send();
712
+ }
713
+
714
+ // Decide if we need to send back '1' or a more complicated response including page links and comment counts
715
+ _wp_ajax_delete_comment_response( $comment->comment_ID );
716
+ wp_die( 0 );
717
+ }
718
+
719
+ /**
720
+ * Ajax handler for deleting a link category.
721
+ *
722
+ * @since 3.1.0
723
+ *
724
+ * @param string $action Action to perform.
725
+ */
726
+ function wp_ajax_add_link_category( $action ) {
727
+ if ( empty( $action ) )
728
+ $action = 'add-link-category';
729
+ check_ajax_referer( $action );
730
+ if ( !current_user_can( 'manage_categories' ) )
731
+ wp_die( -1 );
732
+ $names = explode(',', wp_unslash( $_POST['newcat'] ) );
733
+ $x = new WP_Ajax_Response();
734
+ foreach ( $names as $cat_name ) {
735
+ $cat_name = trim($cat_name);
736
+ $slug = sanitize_title($cat_name);
737
+ if ( '' === $slug )
738
+ continue;
739
+ if ( !$cat_id = term_exists( $cat_name, 'link_category' ) )
740
+ $cat_id = wp_insert_term( $cat_name, 'link_category' );
741
+ if ( is_wp_error( $cat_id ) )
742
+ continue;
743
+ else if ( is_array( $cat_id ) )
744
+ $cat_id = $cat_id['term_id'];
745
+ $cat_name = esc_html( $cat_name );
746
+ $x->add( array(
747
+ 'what' => 'link-category',
748
+ 'id' => $cat_id,
749
+ 'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='" . esc_attr($cat_id) . "' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>",
750
+ 'position' => -1
751
+ ) );
752
+ }
753
+ $x->send();
754
+ }
755
+
756
+ /**
757
+ * Ajax handler to add a tag.
758
+ *
759
+ * @since 3.1.0
760
+ */
761
+ function wp_ajax_add_tag() {
762
+ global $wp_list_table;
763
+
764
+ check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
765
+ $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
766
+ $tax = get_taxonomy($taxonomy);
767
+
768
+ if ( !current_user_can( $tax->cap->edit_terms ) )
769
+ wp_die( -1 );
770
+
771
+ $x = new WP_Ajax_Response();
772
+
773
+ $tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST );
774
+
775
+ if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) {
776
+ $message = __('An error has occurred. Please reload the page and try again.');
777
+ if ( is_wp_error($tag) && $tag->get_error_message() )
778
+ $message = $tag->get_error_message();
779
+
780
+ $x->add( array(
781
+ 'what' => 'taxonomy',
782
+ 'data' => new WP_Error('error', $message )
783
+ ) );
784
+ $x->send();
785
+ }
786
+
787
+ $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => $_POST['screen'] ) );
788
+
789
+ $level = 0;
790
+ if ( is_taxonomy_hierarchical($taxonomy) ) {
791
+ $level = count( get_ancestors( $tag->term_id, $taxonomy ) );
792
+ ob_start();
793
+ $wp_list_table->single_row( $tag, $level );
794
+ $noparents = ob_get_clean();
795
+ }
796
+
797
+ ob_start();
798
+ $wp_list_table->single_row( $tag );
799
+ $parents = ob_get_clean();
800
+
801
+ $x->add( array(
802
+ 'what' => 'taxonomy',
803
+ 'supplemental' => compact('parents', 'noparents')
804
+ ) );
805
+ $x->add( array(
806
+ 'what' => 'term',
807
+ 'position' => $level,
808
+ 'supplemental' => (array) $tag
809
+ ) );
810
+ $x->send();
811
+ }
812
+
813
+ /**
814
+ * Ajax handler for getting a tagcloud.
815
+ *
816
+ * @since 3.1.0
817
+ */
818
+ function wp_ajax_get_tagcloud() {
819
+ if ( isset( $_POST['tax'] ) ) {
820
+ $taxonomy = sanitize_key( $_POST['tax'] );
821
+ $tax = get_taxonomy( $taxonomy );
822
+ if ( ! $tax )
823
+ wp_die( 0 );
824
+ if ( ! current_user_can( $tax->cap->assign_terms ) )
825
+ wp_die( -1 );
826
+ } else {
827
+ wp_die( 0 );
828
+ }
829
+
830
+ $tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
831
+
832
+ if ( empty( $tags ) )
833
+ wp_die( $tax->labels->not_found );
834
+
835
+ if ( is_wp_error( $tags ) )
836
+ wp_die( $tags->get_error_message() );
837
+
838
+ foreach ( $tags as $key => $tag ) {
839
+ $tags[ $key ]->link = '#';
840
+ $tags[ $key ]->id = $tag->term_id;
841
+ }
842
+
843
+ // We need raw tag names here, so don't filter the output
844
+ $return = wp_generate_tag_cloud( $tags, array('filter' => 0) );
845
+
846
+ if ( empty($return) )
847
+ wp_die( 0 );
848
+
849
+ echo $return;
850
+
851
+ wp_die();
852
+ }
853
+
854
+ /**
855
+ * Ajax handler for getting comments.
856
+ *
857
+ * @since 3.1.0
858
+ *
859
+ * @param string $action Action to perform.
860
+ */
861
+ function wp_ajax_get_comments( $action ) {
862
+ global $wp_list_table, $post_id;
863
+ if ( empty( $action ) )
864
+ $action = 'get-comments';
865
+
866
+ check_ajax_referer( $action );
867
+
868
+ if ( empty( $post_id ) && ! empty( $_REQUEST['p'] ) ) {
869
+ $id = absint( $_REQUEST['p'] );
870
+ if ( ! empty( $id ) )
871
+ $post_id = $id;
872
+ }
873
+
874
+ if ( empty( $post_id ) )
875
+ wp_die( -1 );
876
+
877
+ $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
878
+
879
+ if ( ! current_user_can( 'edit_post', $post_id ) )
880
+ wp_die( -1 );
881
+
882
+ $wp_list_table->prepare_items();
883
+
884
+ if ( !$wp_list_table->has_items() )
885
+ wp_die( 1 );
886
+
887
+ $x = new WP_Ajax_Response();
888
+ ob_start();
889
+ foreach ( $wp_list_table->items as $comment ) {
890
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) )
891
+ continue;
892
+ get_comment( $comment );
893
+ $wp_list_table->single_row( $comment );
894
+ }
895
+ $comment_list_item = ob_get_contents();
896
+ ob_end_clean();
897
+
898
+ $x->add( array(
899
+ 'what' => 'comments',
900
+ 'data' => $comment_list_item
901
+ ) );
902
+ $x->send();
903
+ }
904
+
905
+ /**
906
+ * Ajax handler for replying to a comment.
907
+ *
908
+ * @since 3.1.0
909
+ *
910
+ * @param string $action Action to perform.
911
+ */
912
+ function wp_ajax_replyto_comment( $action ) {
913
+ global $wp_list_table;
914
+ if ( empty( $action ) )
915
+ $action = 'replyto-comment';
916
+
917
+ check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
918
+
919
+ $comment_post_ID = (int) $_POST['comment_post_ID'];
920
+ $post = get_post( $comment_post_ID );
921
+ if ( ! $post )
922
+ wp_die( -1 );
923
+
924
+ if ( !current_user_can( 'edit_post', $comment_post_ID ) )
925
+ wp_die( -1 );
926
+
927
+ if ( empty( $post->post_status ) )
928
+ wp_die( 1 );
929
+ elseif ( in_array($post->post_status, array('draft', 'pending', 'trash') ) )
930
+ wp_die( __('ERROR: you are replying to a comment on a draft post.') );
931
+
932
+ $user = wp_get_current_user();
933
+ if ( $user->exists() ) {
934
+ $user_ID = $user->ID;
935
+ $comment_author = wp_slash( $user->display_name );
936
+ $comment_author_email = wp_slash( $user->user_email );
937
+ $comment_author_url = wp_slash( $user->user_url );
938
+ $comment_content = trim( $_POST['content'] );
939
+ $comment_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : '';
940
+ if ( current_user_can( 'unfiltered_html' ) ) {
941
+ if ( ! isset( $_POST['_wp_unfiltered_html_comment'] ) )
942
+ $_POST['_wp_unfiltered_html_comment'] = '';
943
+
944
+ if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
945
+ kses_remove_filters(); // start with a clean slate
946
+ kses_init_filters(); // set up the filters
947
+ }
948
+ }
949
+ } else {
950
+ wp_die( __( 'Sorry, you must be logged in to reply to a comment.' ) );
951
+ }
952
+
953
+ if ( '' == $comment_content )
954
+ wp_die( __( 'ERROR: please type a comment.' ) );
955
+
956
+ $comment_parent = 0;
957
+ if ( isset( $_POST['comment_ID'] ) )
958
+ $comment_parent = absint( $_POST['comment_ID'] );
959
+ $comment_auto_approved = false;
960
+ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
961
+
962
+ // Automatically approve parent comment.
963
+ if ( !empty($_POST['approve_parent']) ) {
964
+ $parent = get_comment( $comment_parent );
965
+
966
+ if ( $parent && $parent->comment_approved === '0' && $parent->comment_post_ID == $comment_post_ID ) {
967
+ if ( wp_set_comment_status( $parent->comment_ID, 'approve' ) )
968
+ $comment_auto_approved = true;
969
+ }
970
+ }
971
+
972
+ $comment_id = wp_new_comment( $commentdata );
973
+ $comment = get_comment($comment_id);
974
+ if ( ! $comment ) wp_die( 1 );
975
+
976
+ $position = ( isset($_POST['position']) && (int) $_POST['position'] ) ? (int) $_POST['position'] : '-1';
977
+
978
+ ob_start();
979
+ if ( isset( $_REQUEST['mode'] ) && 'dashboard' == $_REQUEST['mode'] ) {
980
+ require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
981
+ _wp_dashboard_recent_comments_row( $comment );
982
+ } else {
983
+ if ( isset( $_REQUEST['mode'] ) && 'single' == $_REQUEST['mode'] ) {
984
+ $wp_list_table = _get_list_table('WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
985
+ } else {
986
+ $wp_list_table = _get_list_table('WP_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
987
+ }
988
+ $wp_list_table->single_row( $comment );
989
+ }
990
+ $comment_list_item = ob_get_clean();
991
+
992
+ $response = array(
993
+ 'what' => 'comment',
994
+ 'id' => $comment->comment_ID,
995
+ 'data' => $comment_list_item,
996
+ 'position' => $position
997
+ );
998
+
999
+ if ( $comment_auto_approved )
1000
+ $response['supplemental'] = array( 'parent_approved' => $parent->comment_ID );
1001
+
1002
+ $x = new WP_Ajax_Response();
1003
+ $x->add( $response );
1004
+ $x->send();
1005
+ }
1006
+
1007
+ /**
1008
+ * Ajax handler for editing a comment.
1009
+ *
1010
+ * @since 3.1.0
1011
+ */
1012
+ function wp_ajax_edit_comment() {
1013
+ global $wp_list_table;
1014
+
1015
+ check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' );
1016
+
1017
+ $comment_id = (int) $_POST['comment_ID'];
1018
+ if ( ! current_user_can( 'edit_comment', $comment_id ) )
1019
+ wp_die( -1 );
1020
+
1021
+ if ( '' == $_POST['content'] )
1022
+ wp_die( __( 'ERROR: please type a comment.' ) );
1023
+
1024
+ if ( isset( $_POST['status'] ) )
1025
+ $_POST['comment_status'] = $_POST['status'];
1026
+ edit_comment();
1027
+
1028
+ $position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
1029
+ $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
1030
+ $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-comments' ) );
1031
+
1032
+ $comment = get_comment( $comment_id );
1033
+ if ( empty( $comment->comment_ID ) )
1034
+ wp_die( -1 );
1035
+
1036
+ ob_start();
1037
+ $wp_list_table->single_row( $comment );
1038
+ $comment_list_item = ob_get_clean();
1039
+
1040
+ $x = new WP_Ajax_Response();
1041
+
1042
+ $x->add( array(
1043
+ 'what' => 'edit_comment',
1044
+ 'id' => $comment->comment_ID,
1045
+ 'data' => $comment_list_item,
1046
+ 'position' => $position
1047
+ ));
1048
+
1049
+ $x->send();
1050
+ }
1051
+
1052
+ /**
1053
+ * Ajax handler for adding a menu item.
1054
+ *
1055
+ * @since 3.1.0
1056
+ */
1057
+ function wp_ajax_add_menu_item() {
1058
+ check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );
1059
+
1060
+ if ( ! current_user_can( 'edit_theme_options' ) )
1061
+ wp_die( -1 );
1062
+
1063
+ require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
1064
+
1065
+ // For performance reasons, we omit some object properties from the checklist.
1066
+ // The following is a hacky way to restore them when adding non-custom items.
1067
+
1068
+ $menu_items_data = array();
1069
+ foreach ( (array) $_POST['menu-item'] as $menu_item_data ) {
1070
+ if (
1071
+ ! empty( $menu_item_data['menu-item-type'] ) &&
1072
+ 'custom' != $menu_item_data['menu-item-type'] &&
1073
+ ! empty( $menu_item_data['menu-item-object-id'] )
1074
+ ) {
1075
+ switch( $menu_item_data['menu-item-type'] ) {
1076
+ case 'post_type' :
1077
+ $_object = get_post( $menu_item_data['menu-item-object-id'] );
1078
+ break;
1079
+
1080
+ case 'taxonomy' :
1081
+ $_object = get_term( $menu_item_data['menu-item-object-id'], $menu_item_data['menu-item-object'] );
1082
+ break;
1083
+ }
1084
+
1085
+ $_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) );
1086
+ $_menu_item = array_shift( $_menu_items );
1087
+
1088
+ // Restore the missing menu item properties
1089
+ $menu_item_data['menu-item-description'] = $_menu_item->description;
1090
+ }
1091
+
1092
+ $menu_items_data[] = $menu_item_data;
1093
+ }
1094
+
1095
+ $item_ids = wp_save_nav_menu_items( 0, $menu_items_data );
1096
+ if ( is_wp_error( $item_ids ) )
1097
+ wp_die( 0 );
1098
+
1099
+ $menu_items = array();
1100
+
1101
+ foreach ( (array) $item_ids as $menu_item_id ) {
1102
+ $menu_obj = get_post( $menu_item_id );
1103
+ if ( ! empty( $menu_obj->ID ) ) {
1104
+ $menu_obj = wp_setup_nav_menu_item( $menu_obj );
1105
+ $menu_obj->label = $menu_obj->title; // don't show "(pending)" in ajax-added items
1106
+ $menu_items[] = $menu_obj;
1107
+ }
1108
+ }
1109
+
1110
+ /** This filter is documented in wp-admin/includes/nav-menu.php */
1111
+ $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] );
1112
+
1113
+ if ( ! class_exists( $walker_class_name ) )
1114
+ wp_die( 0 );
1115
+
1116
+ if ( ! empty( $menu_items ) ) {
1117
+ $args = array(
1118
+ 'after' => '',
1119
+ 'before' => '',
1120
+ 'link_after' => '',
1121
+ 'link_before' => '',
1122
+ 'walker' => new $walker_class_name,
1123
+ );
1124
+ echo walk_nav_menu_tree( $menu_items, 0, (object) $args );
1125
+ }
1126
+ wp_die();
1127
+ }
1128
+
1129
+ /**
1130
+ * Ajax handler for adding meta.
1131
+ *
1132
+ * @since 3.1.0
1133
+ */
1134
+ function wp_ajax_add_meta() {
1135
+ check_ajax_referer( 'add-meta', '_ajax_nonce-add-meta' );
1136
+ $c = 0;
1137
+ $pid = (int) $_POST['post_id'];
1138
+ $post = get_post( $pid );
1139
+
1140
+ if ( isset($_POST['metakeyselect']) || isset($_POST['metakeyinput']) ) {
1141
+ if ( !current_user_can( 'edit_post', $pid ) )
1142
+ wp_die( -1 );
1143
+ if ( isset($_POST['metakeyselect']) && '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput']) )
1144
+ wp_die( 1 );
1145
+ if ( $post->post_status == 'auto-draft' ) {
1146
+ $save_POST = $_POST; // Backup $_POST
1147
+ $_POST = array(); // Make it empty for edit_post()
1148
+ $_POST['action'] = 'draft'; // Warning fix
1149
+ $_POST['post_ID'] = $pid;
1150
+ $_POST['post_type'] = $post->post_type;
1151
+ $_POST['post_status'] = 'draft';
1152
+ $now = current_time('timestamp', 1);
1153
+ $_POST['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( get_option( 'date_format' ), $now ), date( get_option( 'time_format' ), $now ) );
1154
+
1155
+ if ( $pid = edit_post() ) {
1156
+ if ( is_wp_error( $pid ) ) {
1157
+ $x = new WP_Ajax_Response( array(
1158
+ 'what' => 'meta',
1159
+ 'data' => $pid
1160
+ ) );
1161
+ $x->send();
1162
+ }
1163
+ $_POST = $save_POST; // Now we can restore original $_POST again
1164
+ if ( !$mid = add_meta( $pid ) )
1165
+ wp_die( __( 'Please provide a custom field value.' ) );
1166
+ } else {
1167
+ wp_die( 0 );
1168
+ }
1169
+ } else if ( !$mid = add_meta( $pid ) ) {
1170
+ wp_die( __( 'Please provide a custom field value.' ) );
1171
+ }
1172
+
1173
+ $meta = get_metadata_by_mid( 'post', $mid );
1174
+ $pid = (int) $meta->post_id;
1175
+ $meta = get_object_vars( $meta );
1176
+ $x = new WP_Ajax_Response( array(
1177
+ 'what' => 'meta',
1178
+ 'id' => $mid,
1179
+ 'data' => _list_meta_row( $meta, $c ),
1180
+ 'position' => 1,
1181
+ 'supplemental' => array('postid' => $pid)
1182
+ ) );
1183
+ } else { // Update?
1184
+ $mid = (int) key( $_POST['meta'] );
1185
+ $key = wp_unslash( $_POST['meta'][$mid]['key'] );
1186
+ $value = wp_unslash( $_POST['meta'][$mid]['value'] );
1187
+ if ( '' == trim($key) )
1188
+ wp_die( __( 'Please provide a custom field name.' ) );
1189
+ if ( '' == trim($value) )
1190
+ wp_die( __( 'Please provide a custom field value.' ) );
1191
+ if ( ! $meta = get_metadata_by_mid( 'post', $mid ) )
1192
+ wp_die( 0 ); // if meta doesn't exist
1193
+ if ( is_protected_meta( $meta->meta_key, 'post' ) || is_protected_meta( $key, 'post' ) ||
1194
+ ! current_user_can( 'edit_post_meta', $meta->post_id, $meta->meta_key ) ||
1195
+ ! current_user_can( 'edit_post_meta', $meta->post_id, $key ) )
1196
+ wp_die( -1 );
1197
+ if ( $meta->meta_value != $value || $meta->meta_key != $key ) {
1198
+ if ( !$u = update_metadata_by_mid( 'post', $mid, $value, $key ) )
1199
+ wp_die( 0 ); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
1200
+ }
1201
+
1202
+ $x = new WP_Ajax_Response( array(
1203
+ 'what' => 'meta',
1204
+ 'id' => $mid, 'old_id' => $mid,
1205
+ 'data' => _list_meta_row( array(
1206
+ 'meta_key' => $key,
1207
+ 'meta_value' => $value,
1208
+ 'meta_id' => $mid
1209
+ ), $c ),
1210
+ 'position' => 0,
1211
+ 'supplemental' => array('postid' => $meta->post_id)
1212
+ ) );
1213
+ }
1214
+ $x->send();
1215
+ }
1216
+
1217
+ /**
1218
+ * Ajax handler for adding a user.
1219
+ *
1220
+ * @since 3.1.0
1221
+ *
1222
+ * @param string $action Action to perform.
1223
+ */
1224
+ function wp_ajax_add_user( $action ) {
1225
+ global $wp_list_table;
1226
+ if ( empty( $action ) )
1227
+ $action = 'add-user';
1228
+
1229
+ check_ajax_referer( $action );
1230
+ if ( ! current_user_can('create_users') )
1231
+ wp_die( -1 );
1232
+ if ( ! $user_id = edit_user() ) {
1233
+ wp_die( 0 );
1234
+ } elseif ( is_wp_error( $user_id ) ) {
1235
+ $x = new WP_Ajax_Response( array(
1236
+ 'what' => 'user',
1237
+ 'id' => $user_id
1238
+ ) );
1239
+ $x->send();
1240
+ }
1241
+ $user_object = get_userdata( $user_id );
1242
+
1243
+ $wp_list_table = _get_list_table('WP_Users_List_Table');
1244
+
1245
+ $role = current( $user_object->roles );
1246
+
1247
+ $x = new WP_Ajax_Response( array(
1248
+ 'what' => 'user',
1249
+ 'id' => $user_id,
1250
+ 'data' => $wp_list_table->single_row( $user_object, '', $role ),
1251
+ 'supplemental' => array(
1252
+ 'show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login),
1253
+ 'role' => $role,
1254
+ )
1255
+ ) );
1256
+ $x->send();
1257
+ }
1258
+
1259
+ /**
1260
+ * Ajax handler for closed post boxes.
1261
+ *
1262
+ * @since 3.1.0
1263
+ */
1264
+ function wp_ajax_closed_postboxes() {
1265
+ check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' );
1266
+ $closed = isset( $_POST['closed'] ) ? explode( ',', $_POST['closed']) : array();
1267
+ $closed = array_filter($closed);
1268
+
1269
+ $hidden = isset( $_POST['hidden'] ) ? explode( ',', $_POST['hidden']) : array();
1270
+ $hidden = array_filter($hidden);
1271
+
1272
+ $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
1273
+
1274
+ if ( $page != sanitize_key( $page ) )
1275
+ wp_die( 0 );
1276
+
1277
+ if ( ! $user = wp_get_current_user() )
1278
+ wp_die( -1 );
1279
+
1280
+ if ( is_array($closed) )
1281
+ update_user_option($user->ID, "closedpostboxes_$page", $closed, true);
1282
+
1283
+ if ( is_array($hidden) ) {
1284
+ $hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv', 'manage-menu', 'create-menu') ); // postboxes that are always shown
1285
+ update_user_option($user->ID, "metaboxhidden_$page", $hidden, true);
1286
+ }
1287
+
1288
+ wp_die( 1 );
1289
+ }
1290
+
1291
+ /**
1292
+ * Ajax handler for hidden columns.
1293
+ *
1294
+ * @since 3.1.0
1295
+ */
1296
+ function wp_ajax_hidden_columns() {
1297
+ check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
1298
+ $hidden = explode( ',', isset( $_POST['hidden'] ) ? $_POST['hidden'] : '' );
1299
+ $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
1300
+
1301
+ if ( $page != sanitize_key( $page ) )
1302
+ wp_die( 0 );
1303
+
1304
+ if ( ! $user = wp_get_current_user() )
1305
+ wp_die( -1 );
1306
+
1307
+ if ( is_array($hidden) )
1308
+ update_user_option($user->ID, "manage{$page}columnshidden", $hidden, true);
1309
+
1310
+ wp_die( 1 );
1311
+ }
1312
+
1313
+ /**
1314
+ * Ajax handler for updating whether to display the welcome panel.
1315
+ *
1316
+ * @since 3.1.0
1317
+ */
1318
+ function wp_ajax_update_welcome_panel() {
1319
+ check_ajax_referer( 'welcome-panel-nonce', 'welcomepanelnonce' );
1320
+
1321
+ if ( ! current_user_can( 'edit_theme_options' ) )
1322
+ wp_die( -1 );
1323
+
1324
+ update_user_meta( get_current_user_id(), 'show_welcome_panel', empty( $_POST['visible'] ) ? 0 : 1 );
1325
+
1326
+ wp_die( 1 );
1327
+ }
1328
+
1329
+ /**
1330
+ * Ajax handler for retrieving menu meta boxes.
1331
+ *
1332
+ * @since 3.1.0
1333
+ */
1334
+ function wp_ajax_menu_get_metabox() {
1335
+ if ( ! current_user_can( 'edit_theme_options' ) )
1336
+ wp_die( -1 );
1337
+
1338
+ require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
1339
+
1340
+ if ( isset( $_POST['item-type'] ) && 'post_type' == $_POST['item-type'] ) {
1341
+ $type = 'posttype';
1342
+ $callback = 'wp_nav_menu_item_post_type_meta_box';
1343
+ $items = (array) get_post_types( array( 'show_in_nav_menus' => true ), 'object' );
1344
+ } elseif ( isset( $_POST['item-type'] ) && 'taxonomy' == $_POST['item-type'] ) {
1345
+ $type = 'taxonomy';
1346
+ $callback = 'wp_nav_menu_item_taxonomy_meta_box';
1347
+ $items = (array) get_taxonomies( array( 'show_ui' => true ), 'object' );
1348
+ }
1349
+
1350
+ if ( ! empty( $_POST['item-object'] ) && isset( $items[$_POST['item-object']] ) ) {
1351
+ $menus_meta_box_object = $items[ $_POST['item-object'] ];
1352
+
1353
+ /** This filter is documented in wp-admin/includes/nav-menu.php */
1354
+ $item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
1355
+ ob_start();
1356
+ call_user_func_array($callback, array(
1357
+ null,
1358
+ array(
1359
+ 'id' => 'add-' . $item->name,
1360
+ 'title' => $item->labels->name,
1361
+ 'callback' => $callback,
1362
+ 'args' => $item,
1363
+ )
1364
+ ));
1365
+
1366
+ $markup = ob_get_clean();
1367
+
1368
+ echo json_encode(array(
1369
+ 'replace-id' => $type . '-' . $item->name,
1370
+ 'markup' => $markup,
1371
+ ));
1372
+ }
1373
+
1374
+ wp_die();
1375
+ }
1376
+
1377
+ /**
1378
+ * Ajax handler for internal linking.
1379
+ *
1380
+ * @since 3.1.0
1381
+ */
1382
+ function wp_ajax_wp_link_ajax() {
1383
+ check_ajax_referer( 'internal-linking', '_ajax_linking_nonce' );
1384
+
1385
+ $args = array();
1386
+
1387
+ if ( isset( $_POST['search'] ) )
1388
+ $args['s'] = wp_unslash( $_POST['search'] );
1389
+ $args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;
1390
+
1391
+ require(ABSPATH . WPINC . '/class-wp-editor.php');
1392
+ $results = _WP_Editors::wp_link_query( $args );
1393
+
1394
+ if ( ! isset( $results ) )
1395
+ wp_die( 0 );
1396
+
1397
+ echo json_encode( $results );
1398
+ echo "\n";
1399
+
1400
+ wp_die();
1401
+ }
1402
+
1403
+ /**
1404
+ * Ajax handler for menu locations save.
1405
+ *
1406
+ * @since 3.1.0
1407
+ */
1408
+ function wp_ajax_menu_locations_save() {
1409
+ if ( ! current_user_can( 'edit_theme_options' ) )
1410
+ wp_die( -1 );
1411
+ check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );
1412
+ if ( ! isset( $_POST['menu-locations'] ) )
1413
+ wp_die( 0 );
1414
+ set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) );
1415
+ wp_die( 1 );
1416
+ }
1417
+
1418
+ /**
1419
+ * Ajax handler for saving the meta box order.
1420
+ *
1421
+ * @since 3.1.0
1422
+ */
1423
+ function wp_ajax_meta_box_order() {
1424
+ check_ajax_referer( 'meta-box-order' );
1425
+ $order = isset( $_POST['order'] ) ? (array) $_POST['order'] : false;
1426
+ $page_columns = isset( $_POST['page_columns'] ) ? $_POST['page_columns'] : 'auto';
1427
+
1428
+ if ( $page_columns != 'auto' )
1429
+ $page_columns = (int) $page_columns;
1430
+
1431
+ $page = isset( $_POST['page'] ) ? $_POST['page'] : '';
1432
+
1433
+ if ( $page != sanitize_key( $page ) )
1434
+ wp_die( 0 );
1435
+
1436
+ if ( ! $user = wp_get_current_user() )
1437
+ wp_die( -1 );
1438
+
1439
+ if ( $order )
1440
+ update_user_option($user->ID, "meta-box-order_$page", $order, true);
1441
+
1442
+ if ( $page_columns )
1443
+ update_user_option($user->ID, "screen_layout_$page", $page_columns, true);
1444
+
1445
+ wp_die( 1 );
1446
+ }
1447
+
1448
+ /**
1449
+ * Ajax handler for menu quick searching.
1450
+ *
1451
+ * @since 3.1.0
1452
+ */
1453
+ function wp_ajax_menu_quick_search() {
1454
+ if ( ! current_user_can( 'edit_theme_options' ) )
1455
+ wp_die( -1 );
1456
+
1457
+ require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
1458
+
1459
+ _wp_ajax_menu_quick_search( $_POST );
1460
+
1461
+ wp_die();
1462
+ }
1463
+
1464
+ /**
1465
+ * Ajax handler to retrieve a permalink.
1466
+ *
1467
+ * @since 3.1.0
1468
+ */
1469
+ function wp_ajax_get_permalink() {
1470
+ check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
1471
+ $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0;
1472
+ wp_die( add_query_arg( array( 'preview' => 'true' ), get_permalink( $post_id ) ) );
1473
+ }
1474
+
1475
+ /**
1476
+ * Ajax handler to retrieve a sample permalink.
1477
+ *
1478
+ * @since 3.1.0
1479
+ */
1480
+ function wp_ajax_sample_permalink() {
1481
+ check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' );
1482
+ $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0;
1483
+ $title = isset($_POST['new_title'])? $_POST['new_title'] : '';
1484
+ $slug = isset($_POST['new_slug'])? $_POST['new_slug'] : null;
1485
+ wp_die( get_sample_permalink_html( $post_id, $title, $slug ) );
1486
+ }
1487
+
1488
+ /**
1489
+ * Ajax handler for quick edit saving for a post.
1490
+ *
1491
+ * @since 3.1.0
1492
+ */
1493
+ function wp_ajax_inline_save() {
1494
+ global $wp_list_table;
1495
+
1496
+ check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
1497
+
1498
+ if ( ! isset($_POST['post_ID']) || ! ( $post_ID = (int) $_POST['post_ID'] ) )
1499
+ wp_die();
1500
+
1501
+ if ( 'page' == $_POST['post_type'] ) {
1502
+ if ( ! current_user_can( 'edit_page', $post_ID ) )
1503
+ wp_die( __( 'You are not allowed to edit this page.' ) );
1504
+ } else {
1505
+ if ( ! current_user_can( 'edit_post', $post_ID ) )
1506
+ wp_die( __( 'You are not allowed to edit this post.' ) );
1507
+ }
1508
+
1509
+ if ( $last = wp_check_post_lock( $post_ID ) ) {
1510
+ $last_user = get_userdata( $last );
1511
+ $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
1512
+ printf( $_POST['post_type'] == 'page' ? __( 'Saving is disabled: %s is currently editing this page.' ) : __( 'Saving is disabled: %s is currently editing this post.' ), esc_html( $last_user_name ) );
1513
+ wp_die();
1514
+ }
1515
+
1516
+ $data = &$_POST;
1517
+
1518
+ $post = get_post( $post_ID, ARRAY_A );
1519
+
1520
+ // Since it's coming from the database.
1521
+ $post = wp_slash($post);
1522
+
1523
+ $data['content'] = $post['post_content'];
1524
+ $data['excerpt'] = $post['post_excerpt'];
1525
+
1526
+ // Rename.
1527
+ $data['user_ID'] = get_current_user_id();
1528
+
1529
+ if ( isset($data['post_parent']) )
1530
+ $data['parent_id'] = $data['post_parent'];
1531
+
1532
+ // Status.
1533
+ if ( isset($data['keep_private']) && 'private' == $data['keep_private'] )
1534
+ $data['post_status'] = 'private';
1535
+ else
1536
+ $data['post_status'] = $data['_status'];
1537
+
1538
+ if ( empty($data['comment_status']) )
1539
+ $data['comment_status'] = 'closed';
1540
+ if ( empty($data['ping_status']) )
1541
+ $data['ping_status'] = 'closed';
1542
+
1543
+ // Hack: wp_unique_post_slug() doesn't work for drafts, so we will fake that our post is published.
1544
+ if ( ! empty( $data['post_name'] ) && in_array( $post['post_status'], array( 'draft', 'pending' ) ) ) {
1545
+ $post['post_status'] = 'publish';
1546
+ $data['post_name'] = wp_unique_post_slug( $data['post_name'], $post['ID'], $post['post_status'], $post['post_type'], $post['post_parent'] );
1547
+ }
1548
+
1549
+ // Update the post.
1550
+ edit_post();
1551
+
1552
+ $wp_list_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => $_POST['screen'] ) );
1553
+
1554
+ $level = 0;
1555
+ $request_post = array( get_post( $_POST['post_ID'] ) );
1556
+ $parent = $request_post[0]->post_parent;
1557
+
1558
+ while ( $parent > 0 ) {
1559
+ $parent_post = get_post( $parent );
1560
+ $parent = $parent_post->post_parent;
1561
+ $level++;
1562
+ }
1563
+
1564
+ $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ), $level );
1565
+
1566
+ wp_die();
1567
+ }
1568
+
1569
+ /**
1570
+ * Ajax handler for quick edit saving for a term.
1571
+ *
1572
+ * @since 3.1.0
1573
+ */
1574
+ function wp_ajax_inline_save_tax() {
1575
+ global $wp_list_table;
1576
+
1577
+ check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
1578
+
1579
+ $taxonomy = sanitize_key( $_POST['taxonomy'] );
1580
+ $tax = get_taxonomy( $taxonomy );
1581
+ if ( ! $tax )
1582
+ wp_die( 0 );
1583
+
1584
+ if ( ! current_user_can( $tax->cap->edit_terms ) )
1585
+ wp_die( -1 );
1586
+
1587
+ $wp_list_table = _get_list_table( 'WP_Terms_List_Table', array( 'screen' => 'edit-' . $taxonomy ) );
1588
+
1589
+ if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
1590
+ wp_die( -1 );
1591
+
1592
+ $tag = get_term( $id, $taxonomy );
1593
+ $_POST['description'] = $tag->description;
1594
+
1595
+ $updated = wp_update_term($id, $taxonomy, $_POST);
1596
+ if ( $updated && !is_wp_error($updated) ) {
1597
+ $tag = get_term( $updated['term_id'], $taxonomy );
1598
+ if ( !$tag || is_wp_error( $tag ) ) {
1599
+ if ( is_wp_error($tag) && $tag->get_error_message() )
1600
+ wp_die( $tag->get_error_message() );
1601
+ wp_die( __( 'Item not updated.' ) );
1602
+ }
1603
+ } else {
1604
+ if ( is_wp_error($updated) && $updated->get_error_message() )
1605
+ wp_die( $updated->get_error_message() );
1606
+ wp_die( __( 'Item not updated.' ) );
1607
+ }
1608
+ $level = 0;
1609
+ $parent = $tag->parent;
1610
+ while ( $parent > 0 ) {
1611
+ $parent_tag = get_term( $parent, $taxonomy );
1612
+ $parent = $parent_tag->parent;
1613
+ $level++;
1614
+ }
1615
+ $wp_list_table->single_row( $tag, $level );
1616
+ wp_die();
1617
+ }
1618
+
1619
+ /**
1620
+ * Ajax handler for finding posts.
1621
+ *
1622
+ * @since 3.1.0
1623
+ */
1624
+ function wp_ajax_find_posts() {
1625
+ check_ajax_referer( 'find-posts' );
1626
+
1627
+ $post_types = get_post_types( array( 'public' => true ), 'objects' );
1628
+ unset( $post_types['attachment'] );
1629
+
1630
+ $s = wp_unslash( $_POST['ps'] );
1631
+ $args = array(
1632
+ 'post_type' => array_keys( $post_types ),
1633
+ 'post_status' => 'any',
1634
+ 'posts_per_page' => 50,
1635
+ );
1636
+ if ( '' !== $s )
1637
+ $args['s'] = $s;
1638
+
1639
+ $posts = get_posts( $args );
1640
+
1641
+ if ( ! $posts ) {
1642
+ wp_send_json_error( __( 'No items found.' ) );
1643
+ }
1644
+
1645
+ $html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th class="no-break">'.__('Type').'</th><th class="no-break">'.__('Date').'</th><th class="no-break">'.__('Status').'</th></tr></thead><tbody>';
1646
+ $alt = '';
1647
+ foreach ( $posts as $post ) {
1648
+ $title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );
1649
+ $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
1650
+
1651
+ switch ( $post->post_status ) {
1652
+ case 'publish' :
1653
+ case 'private' :
1654
+ $stat = __('Published');
1655
+ break;
1656
+ case 'future' :
1657
+ $stat = __('Scheduled');
1658
+ break;
1659
+ case 'pending' :
1660
+ $stat = __('Pending Review');
1661
+ break;
1662
+ case 'draft' :
1663
+ $stat = __('Draft');
1664
+ break;
1665
+ }
1666
+
1667
+ if ( '0000-00-00 00:00:00' == $post->post_date ) {
1668
+ $time = '';
1669
+ } else {
1670
+ /* translators: date format in table columns, see http://php.net/date */
1671
+ $time = mysql2date(__('Y/m/d'), $post->post_date);
1672
+ }
1673
+
1674
+ $html .= '<tr class="' . trim( 'found-posts ' . $alt ) . '"><td class="found-radio"><input type="radio" id="found-'.$post->ID.'" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
1675
+ $html .= '<td><label for="found-'.$post->ID.'">' . esc_html( $title ) . '</label></td><td class="no-break">' . esc_html( $post_types[$post->post_type]->labels->singular_name ) . '</td><td class="no-break">'.esc_html( $time ) . '</td><td class="no-break">' . esc_html( $stat ). ' </td></tr>' . "\n\n";
1676
+ }
1677
+
1678
+ $html .= '</tbody></table>';
1679
+
1680
+ wp_send_json_success( $html );
1681
+ }
1682
+
1683
+ /**
1684
+ * Ajax handler for saving the widgets order.
1685
+ *
1686
+ * @since 3.1.0
1687
+ */
1688
+ function wp_ajax_widgets_order() {
1689
+ check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
1690
+
1691
+ if ( !current_user_can('edit_theme_options') )
1692
+ wp_die( -1 );
1693
+
1694
+ unset( $_POST['savewidgets'], $_POST['action'] );
1695
+
1696
+ // Save widgets order for all sidebars.
1697
+ if ( is_array($_POST['sidebars']) ) {
1698
+ $sidebars = array();
1699
+ foreach ( $_POST['sidebars'] as $key => $val ) {
1700
+ $sb = array();
1701
+ if ( !empty($val) ) {
1702
+ $val = explode(',', $val);
1703
+ foreach ( $val as $k => $v ) {
1704
+ if ( strpos($v, 'widget-') === false )
1705
+ continue;
1706
+
1707
+ $sb[$k] = substr($v, strpos($v, '_') + 1);
1708
+ }
1709
+ }
1710
+ $sidebars[$key] = $sb;
1711
+ }
1712
+ wp_set_sidebars_widgets($sidebars);
1713
+ wp_die( 1 );
1714
+ }
1715
+
1716
+ wp_die( -1 );
1717
+ }
1718
+
1719
+ /**
1720
+ * Ajax handler for saving a widget.
1721
+ *
1722
+ * @since 3.1.0
1723
+ */
1724
+ function wp_ajax_save_widget() {
1725
+ global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates;
1726
+
1727
+ check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
1728
+
1729
+ if ( !current_user_can('edit_theme_options') || !isset($_POST['id_base']) )
1730
+ wp_die( -1 );
1731
+
1732
+ unset( $_POST['savewidgets'], $_POST['action'] );
1733
+
1734
+ /**
1735
+ * Fires early when editing the widgets displayed in sidebars.
1736
+ *
1737
+ * @since 2.8.0
1738
+ */
1739
+ do_action( 'load-widgets.php' );
1740
+
1741
+ /**
1742
+ * Fires early when editing the widgets displayed in sidebars.
1743
+ *
1744
+ * @since 2.8.0
1745
+ */
1746
+ do_action( 'widgets.php' );
1747
+
1748
+ /** This action is documented in wp-admin/widgets.php */
1749
+ do_action( 'sidebar_admin_setup' );
1750
+
1751
+ $id_base = $_POST['id_base'];
1752
+ $widget_id = $_POST['widget-id'];
1753
+ $sidebar_id = $_POST['sidebar'];
1754
+ $multi_number = !empty($_POST['multi_number']) ? (int) $_POST['multi_number'] : 0;
1755
+ $settings = isset($_POST['widget-' . $id_base]) && is_array($_POST['widget-' . $id_base]) ? $_POST['widget-' . $id_base] : false;
1756
+ $error = '<p>' . __('An error has occurred. Please reload the page and try again.') . '</p>';
1757
+
1758
+ $sidebars = wp_get_sidebars_widgets();
1759
+ $sidebar = isset($sidebars[$sidebar_id]) ? $sidebars[$sidebar_id] : array();
1760
+
1761
+ // Delete.
1762
+ if ( isset($_POST['delete_widget']) && $_POST['delete_widget'] ) {
1763
+
1764
+ if ( !isset($wp_registered_widgets[$widget_id]) )
1765
+ wp_die( $error );
1766
+
1767
+ $sidebar = array_diff( $sidebar, array($widget_id) );
1768
+ $_POST = array('sidebar' => $sidebar_id, 'widget-' . $id_base => array(), 'the-widget-id' => $widget_id, 'delete_widget' => '1');
1769
+ } elseif ( $settings && preg_match( '/__i__|%i%/', key($settings) ) ) {
1770
+ if ( !$multi_number )
1771
+ wp_die( $error );
1772
+
1773
+ $_POST['widget-' . $id_base] = array( $multi_number => array_shift($settings) );
1774
+ $widget_id = $id_base . '-' . $multi_number;
1775
+ $sidebar[] = $widget_id;
1776
+ }
1777
+ $_POST['widget-id'] = $sidebar;
1778
+
1779
+ foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
1780
+
1781
+ if ( $name == $id_base ) {
1782
+ if ( !is_callable( $control['callback'] ) )
1783
+ continue;
1784
+
1785
+ ob_start();
1786
+ call_user_func_array( $control['callback'], $control['params'] );
1787
+ ob_end_clean();
1788
+ break;
1789
+ }
1790
+ }
1791
+
1792
+ if ( isset($_POST['delete_widget']) && $_POST['delete_widget'] ) {
1793
+ $sidebars[$sidebar_id] = $sidebar;
1794
+ wp_set_sidebars_widgets($sidebars);
1795
+ echo "deleted:$widget_id";
1796
+ wp_die();
1797
+ }
1798
+
1799
+ if ( !empty($_POST['add_new']) )
1800
+ wp_die();
1801
+
1802
+ if ( $form = $wp_registered_widget_controls[$widget_id] )
1803
+ call_user_func_array( $form['callback'], $form['params'] );
1804
+
1805
+ wp_die();
1806
+ }
1807
+
1808
+ /**
1809
+ * Ajax handler for saving a widget.
1810
+ *
1811
+ * @since 3.9.0
1812
+ */
1813
+ function wp_ajax_update_widget() {
1814
+ global $wp_customize;
1815
+ $wp_customize->widgets->wp_ajax_update_widget();
1816
+ }
1817
+
1818
+ /**
1819
+ * Ajax handler for uploading attachments
1820
+ *
1821
+ * @since 3.3.0
1822
+ */
1823
+ function wp_ajax_upload_attachment() {
1824
+ check_ajax_referer( 'media-form' );
1825
+
1826
+ if ( ! current_user_can( 'upload_files' ) )
1827
+ wp_die();
1828
+
1829
+ if ( isset( $_REQUEST['post_id'] ) ) {
1830
+ $post_id = $_REQUEST['post_id'];
1831
+ if ( ! current_user_can( 'edit_post', $post_id ) )
1832
+ wp_die();
1833
+ } else {
1834
+ $post_id = null;
1835
+ }
1836
+
1837
+ $post_data = isset( $_REQUEST['post_data'] ) ? $_REQUEST['post_data'] : array();
1838
+
1839
+ // If the context is custom header or background, make sure the uploaded file is an image.
1840
+ if ( isset( $post_data['context'] ) && in_array( $post_data['context'], array( 'custom-header', 'custom-background' ) ) ) {
1841
+ $wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'], false );
1842
+ if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
1843
+ echo json_encode( array(
1844
+ 'success' => false,
1845
+ 'data' => array(
1846
+ 'message' => __( 'The uploaded file is not a valid image. Please try again.' ),
1847
+ 'filename' => $_FILES['async-upload']['name'],
1848
+ )
1849
+ ) );
1850
+
1851
+ wp_die();
1852
+ }
1853
+ }
1854
+
1855
+ $attachment_id = media_handle_upload( 'async-upload', $post_id, $post_data );
1856
+
1857
+ if ( is_wp_error( $attachment_id ) ) {
1858
+ echo json_encode( array(
1859
+ 'success' => false,
1860
+ 'data' => array(
1861
+ 'message' => $attachment_id->get_error_message(),
1862
+ 'filename' => $_FILES['async-upload']['name'],
1863
+ )
1864
+ ) );
1865
+
1866
+ wp_die();
1867
+ }
1868
+
1869
+ if ( isset( $post_data['context'] ) && isset( $post_data['theme'] ) ) {
1870
+ if ( 'custom-background' === $post_data['context'] )
1871
+ update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', $post_data['theme'] );
1872
+
1873
+ if ( 'custom-header' === $post_data['context'] )
1874
+ update_post_meta( $attachment_id, '_wp_attachment_is_custom_header', $post_data['theme'] );
1875
+ }
1876
+
1877
+ if ( ! $attachment = wp_prepare_attachment_for_js( $attachment_id ) )
1878
+ wp_die();
1879
+
1880
+ echo json_encode( array(
1881
+ 'success' => true,
1882
+ 'data' => $attachment,
1883
+ ) );
1884
+
1885
+ wp_die();
1886
+ }
1887
+
1888
+ /**
1889
+ * Ajax handler for image editing.
1890
+ *
1891
+ * @since 3.1.0
1892
+ */
1893
+ function wp_ajax_image_editor() {
1894
+ $attachment_id = intval($_POST['postid']);
1895
+ if ( empty($attachment_id) || !current_user_can('edit_post', $attachment_id) )
1896
+ wp_die( -1 );
1897
+
1898
+ check_ajax_referer( "image_editor-$attachment_id" );
1899
+ include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
1900
+
1901
+ $msg = false;
1902
+ switch ( $_POST['do'] ) {
1903
+ case 'save' :
1904
+ $msg = wp_save_image($attachment_id);
1905
+ $msg = json_encode($msg);
1906
+ wp_die( $msg );
1907
+ break;
1908
+ case 'scale' :
1909
+ $msg = wp_save_image($attachment_id);
1910
+ break;
1911
+ case 'restore' :
1912
+ $msg = wp_restore_image($attachment_id);
1913
+ break;
1914
+ }
1915
+
1916
+ wp_image_editor($attachment_id, $msg);
1917
+ wp_die();
1918
+ }
1919
+
1920
+ /**
1921
+ * Ajax handler for setting the featured image.
1922
+ *
1923
+ * @since 3.1.0
1924
+ */
1925
+ function wp_ajax_set_post_thumbnail() {
1926
+ $json = ! empty( $_REQUEST['json'] ); // New-style request
1927
+
1928
+ $post_ID = intval( $_POST['post_id'] );
1929
+ if ( ! current_user_can( 'edit_post', $post_ID ) )
1930
+ wp_die( -1 );
1931
+
1932
+ $thumbnail_id = intval( $_POST['thumbnail_id'] );
1933
+
1934
+ if ( $json )
1935
+ check_ajax_referer( "update-post_$post_ID" );
1936
+ else
1937
+ check_ajax_referer( "set_post_thumbnail-$post_ID" );
1938
+
1939
+ if ( $thumbnail_id == '-1' ) {
1940
+ if ( delete_post_thumbnail( $post_ID ) ) {
1941
+ $return = _wp_post_thumbnail_html( null, $post_ID );
1942
+ $json ? wp_send_json_success( $return ) : wp_die( $return );
1943
+ } else {
1944
+ wp_die( 0 );
1945
+ }
1946
+ }
1947
+
1948
+ if ( set_post_thumbnail( $post_ID, $thumbnail_id ) ) {
1949
+ $return = _wp_post_thumbnail_html( $thumbnail_id, $post_ID );
1950
+ $json ? wp_send_json_success( $return ) : wp_die( $return );
1951
+ }
1952
+
1953
+ wp_die( 0 );
1954
+ }
1955
+
1956
+ /**
1957
+ * AJAX handler for setting the featured image for an attachment.
1958
+ *
1959
+ * @since 4.0.0
1960
+ *
1961
+ * @see set_post_thumbnail()
1962
+ */
1963
+ function wp_ajax_set_attachment_thumbnail() {
1964
+ if ( empty( $_POST['urls'] ) || ! is_array( $_POST['urls'] ) ) {
1965
+ wp_send_json_error();
1966
+ }
1967
+
1968
+ $thumbnail_id = (int) $_POST['thumbnail_id'];
1969
+ if ( empty( $thumbnail_id ) ) {
1970
+ wp_send_json_error();
1971
+ }
1972
+
1973
+ $post_ids = array();
1974
+ // For each URL, try to find its corresponding post ID.
1975
+ foreach ( $_POST['urls'] as $url ) {
1976
+ $post_id = attachment_url_to_postid( $url );
1977
+ if ( ! empty( $post_id ) ) {
1978
+ $post_ids[] = $post_id;
1979
+ }
1980
+ }
1981
+
1982
+ if ( empty( $post_ids ) ) {
1983
+ wp_send_json_error();
1984
+ }
1985
+
1986
+ $success = 0;
1987
+ // For each found attachment, set its thumbnail.
1988
+ foreach ( $post_ids as $post_id ) {
1989
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
1990
+ continue;
1991
+ }
1992
+
1993
+ if ( set_post_thumbnail( $post_id, $thumbnail_id ) ) {
1994
+ $success++;
1995
+ }
1996
+ }
1997
+
1998
+ if ( 0 === $success ) {
1999
+ wp_send_json_error();
2000
+ } else {
2001
+ wp_send_json_success();
2002
+ }
2003
+
2004
+ wp_send_json_error();
2005
+ }
2006
+
2007
+ /**
2008
+ * Ajax handler for date formatting.
2009
+ *
2010
+ * @since 3.1.0
2011
+ */
2012
+ function wp_ajax_date_format() {
2013
+ wp_die( date_i18n( sanitize_option( 'date_format', wp_unslash( $_POST['date'] ) ) ) );
2014
+ }
2015
+
2016
+ /**
2017
+ * Ajax handler for time formatting.
2018
+ *
2019
+ * @since 3.1.0
2020
+ */
2021
+ function wp_ajax_time_format() {
2022
+ wp_die( date_i18n( sanitize_option( 'time_format', wp_unslash( $_POST['date'] ) ) ) );
2023
+ }
2024
+
2025
+ /**
2026
+ * Ajax handler for saving posts from the fullscreen editor.
2027
+ *
2028
+ * @since 3.1.0
2029
+ */
2030
+ function wp_ajax_wp_fullscreen_save_post() {
2031
+ $post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
2032
+
2033
+ $post = null;
2034
+
2035
+ if ( $post_id )
2036
+ $post = get_post( $post_id );
2037
+
2038
+ check_ajax_referer('update-post_' . $post_id, '_wpnonce');
2039
+
2040
+ $post_id = edit_post();
2041
+
2042
+ if ( is_wp_error( $post_id ) ) {
2043
+ wp_send_json_error();
2044
+ }
2045
+
2046
+ if ( $post ) {
2047
+ $last_date = mysql2date( get_option('date_format'), $post->post_modified );
2048
+ $last_time = mysql2date( get_option('time_format'), $post->post_modified );
2049
+ } else {
2050
+ $last_date = date_i18n( get_option('date_format') );
2051
+ $last_time = date_i18n( get_option('time_format') );
2052
+ }
2053
+
2054
+ if ( $last_id = get_post_meta( $post_id, '_edit_last', true ) ) {
2055
+ $last_user = get_userdata( $last_id );
2056
+ $last_edited = sprintf( __('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), $last_date, $last_time );
2057
+ } else {
2058
+ $last_edited = sprintf( __('Last edited on %1$s at %2$s'), $last_date, $last_time );
2059
+ }
2060
+
2061
+ wp_send_json_success( array( 'last_edited' => $last_edited ) );
2062
+ }
2063
+
2064
+ /**
2065
+ * Ajax handler for removing a post lock.
2066
+ *
2067
+ * @since 3.1.0
2068
+ */
2069
+ function wp_ajax_wp_remove_post_lock() {
2070
+ if ( empty( $_POST['post_ID'] ) || empty( $_POST['active_post_lock'] ) )
2071
+ wp_die( 0 );
2072
+ $post_id = (int) $_POST['post_ID'];
2073
+ if ( ! $post = get_post( $post_id ) )
2074
+ wp_die( 0 );
2075
+
2076
+ check_ajax_referer( 'update-post_' . $post_id );
2077
+
2078
+ if ( ! current_user_can( 'edit_post', $post_id ) )
2079
+ wp_die( -1 );
2080
+
2081
+ $active_lock = array_map( 'absint', explode( ':', $_POST['active_post_lock'] ) );
2082
+ if ( $active_lock[1] != get_current_user_id() )
2083
+ wp_die( 0 );
2084
+
2085
+ /**
2086
+ * Filter the post lock window duration.
2087
+ *
2088
+ * @since 3.3.0
2089
+ *
2090
+ * @param int $interval The interval in seconds the post lock duration
2091
+ * should last, plus 5 seconds. Default 150.
2092
+ */
2093
+ $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 150 ) + 5 ) . ':' . $active_lock[1];
2094
+ update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
2095
+ wp_die( 1 );
2096
+ }
2097
+
2098
+ /**
2099
+ * Ajax handler for dismissing a WordPress pointer.
2100
+ *
2101
+ * @since 3.1.0
2102
+ */
2103
+ function wp_ajax_dismiss_wp_pointer() {
2104
+ $pointer = $_POST['pointer'];
2105
+ if ( $pointer != sanitize_key( $pointer ) )
2106
+ wp_die( 0 );
2107
+
2108
+ // check_ajax_referer( 'dismiss-pointer_' . $pointer );
2109
+
2110
+ $dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) );
2111
+
2112
+ if ( in_array( $pointer, $dismissed ) )
2113
+ wp_die( 0 );
2114
+
2115
+ $dismissed[] = $pointer;
2116
+ $dismissed = implode( ',', $dismissed );
2117
+
2118
+ update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed );
2119
+ wp_die( 1 );
2120
+ }
2121
+
2122
+ /**
2123
+ * Ajax handler for getting an attachment.
2124
+ *
2125
+ * @since 3.5.0
2126
+ */
2127
+ function wp_ajax_get_attachment() {
2128
+ if ( ! isset( $_REQUEST['id'] ) )
2129
+ wp_send_json_error();
2130
+
2131
+ if ( ! $id = absint( $_REQUEST['id'] ) )
2132
+ wp_send_json_error();
2133
+
2134
+ if ( ! $post = get_post( $id ) )
2135
+ wp_send_json_error();
2136
+
2137
+ if ( 'attachment' != $post->post_type )
2138
+ wp_send_json_error();
2139
+
2140
+ if ( ! current_user_can( 'upload_files' ) )
2141
+ wp_send_json_error();
2142
+
2143
+ if ( ! $attachment = wp_prepare_attachment_for_js( $id ) )
2144
+ wp_send_json_error();
2145
+
2146
+ wp_send_json_success( $attachment );
2147
+ }
2148
+
2149
+ /**
2150
+ * Ajax handler for querying for attachments.
2151
+ *
2152
+ * @since 3.5.0
2153
+ */
2154
+ function wp_ajax_query_attachments() {
2155
+ if ( ! current_user_can( 'upload_files' ) )
2156
+ wp_send_json_error();
2157
+
2158
+ $query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
2159
+ $query = array_intersect_key( $query, array_flip( array(
2160
+ 's', 'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type',
2161
+ 'post_parent', 'post__in', 'post__not_in', 'year', 'monthnum'
2162
+ ) ) );
2163
+
2164
+ $query['post_type'] = 'attachment';
2165
+ if ( MEDIA_TRASH
2166
+ && ! empty( $_REQUEST['query']['post_status'] )
2167
+ && 'trash' === $_REQUEST['query']['post_status'] ) {
2168
+ $query['post_status'] = 'trash';
2169
+ } else {
2170
+ $query['post_status'] = 'inherit';
2171
+ }
2172
+
2173
+ if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) )
2174
+ $query['post_status'] .= ',private';
2175
+
2176
+ /**
2177
+ * Filter the arguments passed to WP_Query during an AJAX
2178
+ * call for querying attachments.
2179
+ *
2180
+ * @since 3.7.0
2181
+ *
2182
+ * @see WP_Query::parse_query()
2183
+ *
2184
+ * @param array $query An array of query variables.
2185
+ */
2186
+ $query = apply_filters( 'ajax_query_attachments_args', $query );
2187
+ $query = new WP_Query( $query );
2188
+
2189
+ $posts = array_map( 'wp_prepare_attachment_for_js', $query->posts );
2190
+ $posts = array_filter( $posts );
2191
+
2192
+ wp_send_json_success( $posts );
2193
+ }
2194
+
2195
+ /**
2196
+ * Ajax handler for saving attachment attributes.
2197
+ *
2198
+ * @since 3.5.0
2199
+ */
2200
+ function wp_ajax_save_attachment() {
2201
+ if ( ! isset( $_REQUEST['id'] ) || ! isset( $_REQUEST['changes'] ) )
2202
+ wp_send_json_error();
2203
+
2204
+ if ( ! $id = absint( $_REQUEST['id'] ) )
2205
+ wp_send_json_error();
2206
+
2207
+ check_ajax_referer( 'update-post_' . $id, 'nonce' );
2208
+
2209
+ if ( ! current_user_can( 'edit_post', $id ) )
2210
+ wp_send_json_error();
2211
+
2212
+ $changes = $_REQUEST['changes'];
2213
+ $post = get_post( $id, ARRAY_A );
2214
+
2215
+ if ( 'attachment' != $post['post_type'] )
2216
+ wp_send_json_error();
2217
+
2218
+ if ( isset( $changes['title'] ) )
2219
+ $post['post_title'] = $changes['title'];
2220
+
2221
+ if ( isset( $changes['caption'] ) )
2222
+ $post['post_excerpt'] = $changes['caption'];
2223
+
2224
+ if ( isset( $changes['description'] ) )
2225
+ $post['post_content'] = $changes['description'];
2226
+
2227
+ if ( MEDIA_TRASH && isset( $changes['status'] ) )
2228
+ $post['post_status'] = $changes['status'];
2229
+
2230
+ if ( isset( $changes['alt'] ) ) {
2231
+ $alt = wp_unslash( $changes['alt'] );
2232
+ if ( $alt != get_post_meta( $id, '_wp_attachment_image_alt', true ) ) {
2233
+ $alt = wp_strip_all_tags( $alt, true );
2234
+ update_post_meta( $id, '_wp_attachment_image_alt', wp_slash( $alt ) );
2235
+ }
2236
+ }
2237
+
2238
+ if ( 0 === strpos( $post['post_mime_type'], 'audio/' ) ) {
2239
+ $changed = false;
2240
+ $id3data = wp_get_attachment_metadata( $post['ID'] );
2241
+ if ( ! is_array( $id3data ) ) {
2242
+ $changed = true;
2243
+ $id3data = array();
2244
+ }
2245
+ foreach ( wp_get_attachment_id3_keys( (object) $post, 'edit' ) as $key => $label ) {
2246
+ if ( isset( $changes[ $key ] ) ) {
2247
+ $changed = true;
2248
+ $id3data[ $key ] = sanitize_text_field( wp_unslash( $changes[ $key ] ) );
2249
+ }
2250
+ }
2251
+
2252
+ if ( $changed ) {
2253
+ wp_update_attachment_metadata( $id, $id3data );
2254
+ }
2255
+ }
2256
+
2257
+ if ( MEDIA_TRASH && isset( $changes['status'] ) && 'trash' === $changes['status'] ) {
2258
+ wp_delete_post( $id );
2259
+ } else {
2260
+ wp_update_post( $post );
2261
+ }
2262
+
2263
+ wp_send_json_success();
2264
+ }
2265
+
2266
+ /**
2267
+ * Ajax handler for saving backwards compatible attachment attributes.
2268
+ *
2269
+ * @since 3.5.0
2270
+ */
2271
+ function wp_ajax_save_attachment_compat() {
2272
+ if ( ! isset( $_REQUEST['id'] ) )
2273
+ wp_send_json_error();
2274
+
2275
+ if ( ! $id = absint( $_REQUEST['id'] ) )
2276
+ wp_send_json_error();
2277
+
2278
+ if ( empty( $_REQUEST['attachments'] ) || empty( $_REQUEST['attachments'][ $id ] ) )
2279
+ wp_send_json_error();
2280
+ $attachment_data = $_REQUEST['attachments'][ $id ];
2281
+
2282
+ check_ajax_referer( 'update-post_' . $id, 'nonce' );
2283
+
2284
+ if ( ! current_user_can( 'edit_post', $id ) )
2285
+ wp_send_json_error();
2286
+
2287
+ $post = get_post( $id, ARRAY_A );
2288
+
2289
+ if ( 'attachment' != $post['post_type'] )
2290
+ wp_send_json_error();
2291
+
2292
+ /** This filter is documented in wp-admin/includes/media.php */
2293
+ $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
2294
+
2295
+ if ( isset( $post['errors'] ) ) {
2296
+ $errors = $post['errors']; // @todo return me and display me!
2297
+ unset( $post['errors'] );
2298
+ }
2299
+
2300
+ wp_update_post( $post );
2301
+
2302
+ foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
2303
+ if ( isset( $attachment_data[ $taxonomy ] ) )
2304
+ wp_set_object_terms( $id, array_map( 'trim', preg_split( '/,+/', $attachment_data[ $taxonomy ] ) ), $taxonomy, false );
2305
+ }
2306
+
2307
+ if ( ! $attachment = wp_prepare_attachment_for_js( $id ) )
2308
+ wp_send_json_error();
2309
+
2310
+ wp_send_json_success( $attachment );
2311
+ }
2312
+
2313
+ /**
2314
+ * Ajax handler for saving the attachment order.
2315
+ *
2316
+ * @since 3.5.0
2317
+ */
2318
+ function wp_ajax_save_attachment_order() {
2319
+ if ( ! isset( $_REQUEST['post_id'] ) )
2320
+ wp_send_json_error();
2321
+
2322
+ if ( ! $post_id = absint( $_REQUEST['post_id'] ) )
2323
+ wp_send_json_error();
2324
+
2325
+ if ( empty( $_REQUEST['attachments'] ) )
2326
+ wp_send_json_error();
2327
+
2328
+ check_ajax_referer( 'update-post_' . $post_id, 'nonce' );
2329
+
2330
+ $attachments = $_REQUEST['attachments'];
2331
+
2332
+ if ( ! current_user_can( 'edit_post', $post_id ) )
2333
+ wp_send_json_error();
2334
+
2335
+ foreach ( $attachments as $attachment_id => $menu_order ) {
2336
+ if ( ! current_user_can( 'edit_post', $attachment_id ) )
2337
+ continue;
2338
+ if ( ! $attachment = get_post( $attachment_id ) )
2339
+ continue;
2340
+ if ( 'attachment' != $attachment->post_type )
2341
+ continue;
2342
+
2343
+ wp_update_post( array( 'ID' => $attachment_id, 'menu_order' => $menu_order ) );
2344
+ }
2345
+
2346
+ wp_send_json_success();
2347
+ }
2348
+
2349
+ /**
2350
+ * Ajax handler for sending an attachment to the editor.
2351
+ *
2352
+ * Generates the HTML to send an attachment to the editor.
2353
+ * Backwards compatible with the media_send_to_editor filter
2354
+ * and the chain of filters that follow.
2355
+ *
2356
+ * @since 3.5.0
2357
+ */
2358
+ function wp_ajax_send_attachment_to_editor() {
2359
+ check_ajax_referer( 'media-send-to-editor', 'nonce' );
2360
+
2361
+ $attachment = wp_unslash( $_POST['attachment'] );
2362
+
2363
+ $id = intval( $attachment['id'] );
2364
+
2365
+ if ( ! $post = get_post( $id ) )
2366
+ wp_send_json_error();
2367
+
2368
+ if ( 'attachment' != $post->post_type )
2369
+ wp_send_json_error();
2370
+
2371
+ if ( current_user_can( 'edit_post', $id ) ) {
2372
+ // If this attachment is unattached, attach it. Primarily a back compat thing.
2373
+ if ( 0 == $post->post_parent && $insert_into_post_id = intval( $_POST['post_id'] ) ) {
2374
+ wp_update_post( array( 'ID' => $id, 'post_parent' => $insert_into_post_id ) );
2375
+ }
2376
+ }
2377
+
2378
+ $rel = $url = '';
2379
+ $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
2380
+ if ( ! empty( $attachment['url'] ) ) {
2381
+ $url = $attachment['url'];
2382
+ if ( strpos( $url, 'attachment_id') || get_attachment_link( $id ) == $url )
2383
+ $rel = ' rel="attachment wp-att-' . $id . '"';
2384
+ $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
2385
+ }
2386
+
2387
+ remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' );
2388
+
2389
+ if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {
2390
+ $align = isset( $attachment['align'] ) ? $attachment['align'] : 'none';
2391
+ $size = isset( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';
2392
+ $alt = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';
2393
+ $caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';
2394
+ $title = ''; // We no longer insert title tags into <img> tags, as they are redundant.
2395
+ $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, (bool) $rel, $size, $alt );
2396
+ } elseif ( 'video' === substr( $post->post_mime_type, 0, 5 ) || 'audio' === substr( $post->post_mime_type, 0, 5 ) ) {
2397
+ $html = stripslashes_deep( $_POST['html'] );
2398
+ }
2399
+
2400
+ /** This filter is documented in wp-admin/includes/media.php */
2401
+ $html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );
2402
+
2403
+ wp_send_json_success( $html );
2404
+ }
2405
+
2406
+ /**
2407
+ * Ajax handler for sending a link to the editor.
2408
+ *
2409
+ * Generates the HTML to send a non-image embed link to the editor.
2410
+ *
2411
+ * Backwards compatible with the following filters:
2412
+ * - file_send_to_editor_url
2413
+ * - audio_send_to_editor_url
2414
+ * - video_send_to_editor_url
2415
+ *
2416
+ * @since 3.5.0
2417
+ */
2418
+ function wp_ajax_send_link_to_editor() {
2419
+ global $post, $wp_embed;
2420
+
2421
+ check_ajax_referer( 'media-send-to-editor', 'nonce' );
2422
+
2423
+ if ( ! $src = wp_unslash( $_POST['src'] ) )
2424
+ wp_send_json_error();
2425
+
2426
+ if ( ! strpos( $src, '://' ) )
2427
+ $src = 'http://' . $src;
2428
+
2429
+ if ( ! $src = esc_url_raw( $src ) )
2430
+ wp_send_json_error();
2431
+
2432
+ if ( ! $title = trim( wp_unslash( $_POST['title'] ) ) )
2433
+ $title = wp_basename( $src );
2434
+
2435
+ $post = get_post( isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0 );
2436
+
2437
+ // Ping WordPress for an embed.
2438
+ $check_embed = $wp_embed->run_shortcode( '[embed]'. $src .'[/embed]' );
2439
+
2440
+ // Fallback that WordPress creates when no oEmbed was found.
2441
+ $fallback = $wp_embed->maybe_make_link( $src );
2442
+
2443
+ if ( $check_embed !== $fallback ) {
2444
+ // TinyMCE view for [embed] will parse this
2445
+ $html = '[embed]' . $src . '[/embed]';
2446
+ } elseif ( $title ) {
2447
+ $html = '<a href="' . esc_url( $src ) . '">' . $title . '</a>';
2448
+ } else {
2449
+ $html = '';
2450
+ }
2451
+
2452
+ // Figure out what filter to run:
2453
+ $type = 'file';
2454
+ if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) )
2455
+ && ( 'audio' == $ext_type || 'video' == $ext_type ) )
2456
+ $type = $ext_type;
2457
+
2458
+ /** This filter is documented in wp-admin/includes/media.php */
2459
+ $html = apply_filters( $type . '_send_to_editor_url', $html, $src, $title );
2460
+
2461
+ wp_send_json_success( $html );
2462
+ }
2463
+
2464
+ /**
2465
+ * Ajax handler for the Heartbeat API.
2466
+ *
2467
+ * Runs when the user is logged in.
2468
+ *
2469
+ * @since 3.6.0
2470
+ */
2471
+ function wp_ajax_heartbeat() {
2472
+ if ( empty( $_POST['_nonce'] ) )
2473
+ wp_send_json_error();
2474
+
2475
+ $response = array();
2476
+
2477
+ if ( false === wp_verify_nonce( $_POST['_nonce'], 'heartbeat-nonce' ) ) {
2478
+ // User is logged in but nonces have expired.
2479
+ $response['nonces_expired'] = true;
2480
+ wp_send_json($response);
2481
+ }
2482
+
2483
+ // screen_id is the same as $current_screen->id and the JS global 'pagenow'.
2484
+ if ( ! empty($_POST['screen_id']) )
2485
+ $screen_id = sanitize_key($_POST['screen_id']);
2486
+ else
2487
+ $screen_id = 'front';
2488
+
2489
+ if ( ! empty($_POST['data']) ) {
2490
+ $data = wp_unslash( (array) $_POST['data'] );
2491
+
2492
+ /**
2493
+ * Filter the Heartbeat response received.
2494
+ *
2495
+ * @since 3.6.0
2496
+ *
2497
+ * @param array|object $response The Heartbeat response object or array.
2498
+ * @param array $data The $_POST data sent.
2499
+ * @param string $screen_id The screen id.
2500
+ */
2501
+ $response = apply_filters( 'heartbeat_received', $response, $data, $screen_id );
2502
+ }
2503
+
2504
+ /**
2505
+ * Filter the Heartbeat response sent.
2506
+ *
2507
+ * @since 3.6.0
2508
+ *
2509
+ * @param array|object $response The Heartbeat response object or array.
2510
+ * @param string $screen_id The screen id.
2511
+ */
2512
+ $response = apply_filters( 'heartbeat_send', $response, $screen_id );
2513
+
2514
+ /**
2515
+ * Fires when Heartbeat ticks in logged-in environments.
2516
+ *
2517
+ * Allows the transport to be easily replaced with long-polling.
2518
+ *
2519
+ * @since 3.6.0
2520
+ *
2521
+ * @param array|object $response The Heartbeat response object or array.
2522
+ * @param string $screen_id The screen id.
2523
+ */
2524
+ do_action( 'heartbeat_tick', $response, $screen_id );
2525
+
2526
+ // Send the current time according to the server
2527
+ $response['server_time'] = time();
2528
+
2529
+ wp_send_json($response);
2530
+ }
2531
+
2532
+ /**
2533
+ * Ajax handler for getting revision diffs.
2534
+ *
2535
+ * @since 3.6.0
2536
+ */
2537
+ function wp_ajax_get_revision_diffs() {
2538
+ require ABSPATH . 'wp-admin/includes/revision.php';
2539
+
2540
+ if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) )
2541
+ wp_send_json_error();
2542
+
2543
+ if ( ! current_user_can( 'read_post', $post->ID ) )
2544
+ wp_send_json_error();
2545
+
2546
+ // Really just pre-loading the cache here.
2547
+ if ( ! $revisions = wp_get_post_revisions( $post->ID, array( 'check_enabled' => false ) ) )
2548
+ wp_send_json_error();
2549
+
2550
+ $return = array();
2551
+ @set_time_limit( 0 );
2552
+
2553
+ foreach ( $_REQUEST['compare'] as $compare_key ) {
2554
+ list( $compare_from, $compare_to ) = explode( ':', $compare_key ); // from:to
2555
+
2556
+ $return[] = array(
2557
+ 'id' => $compare_key,
2558
+ 'fields' => wp_get_revision_ui_diff( $post, $compare_from, $compare_to ),
2559
+ );
2560
+ }
2561
+ wp_send_json_success( $return );
2562
+ }
2563
+
2564
+ /**
2565
+ * Ajax handler for auto-saving the selected color scheme for
2566
+ * a user's own profile.
2567
+ *
2568
+ * @since 3.8.0
2569
+ */
2570
+ function wp_ajax_save_user_color_scheme() {
2571
+ global $_wp_admin_css_colors;
2572
+
2573
+ check_ajax_referer( 'save-color-scheme', 'nonce' );
2574
+
2575
+ $color_scheme = sanitize_key( $_POST['color_scheme'] );
2576
+
2577
+ if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) {
2578
+ wp_send_json_error();
2579
+ }
2580
+
2581
+ update_user_meta( get_current_user_id(), 'admin_color', $color_scheme );
2582
+ wp_send_json_success();
2583
+ }
2584
+
2585
+ /**
2586
+ * Ajax handler for getting themes from themes_api().
2587
+ *
2588
+ * @since 3.9.0
2589
+ */
2590
+ function wp_ajax_query_themes() {
2591
+ global $themes_allowedtags, $theme_field_defaults;
2592
+
2593
+ if ( ! current_user_can( 'install_themes' ) ) {
2594
+ wp_send_json_error();
2595
+ }
2596
+
2597
+ $args = wp_parse_args( wp_unslash( $_REQUEST['request'] ), array(
2598
+ 'per_page' => 20,
2599
+ 'fields' => $theme_field_defaults
2600
+ ) );
2601
+
2602
+ $old_filter = isset( $args['browse'] ) ? $args['browse'] : 'search';
2603
+
2604
+ /** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */
2605
+ $args = apply_filters( 'install_themes_table_api_args_' . $old_filter, $args );
2606
+
2607
+ $api = themes_api( 'query_themes', $args );
2608
+
2609
+ if ( is_wp_error( $api ) ) {
2610
+ wp_send_json_error();
2611
+ }
2612
+
2613
+ $update_php = network_admin_url( 'update.php?action=install-theme' );
2614
+ foreach ( $api->themes as &$theme ) {
2615
+ $theme->install_url = add_query_arg( array(
2616
+ 'theme' => $theme->slug,
2617
+ '_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug )
2618
+ ), $update_php );
2619
+
2620
+ $theme->name = wp_kses( $theme->name, $themes_allowedtags );
2621
+ $theme->author = wp_kses( $theme->author, $themes_allowedtags );
2622
+ $theme->version = wp_kses( $theme->version, $themes_allowedtags );
2623
+ $theme->description = wp_kses( $theme->description, $themes_allowedtags );
2624
+ $theme->num_ratings = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) );
2625
+ $theme->preview_url = set_url_scheme( $theme->preview_url );
2626
+ }
2627
+
2628
+ wp_send_json_success( $api );
2629
+ }
2630
+
2631
+ /**
2632
+ * Apply [embed] AJAX handlers to a string.
2633
+ *
2634
+ * @since 4.0.0
2635
+ *
2636
+ * @global WP_Post $post Global $post.
2637
+ * @global WP_Embed $wp_embed Embed API instance.
2638
+ */
2639
+ function wp_ajax_parse_embed() {
2640
+ global $post, $wp_embed;
2641
+
2642
+ if ( ! $post = get_post( (int) $_POST['post_ID'] ) ) {
2643
+ wp_send_json_error();
2644
+ }
2645
+
2646
+ if ( empty( $_POST['shortcode'] ) || ! current_user_can( 'edit_post', $post->ID ) ) {
2647
+ wp_send_json_error();
2648
+ }
2649
+
2650
+ $shortcode = wp_unslash( $_POST['shortcode'] );
2651
+ $url = str_replace( '[embed]', '', str_replace( '[/embed]', '', $shortcode ) );
2652
+ $parsed = false;
2653
+ setup_postdata( $post );
2654
+
2655
+ $wp_embed->return_false_on_fail = true;
2656
+
2657
+ if ( is_ssl() && preg_match( '%^\\[embed[^\\]]*\\]http://%i', $shortcode ) ) {
2658
+ // Admin is ssl and the user pasted non-ssl URL.
2659
+ // Check if the provider supports ssl embeds and use that for the preview.
2660
+ $ssl_shortcode = preg_replace( '%^(\\[embed[^\\]]*\\])http://%i', '$1https://', $shortcode );
2661
+ $parsed = $wp_embed->run_shortcode( $ssl_shortcode );
2662
+
2663
+ if ( ! $parsed ) {
2664
+ $no_ssl_support = true;
2665
+ }
2666
+ }
2667
+
2668
+ if ( ! $parsed ) {
2669
+ $parsed = $wp_embed->run_shortcode( $shortcode );
2670
+ }
2671
+
2672
+ if ( ! $parsed ) {
2673
+ wp_send_json_error( array(
2674
+ 'type' => 'not-embeddable',
2675
+ 'message' => sprintf( __( '%s failed to embed.' ), '<code>' . esc_html( $url ) . '</code>' ),
2676
+ ) );
2677
+ }
2678
+
2679
+ if ( has_shortcode( $parsed, 'audio' ) || has_shortcode( $parsed, 'video' ) ) {
2680
+ $styles = '';
2681
+ $mce_styles = wpview_media_sandbox_styles();
2682
+ foreach ( $mce_styles as $style ) {
2683
+ $styles .= sprintf( '<link rel="stylesheet" href="%s"/>', $style );
2684
+ }
2685
+
2686
+ $html = do_shortcode( $parsed );
2687
+
2688
+ global $wp_scripts;
2689
+ if ( ! empty( $wp_scripts ) ) {
2690
+ $wp_scripts->done = array();
2691
+ }
2692
+ ob_start();
2693
+ wp_print_scripts( 'wp-mediaelement' );
2694
+ $scripts = ob_get_clean();
2695
+
2696
+ $parsed = $styles . $html . $scripts;
2697
+ }
2698
+
2699
+
2700
+ if ( ! empty( $no_ssl_support ) || ( is_ssl() && ( preg_match( '%<(iframe|script|embed) [^>]*src="http://%', $parsed ) ||
2701
+ preg_match( '%<link [^>]*href="http://%', $parsed ) ) ) ) {
2702
+ // Admin is ssl and the embed is not. Iframes, scripts, and other "active content" will be blocked.
2703
+ wp_send_json_error( array(
2704
+ 'type' => 'not-ssl',
2705
+ 'message' => sprintf( __( 'Preview not available. %s cannot be embedded securely.' ), '<code>' . esc_html( $url ) . '</code>' ),
2706
+ ) );
2707
+ }
2708
+
2709
+ wp_send_json_success( array(
2710
+ 'body' => $parsed
2711
+ ) );
2712
+ }
2713
+
2714
+ function wp_ajax_parse_media_shortcode() {
2715
+ global $post, $wp_scripts;
2716
+
2717
+ if ( ! $post = get_post( (int) $_POST['post_ID'] ) ) {
2718
+ wp_send_json_error();
2719
+ }
2720
+
2721
+ if ( empty( $_POST['shortcode'] ) || ! current_user_can( 'edit_post', $post->ID ) ) {
2722
+ wp_send_json_error();
2723
+ }
2724
+
2725
+ setup_postdata( $post );
2726
+ $shortcode = do_shortcode( wp_unslash( $_POST['shortcode'] ) );
2727
+
2728
+ if ( empty( $shortcode ) ) {
2729
+ wp_send_json_error( array(
2730
+ 'type' => 'no-items',
2731
+ 'message' => __( 'No items found.' ),
2732
+ ) );
2733
+ }
2734
+
2735
+ $head = '';
2736
+ $styles = wpview_media_sandbox_styles();
2737
+
2738
+ foreach ( $styles as $style ) {
2739
+ $head .= '<link type="text/css" rel="stylesheet" href="' . $style . '">';
2740
+ }
2741
+
2742
+ if ( ! empty( $wp_scripts ) ) {
2743
+ $wp_scripts->done = array();
2744
+ }
2745
+
2746
+ ob_start();
2747
+
2748
+ echo $shortcode;
2749
+
2750
+ if ( 'playlist' === $_REQUEST['type'] ) {
2751
+ wp_underscore_playlist_templates();
2752
+
2753
+ wp_print_scripts( 'wp-playlist' );
2754
+ } else {
2755
+ wp_print_scripts( 'wp-mediaelement' );
2756
+ }
2757
+
2758
+ wp_send_json_success( array(
2759
+ 'head' => $head,
2760
+ 'body' => ob_get_clean()
2761
+ ) );
2762
+ }