stump-cli 0.1.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1243) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/README.md +9 -5
  4. data/bin/stump-cli +77 -27
  5. data/lib/{wp/.gitignore → .gitignore.erb} +2 -2
  6. data/lib/stump-cli/version.rb +1 -1
  7. data/lib/style.erb +11 -0
  8. data/stump-cli.gemspec +2 -0
  9. metadata +56 -1268
  10. data/lib/wp/Movefile-example +0 -62
  11. data/lib/wp/README.md +0 -25
  12. data/lib/wp/index.php +0 -17
  13. data/lib/wp/license.txt +0 -385
  14. data/lib/wp/readme.html +0 -96
  15. data/lib/wp/wp-activate.php +0 -131
  16. data/lib/wp/wp-admin/about.php +0 -193
  17. data/lib/wp/wp-admin/admin-ajax.php +0 -98
  18. data/lib/wp/wp-admin/admin-footer.php +0 -99
  19. data/lib/wp/wp-admin/admin-functions.php +0 -15
  20. data/lib/wp/wp-admin/admin-header.php +0 -243
  21. data/lib/wp/wp-admin/admin-post.php +0 -71
  22. data/lib/wp/wp-admin/admin.php +0 -347
  23. data/lib/wp/wp-admin/async-upload.php +0 -114
  24. data/lib/wp/wp-admin/comment.php +0 -299
  25. data/lib/wp/wp-admin/credits.php +0 -192
  26. data/lib/wp/wp-admin/css/about-rtl.css +0 -446
  27. data/lib/wp/wp-admin/css/about.css +0 -446
  28. data/lib/wp/wp-admin/css/admin-menu-rtl.css +0 -917
  29. data/lib/wp/wp-admin/css/admin-menu.css +0 -917
  30. data/lib/wp/wp-admin/css/color-picker-rtl.css +0 -127
  31. data/lib/wp/wp-admin/css/color-picker-rtl.min.css +0 -1
  32. data/lib/wp/wp-admin/css/color-picker.css +0 -127
  33. data/lib/wp/wp-admin/css/color-picker.min.css +0 -1
  34. data/lib/wp/wp-admin/css/colors/_admin.scss +0 -525
  35. data/lib/wp/wp-admin/css/colors/_mixins.scss +0 -43
  36. data/lib/wp/wp-admin/css/colors/_variables.scss +0 -58
  37. data/lib/wp/wp-admin/css/colors/blue/colors-rtl.css +0 -341
  38. data/lib/wp/wp-admin/css/colors/blue/colors-rtl.min.css +0 -1
  39. data/lib/wp/wp-admin/css/colors/blue/colors.css +0 -341
  40. data/lib/wp/wp-admin/css/colors/blue/colors.min.css +0 -1
  41. data/lib/wp/wp-admin/css/colors/blue/colors.scss +0 -11
  42. data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.css +0 -341
  43. data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.min.css +0 -1
  44. data/lib/wp/wp-admin/css/colors/coffee/colors.css +0 -341
  45. data/lib/wp/wp-admin/css/colors/coffee/colors.min.css +0 -1
  46. data/lib/wp/wp-admin/css/colors/coffee/colors.scss +0 -7
  47. data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.css +0 -341
  48. data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.min.css +0 -1
  49. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.css +0 -341
  50. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.min.css +0 -1
  51. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.scss +0 -8
  52. data/lib/wp/wp-admin/css/colors/light/colors-rtl.css +0 -349
  53. data/lib/wp/wp-admin/css/colors/light/colors-rtl.min.css +0 -1
  54. data/lib/wp/wp-admin/css/colors/light/colors.css +0 -349
  55. data/lib/wp/wp-admin/css/colors/light/colors.min.css +0 -1
  56. data/lib/wp/wp-admin/css/colors/light/colors.scss +0 -38
  57. data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.css +0 -341
  58. data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.min.css +0 -1
  59. data/lib/wp/wp-admin/css/colors/midnight/colors.css +0 -341
  60. data/lib/wp/wp-admin/css/colors/midnight/colors.min.css +0 -1
  61. data/lib/wp/wp-admin/css/colors/midnight/colors.scss +0 -5
  62. data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.css +0 -341
  63. data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.min.css +0 -1
  64. data/lib/wp/wp-admin/css/colors/ocean/colors.css +0 -341
  65. data/lib/wp/wp-admin/css/colors/ocean/colors.min.css +0 -1
  66. data/lib/wp/wp-admin/css/colors/ocean/colors.scss +0 -8
  67. data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.css +0 -341
  68. data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.min.css +0 -1
  69. data/lib/wp/wp-admin/css/colors/sunrise/colors.css +0 -341
  70. data/lib/wp/wp-admin/css/colors/sunrise/colors.min.css +0 -1
  71. data/lib/wp/wp-admin/css/colors/sunrise/colors.scss +0 -6
  72. data/lib/wp/wp-admin/css/common-rtl.css +0 -3212
  73. data/lib/wp/wp-admin/css/common.css +0 -3212
  74. data/lib/wp/wp-admin/css/customize-controls-rtl.css +0 -889
  75. data/lib/wp/wp-admin/css/customize-controls-rtl.min.css +0 -1
  76. data/lib/wp/wp-admin/css/customize-controls.css +0 -889
  77. data/lib/wp/wp-admin/css/customize-controls.min.css +0 -1
  78. data/lib/wp/wp-admin/css/customize-widgets-rtl.css +0 -603
  79. data/lib/wp/wp-admin/css/customize-widgets-rtl.min.css +0 -1
  80. data/lib/wp/wp-admin/css/customize-widgets.css +0 -603
  81. data/lib/wp/wp-admin/css/customize-widgets.min.css +0 -1
  82. data/lib/wp/wp-admin/css/dashboard-rtl.css +0 -1116
  83. data/lib/wp/wp-admin/css/dashboard.css +0 -1116
  84. data/lib/wp/wp-admin/css/deprecated-media-rtl.css +0 -371
  85. data/lib/wp/wp-admin/css/deprecated-media-rtl.min.css +0 -1
  86. data/lib/wp/wp-admin/css/deprecated-media.css +0 -371
  87. data/lib/wp/wp-admin/css/deprecated-media.min.css +0 -1
  88. data/lib/wp/wp-admin/css/edit-rtl.css +0 -1501
  89. data/lib/wp/wp-admin/css/edit.css +0 -1501
  90. data/lib/wp/wp-admin/css/farbtastic-rtl.css +0 -41
  91. data/lib/wp/wp-admin/css/farbtastic.css +0 -41
  92. data/lib/wp/wp-admin/css/forms-rtl.css +0 -992
  93. data/lib/wp/wp-admin/css/forms.css +0 -992
  94. data/lib/wp/wp-admin/css/ie-rtl.css +0 -785
  95. data/lib/wp/wp-admin/css/ie-rtl.min.css +0 -1
  96. data/lib/wp/wp-admin/css/ie.css +0 -785
  97. data/lib/wp/wp-admin/css/ie.min.css +0 -1
  98. data/lib/wp/wp-admin/css/install-rtl.css +0 -389
  99. data/lib/wp/wp-admin/css/install-rtl.min.css +0 -1
  100. data/lib/wp/wp-admin/css/install.css +0 -389
  101. data/lib/wp/wp-admin/css/install.min.css +0 -1
  102. data/lib/wp/wp-admin/css/l10n-rtl.css +0 -101
  103. data/lib/wp/wp-admin/css/l10n.css +0 -101
  104. data/lib/wp/wp-admin/css/list-tables-rtl.css +0 -1875
  105. data/lib/wp/wp-admin/css/list-tables.css +0 -1875
  106. data/lib/wp/wp-admin/css/login-rtl.css +0 -269
  107. data/lib/wp/wp-admin/css/login-rtl.min.css +0 -1
  108. data/lib/wp/wp-admin/css/login.css +0 -269
  109. data/lib/wp/wp-admin/css/login.min.css +0 -1
  110. data/lib/wp/wp-admin/css/media-rtl.css +0 -1196
  111. data/lib/wp/wp-admin/css/media.css +0 -1196
  112. data/lib/wp/wp-admin/css/nav-menus-rtl.css +0 -857
  113. data/lib/wp/wp-admin/css/nav-menus.css +0 -857
  114. data/lib/wp/wp-admin/css/press-this-rtl.css +0 -458
  115. data/lib/wp/wp-admin/css/press-this.css +0 -458
  116. data/lib/wp/wp-admin/css/revisions-rtl.css +0 -574
  117. data/lib/wp/wp-admin/css/revisions.css +0 -574
  118. data/lib/wp/wp-admin/css/themes-rtl.css +0 -1732
  119. data/lib/wp/wp-admin/css/themes.css +0 -1732
  120. data/lib/wp/wp-admin/css/widgets-rtl.css +0 -577
  121. data/lib/wp/wp-admin/css/widgets.css +0 -577
  122. data/lib/wp/wp-admin/css/wp-admin-rtl.css +0 -14
  123. data/lib/wp/wp-admin/css/wp-admin-rtl.min.css +0 -1
  124. data/lib/wp/wp-admin/css/wp-admin.css +0 -14
  125. data/lib/wp/wp-admin/css/wp-admin.min.css +0 -1
  126. data/lib/wp/wp-admin/custom-background.php +0 -482
  127. data/lib/wp/wp-admin/custom-header.php +0 -1366
  128. data/lib/wp/wp-admin/customize.php +0 -278
  129. data/lib/wp/wp-admin/edit-comments.php +0 -254
  130. data/lib/wp/wp-admin/edit-form-advanced.php +0 -636
  131. data/lib/wp/wp-admin/edit-form-comment.php +0 -160
  132. data/lib/wp/wp-admin/edit-link-form.php +0 -150
  133. data/lib/wp/wp-admin/edit-tag-form.php +0 -204
  134. data/lib/wp/wp-admin/edit-tags.php +0 -591
  135. data/lib/wp/wp-admin/edit.php +0 -330
  136. data/lib/wp/wp-admin/export.php +0 -243
  137. data/lib/wp/wp-admin/freedoms.php +0 -57
  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 +0 -1
  196. data/lib/wp/wp-admin/images/wordpress-logo.png +0 -0
  197. data/lib/wp/wp-admin/images/wordpress-logo.svg +0 -1
  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 +0 -132
  204. data/lib/wp/wp-admin/includes/admin.php +0 -74
  205. data/lib/wp/wp-admin/includes/ajax-actions.php +0 -2762
  206. data/lib/wp/wp-admin/includes/bookmark.php +0 -305
  207. data/lib/wp/wp-admin/includes/class-ftp-pure.php +0 -190
  208. data/lib/wp/wp-admin/includes/class-ftp-sockets.php +0 -250
  209. data/lib/wp/wp-admin/includes/class-ftp.php +0 -907
  210. data/lib/wp/wp-admin/includes/class-pclzip.php +0 -5687
  211. data/lib/wp/wp-admin/includes/class-wp-comments-list-table.php +0 -637
  212. data/lib/wp/wp-admin/includes/class-wp-filesystem-base.php +0 -815
  213. data/lib/wp/wp-admin/includes/class-wp-filesystem-direct.php +0 -384
  214. data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpext.php +0 -415
  215. data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php +0 -352
  216. data/lib/wp/wp-admin/includes/class-wp-filesystem-ssh2.php +0 -392
  217. data/lib/wp/wp-admin/includes/class-wp-importer.php +0 -302
  218. data/lib/wp/wp-admin/includes/class-wp-links-list-table.php +0 -207
  219. data/lib/wp/wp-admin/includes/class-wp-list-table.php +0 -1080
  220. data/lib/wp/wp-admin/includes/class-wp-media-list-table.php +0 -574
  221. data/lib/wp/wp-admin/includes/class-wp-ms-sites-list-table.php +0 -402
  222. data/lib/wp/wp-admin/includes/class-wp-ms-themes-list-table.php +0 -459
  223. data/lib/wp/wp-admin/includes/class-wp-ms-users-list-table.php +0 -303
  224. data/lib/wp/wp-admin/includes/class-wp-plugin-install-list-table.php +0 -490
  225. data/lib/wp/wp-admin/includes/class-wp-plugins-list-table.php +0 -605
  226. data/lib/wp/wp-admin/includes/class-wp-posts-list-table.php +0 -1306
  227. data/lib/wp/wp-admin/includes/class-wp-terms-list-table.php +0 -466
  228. data/lib/wp/wp-admin/includes/class-wp-theme-install-list-table.php +0 -431
  229. data/lib/wp/wp-admin/includes/class-wp-themes-list-table.php +0 -279
  230. data/lib/wp/wp-admin/includes/class-wp-upgrader-skins.php +0 -767
  231. data/lib/wp/wp-admin/includes/class-wp-upgrader.php +0 -2676
  232. data/lib/wp/wp-admin/includes/class-wp-users-list-table.php +0 -459
  233. data/lib/wp/wp-admin/includes/comment.php +0 -171
  234. data/lib/wp/wp-admin/includes/continents-cities.php +0 -493
  235. data/lib/wp/wp-admin/includes/dashboard.php +0 -1333
  236. data/lib/wp/wp-admin/includes/deprecated.php +0 -1190
  237. data/lib/wp/wp-admin/includes/export.php +0 -508
  238. data/lib/wp/wp-admin/includes/file.php +0 -1152
  239. data/lib/wp/wp-admin/includes/image-edit.php +0 -828
  240. data/lib/wp/wp-admin/includes/image.php +0 -598
  241. data/lib/wp/wp-admin/includes/import.php +0 -206
  242. data/lib/wp/wp-admin/includes/list-table.php +0 -113
  243. data/lib/wp/wp-admin/includes/media.php +0 -3012
  244. data/lib/wp/wp-admin/includes/menu.php +0 -322
  245. data/lib/wp/wp-admin/includes/meta-boxes.php +0 -1119
  246. data/lib/wp/wp-admin/includes/misc.php +0 -845
  247. data/lib/wp/wp-admin/includes/ms-deprecated.php +0 -78
  248. data/lib/wp/wp-admin/includes/ms.php +0 -814
  249. data/lib/wp/wp-admin/includes/nav-menu.php +0 -1328
  250. data/lib/wp/wp-admin/includes/plugin-install.php +0 -550
  251. data/lib/wp/wp-admin/includes/plugin.php +0 -1899
  252. data/lib/wp/wp-admin/includes/post.php +0 -1661
  253. data/lib/wp/wp-admin/includes/revision.php +0 -228
  254. data/lib/wp/wp-admin/includes/schema.php +0 -1038
  255. data/lib/wp/wp-admin/includes/screen.php +0 -1179
  256. data/lib/wp/wp-admin/includes/taxonomy.php +0 -284
  257. data/lib/wp/wp-admin/includes/template.php +0 -2157
  258. data/lib/wp/wp-admin/includes/theme-install.php +0 -205
  259. data/lib/wp/wp-admin/includes/theme.php +0 -474
  260. data/lib/wp/wp-admin/includes/translation-install.php +0 -240
  261. data/lib/wp/wp-admin/includes/update-core.php +0 -1186
  262. data/lib/wp/wp-admin/includes/update.php +0 -432
  263. data/lib/wp/wp-admin/includes/upgrade.php +0 -2218
  264. data/lib/wp/wp-admin/includes/user.php +0 -442
  265. data/lib/wp/wp-admin/includes/widgets.php +0 -245
  266. data/lib/wp/wp-admin/index.php +0 -131
  267. data/lib/wp/wp-admin/install-helper.php +0 -199
  268. data/lib/wp/wp-admin/install.php +0 -305
  269. data/lib/wp/wp-admin/js/accordion.js +0 -143
  270. data/lib/wp/wp-admin/js/accordion.min.js +0 -1
  271. data/lib/wp/wp-admin/js/color-picker.js +0 -155
  272. data/lib/wp/wp-admin/js/color-picker.min.js +0 -1
  273. data/lib/wp/wp-admin/js/comment.js +0 -50
  274. data/lib/wp/wp-admin/js/comment.min.js +0 -1
  275. data/lib/wp/wp-admin/js/common.js +0 -804
  276. data/lib/wp/wp-admin/js/common.min.js +0 -1
  277. data/lib/wp/wp-admin/js/custom-background.js +0 -75
  278. data/lib/wp/wp-admin/js/custom-background.min.js +0 -1
  279. data/lib/wp/wp-admin/js/custom-header.js +0 -61
  280. data/lib/wp/wp-admin/js/customize-controls.js +0 -1305
  281. data/lib/wp/wp-admin/js/customize-controls.min.js +0 -1
  282. data/lib/wp/wp-admin/js/customize-widgets.js +0 -1882
  283. data/lib/wp/wp-admin/js/customize-widgets.min.js +0 -1
  284. data/lib/wp/wp-admin/js/dashboard.js +0 -190
  285. data/lib/wp/wp-admin/js/dashboard.min.js +0 -1
  286. data/lib/wp/wp-admin/js/edit-comments.js +0 -625
  287. data/lib/wp/wp-admin/js/edit-comments.min.js +0 -1
  288. data/lib/wp/wp-admin/js/editor-expand.js +0 -705
  289. data/lib/wp/wp-admin/js/editor-expand.min.js +0 -1
  290. data/lib/wp/wp-admin/js/editor.js +0 -324
  291. data/lib/wp/wp-admin/js/editor.min.js +0 -1
  292. data/lib/wp/wp-admin/js/farbtastic.js +0 -276
  293. data/lib/wp/wp-admin/js/gallery.js +0 -237
  294. data/lib/wp/wp-admin/js/gallery.min.js +0 -1
  295. data/lib/wp/wp-admin/js/image-edit.js +0 -633
  296. data/lib/wp/wp-admin/js/image-edit.min.js +0 -1
  297. data/lib/wp/wp-admin/js/inline-edit-post.js +0 -359
  298. data/lib/wp/wp-admin/js/inline-edit-post.min.js +0 -1
  299. data/lib/wp/wp-admin/js/inline-edit-tax.js +0 -142
  300. data/lib/wp/wp-admin/js/inline-edit-tax.min.js +0 -1
  301. data/lib/wp/wp-admin/js/iris.min.js +0 -4
  302. data/lib/wp/wp-admin/js/language-chooser.js +0 -26
  303. data/lib/wp/wp-admin/js/language-chooser.min.js +0 -1
  304. data/lib/wp/wp-admin/js/link.js +0 -69
  305. data/lib/wp/wp-admin/js/link.min.js +0 -1
  306. data/lib/wp/wp-admin/js/media-gallery.js +0 -26
  307. data/lib/wp/wp-admin/js/media-gallery.min.js +0 -1
  308. data/lib/wp/wp-admin/js/media-upload.js +0 -69
  309. data/lib/wp/wp-admin/js/media-upload.min.js +0 -1
  310. data/lib/wp/wp-admin/js/media.js +0 -111
  311. data/lib/wp/wp-admin/js/media.min.js +0 -1
  312. data/lib/wp/wp-admin/js/nav-menu.js +0 -1205
  313. data/lib/wp/wp-admin/js/nav-menu.min.js +0 -1
  314. data/lib/wp/wp-admin/js/password-strength-meter.js +0 -75
  315. data/lib/wp/wp-admin/js/password-strength-meter.min.js +0 -1
  316. data/lib/wp/wp-admin/js/plugin-install.js +0 -76
  317. data/lib/wp/wp-admin/js/plugin-install.min.js +0 -1
  318. data/lib/wp/wp-admin/js/post.js +0 -1094
  319. data/lib/wp/wp-admin/js/post.min.js +0 -1
  320. data/lib/wp/wp-admin/js/postbox.js +0 -199
  321. data/lib/wp/wp-admin/js/postbox.min.js +0 -1
  322. data/lib/wp/wp-admin/js/revisions.js +0 -1110
  323. data/lib/wp/wp-admin/js/revisions.min.js +0 -1
  324. data/lib/wp/wp-admin/js/set-post-thumbnail.js +0 -24
  325. data/lib/wp/wp-admin/js/set-post-thumbnail.min.js +0 -1
  326. data/lib/wp/wp-admin/js/svg-painter.js +0 -240
  327. data/lib/wp/wp-admin/js/svg-painter.min.js +0 -1
  328. data/lib/wp/wp-admin/js/tags.js +0 -72
  329. data/lib/wp/wp-admin/js/tags.min.js +0 -1
  330. data/lib/wp/wp-admin/js/theme.js +0 -1691
  331. data/lib/wp/wp-admin/js/theme.min.js +0 -1
  332. data/lib/wp/wp-admin/js/updates.js +0 -65
  333. data/lib/wp/wp-admin/js/updates.min.js +0 -1
  334. data/lib/wp/wp-admin/js/user-profile.js +0 -127
  335. data/lib/wp/wp-admin/js/user-profile.min.js +0 -1
  336. data/lib/wp/wp-admin/js/user-suggest.js +0 -30
  337. data/lib/wp/wp-admin/js/user-suggest.min.js +0 -1
  338. data/lib/wp/wp-admin/js/widgets.js +0 -494
  339. data/lib/wp/wp-admin/js/widgets.min.js +0 -1
  340. data/lib/wp/wp-admin/js/word-count.js +0 -44
  341. data/lib/wp/wp-admin/js/word-count.min.js +0 -1
  342. data/lib/wp/wp-admin/js/wp-fullscreen.js +0 -704
  343. data/lib/wp/wp-admin/js/wp-fullscreen.min.js +0 -1
  344. data/lib/wp/wp-admin/js/xfn.js +0 -17
  345. data/lib/wp/wp-admin/js/xfn.min.js +0 -1
  346. data/lib/wp/wp-admin/link-add.php +0 -29
  347. data/lib/wp/wp-admin/link-manager.php +0 -99
  348. data/lib/wp/wp-admin/link-parse-opml.php +0 -84
  349. data/lib/wp/wp-admin/link.php +0 -117
  350. data/lib/wp/wp-admin/load-scripts.php +0 -162
  351. data/lib/wp/wp-admin/load-styles.php +0 -153
  352. data/lib/wp/wp-admin/maint/repair.php +0 -124
  353. data/lib/wp/wp-admin/media-new.php +0 -84
  354. data/lib/wp/wp-admin/media-upload.php +0 -100
  355. data/lib/wp/wp-admin/media.php +0 -146
  356. data/lib/wp/wp-admin/menu-header.php +0 -227
  357. data/lib/wp/wp-admin/menu.php +0 -255
  358. data/lib/wp/wp-admin/moderation.php +0 -12
  359. data/lib/wp/wp-admin/ms-admin.php +0 -13
  360. data/lib/wp/wp-admin/ms-delete-site.php +0 -91
  361. data/lib/wp/wp-admin/ms-edit.php +0 -13
  362. data/lib/wp/wp-admin/ms-options.php +0 -12
  363. data/lib/wp/wp-admin/ms-sites.php +0 -13
  364. data/lib/wp/wp-admin/ms-themes.php +0 -13
  365. data/lib/wp/wp-admin/ms-upgrade-network.php +0 -13
  366. data/lib/wp/wp-admin/ms-users.php +0 -13
  367. data/lib/wp/wp-admin/my-sites.php +0 -145
  368. data/lib/wp/wp-admin/nav-menus.php +0 -798
  369. data/lib/wp/wp-admin/network.php +0 -561
  370. data/lib/wp/wp-admin/network/about.php +0 -16
  371. data/lib/wp/wp-admin/network/admin.php +0 -32
  372. data/lib/wp/wp-admin/network/credits.php +0 -16
  373. data/lib/wp/wp-admin/network/edit.php +0 -42
  374. data/lib/wp/wp-admin/network/freedoms.php +0 -16
  375. data/lib/wp/wp-admin/network/index.php +0 -79
  376. data/lib/wp/wp-admin/network/menu.php +0 -63
  377. data/lib/wp/wp-admin/network/plugin-editor.php +0 -16
  378. data/lib/wp/wp-admin/network/plugin-install.php +0 -19
  379. data/lib/wp/wp-admin/network/plugins.php +0 -16
  380. data/lib/wp/wp-admin/network/profile.php +0 -16
  381. data/lib/wp/wp-admin/network/settings.php +0 -347
  382. data/lib/wp/wp-admin/network/setup.php +0 -16
  383. data/lib/wp/wp-admin/network/site-info.php +0 -178
  384. data/lib/wp/wp-admin/network/site-new.php +0 -153
  385. data/lib/wp/wp-admin/network/site-settings.php +0 -173
  386. data/lib/wp/wp-admin/network/site-themes.php +0 -185
  387. data/lib/wp/wp-admin/network/site-users.php +0 -319
  388. data/lib/wp/wp-admin/network/sites.php +0 -275
  389. data/lib/wp/wp-admin/network/theme-editor.php +0 -16
  390. data/lib/wp/wp-admin/network/theme-install.php +0 -19
  391. data/lib/wp/wp-admin/network/themes.php +0 -291
  392. data/lib/wp/wp-admin/network/update-core.php +0 -16
  393. data/lib/wp/wp-admin/network/update.php +0 -19
  394. data/lib/wp/wp-admin/network/upgrade.php +0 -120
  395. data/lib/wp/wp-admin/network/user-edit.php +0 -16
  396. data/lib/wp/wp-admin/network/user-new.php +0 -106
  397. data/lib/wp/wp-admin/network/users.php +0 -296
  398. data/lib/wp/wp-admin/options-discussion.php +0 -273
  399. data/lib/wp/wp-admin/options-general.php +0 -355
  400. data/lib/wp/wp-admin/options-head.php +0 -18
  401. data/lib/wp/wp-admin/options-media.php +0 -136
  402. data/lib/wp/wp-admin/options-permalink.php +0 -289
  403. data/lib/wp/wp-admin/options-reading.php +0 -184
  404. data/lib/wp/wp-admin/options-writing.php +0 -194
  405. data/lib/wp/wp-admin/options.php +0 -265
  406. data/lib/wp/wp-admin/plugin-editor.php +0 -279
  407. data/lib/wp/wp-admin/plugin-install.php +0 -134
  408. data/lib/wp/wp-admin/plugins.php +0 -474
  409. data/lib/wp/wp-admin/post-new.php +0 -74
  410. data/lib/wp/wp-admin/post.php +0 -318
  411. data/lib/wp/wp-admin/press-this.php +0 -691
  412. data/lib/wp/wp-admin/profile.php +0 -18
  413. data/lib/wp/wp-admin/revision.php +0 -221
  414. data/lib/wp/wp-admin/setup-config.php +0 -345
  415. data/lib/wp/wp-admin/theme-editor.php +0 -243
  416. data/lib/wp/wp-admin/theme-install.php +0 -278
  417. data/lib/wp/wp-admin/themes.php +0 -374
  418. data/lib/wp/wp-admin/tools.php +0 -75
  419. data/lib/wp/wp-admin/update-core.php +0 -653
  420. data/lib/wp/wp-admin/update.php +0 -272
  421. data/lib/wp/wp-admin/upgrade-functions.php +0 -12
  422. data/lib/wp/wp-admin/upgrade.php +0 -116
  423. data/lib/wp/wp-admin/upload.php +0 -292
  424. data/lib/wp/wp-admin/user-edit.php +0 -557
  425. data/lib/wp/wp-admin/user-new.php +0 -439
  426. data/lib/wp/wp-admin/user/about.php +0 -13
  427. data/lib/wp/wp-admin/user/admin.php +0 -32
  428. data/lib/wp/wp-admin/user/credits.php +0 -13
  429. data/lib/wp/wp-admin/user/freedoms.php +0 -13
  430. data/lib/wp/wp-admin/user/index.php +0 -12
  431. data/lib/wp/wp-admin/user/menu.php +0 -22
  432. data/lib/wp/wp-admin/user/profile.php +0 -12
  433. data/lib/wp/wp-admin/user/user-edit.php +0 -12
  434. data/lib/wp/wp-admin/users.php +0 -460
  435. data/lib/wp/wp-admin/widgets.php +0 -442
  436. data/lib/wp/wp-blog-header.php +0 -18
  437. data/lib/wp/wp-comments-post.php +0 -164
  438. data/lib/wp/wp-config-sample.php +0 -80
  439. data/lib/wp/wp-content/index.php +0 -2
  440. data/lib/wp/wp-content/plugins/hello.php +0 -82
  441. data/lib/wp/wp-content/plugins/index.php +0 -2
  442. data/lib/wp/wp-content/themes/index.php +0 -2
  443. data/lib/wp/wp-content/themes/stump/.editorconfig +0 -11
  444. data/lib/wp/wp-content/themes/stump/.jshintrc +0 -16
  445. data/lib/wp/wp-content/themes/stump/404.php +0 -13
  446. data/lib/wp/wp-content/themes/stump/CHANGELOG.md +0 -333
  447. data/lib/wp/wp-content/themes/stump/CONTRIBUTING.md +0 -121
  448. data/lib/wp/wp-content/themes/stump/Gruntfile.js +0 -151
  449. data/lib/wp/wp-content/themes/stump/LICENSE.md +0 -19
  450. data/lib/wp/wp-content/themes/stump/assets/coffee/build/.gitkeep +0 -0
  451. data/lib/wp/wp-content/themes/stump/assets/css/editor-style.css +0 -548
  452. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  453. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.svg +0 -229
  454. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  455. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  456. data/lib/wp/wp-content/themes/stump/assets/img/.gitignore +0 -0
  457. data/lib/wp/wp-content/themes/stump/assets/js/_main.js +0 -63
  458. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/affix.js +0 -137
  459. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/alert.js +0 -88
  460. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/button.js +0 -107
  461. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/carousel.js +0 -205
  462. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/collapse.js +0 -170
  463. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/dropdown.js +0 -147
  464. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/modal.js +0 -243
  465. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/popover.js +0 -110
  466. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/scrollspy.js +0 -153
  467. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tab.js +0 -125
  468. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tooltip.js +0 -399
  469. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/transition.js +0 -48
  470. data/lib/wp/wp-content/themes/stump/assets/js/scripts.min.js +0 -1
  471. data/lib/wp/wp-content/themes/stump/assets/js/vendor/jquery-1.11.0.min.js +0 -4
  472. data/lib/wp/wp-content/themes/stump/assets/js/vendor/modernizr-2.7.0.min.js +0 -4
  473. data/lib/wp/wp-content/themes/stump/assets/sass/app.scss +0 -9
  474. data/lib/wp/wp-content/themes/stump/assets/sass/core/_variables.scss +0 -1
  475. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_alerts.scss +0 -67
  476. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_badges.scss +0 -55
  477. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_bootstrap.scss +0 -49
  478. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_breadcrumbs.scss +0 -26
  479. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_button-groups.scss +0 -226
  480. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_buttons.scss +0 -159
  481. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_carousel.scss +0 -232
  482. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_close.scss +0 -35
  483. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_code.scss +0 -63
  484. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_component-animations.scss +0 -29
  485. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_dropdowns.scss +0 -213
  486. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_forms.scss +0 -436
  487. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_glyphicons.scss +0 -233
  488. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_grid.scss +0 -84
  489. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_input-groups.scss +0 -162
  490. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_jumbotron.scss +0 -44
  491. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_labels.scss +0 -64
  492. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_list-group.scss +0 -110
  493. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_media.scss +0 -56
  494. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_mixins.scss +0 -947
  495. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_modals.scss +0 -139
  496. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navbar.scss +0 -620
  497. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navs.scss +0 -242
  498. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_normalize.scss +0 -423
  499. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pager.scss +0 -55
  500. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pagination.scss +0 -88
  501. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_panels.scss +0 -241
  502. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_popovers.scss +0 -133
  503. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_print.scss +0 -101
  504. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_progress-bars.scss +0 -80
  505. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_responsive-utilities.scss +0 -74
  506. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_scaffolding.scss +0 -134
  507. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tables.scss +0 -233
  508. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_theme.scss +0 -247
  509. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_thumbnails.scss +0 -38
  510. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tooltip.scss +0 -95
  511. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_type.scss +0 -284
  512. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_utilities.scss +0 -56
  513. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_variables.scss +0 -833
  514. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_wells.scss +0 -29
  515. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon-deprecated-upcoming.scss +0 -13
  516. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon.scss +0 -59
  517. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_button.scss +0 -273
  518. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_clearfix.scss +0 -29
  519. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_font-family.scss +0 -5
  520. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_hide-text.scss +0 -5
  521. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_html5-input-types.scss +0 -56
  522. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_position.scss +0 -42
  523. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_prefixer.scss +0 -49
  524. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_retina-image.scss +0 -32
  525. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_size.scss +0 -44
  526. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_timing-functions.scss +0 -32
  527. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_triangle.scss +0 -45
  528. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_animation.scss +0 -52
  529. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_appearance.scss +0 -3
  530. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_backface-visibility.scss +0 -6
  531. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background-image.scss +0 -48
  532. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background.scss +0 -103
  533. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-image.scss +0 -55
  534. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-radius.scss +0 -22
  535. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_box-sizing.scss +0 -4
  536. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_columns.scss +0 -47
  537. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_flex-box.scss +0 -52
  538. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_font-face.scss +0 -23
  539. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_hidpi-media-query.scss +0 -10
  540. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_image-rendering.scss +0 -13
  541. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_inline-block.scss +0 -8
  542. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_keyframes.scss +0 -43
  543. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_linear-gradient.scss +0 -41
  544. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_perspective.scss +0 -8
  545. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_placeholder.scss +0 -29
  546. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_radial-gradient.scss +0 -44
  547. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transform.scss +0 -15
  548. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transition.scss +0 -34
  549. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_user-select.scss +0 -3
  550. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_compact.scss +0 -11
  551. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_flex-grid.scss +0 -39
  552. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_grid-width.scss +0 -13
  553. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_linear-gradient.scss +0 -13
  554. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_modular-scale.scss +0 -40
  555. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_px-to-em.scss +0 -8
  556. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_radial-gradient.scss +0 -23
  557. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_tint-shade.scss +0 -9
  558. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_transition-property-name.scss +0 -22
  559. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_deprecated-webkit-gradient.scss +0 -39
  560. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_gradient-positions-parser.scss +0 -13
  561. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_linear-positions-parser.scss +0 -61
  562. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-arg-parser.scss +0 -69
  563. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-positions-parser.scss +0 -18
  564. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_render-gradients.scss +0 -26
  565. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_shape-size-stripper.scss +0 -10
  566. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan.sass +0 -11
  567. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_grid.sass +0 -161
  568. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_mixins.sass +0 -63
  569. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_utilities.sass +0 -24
  570. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_variables.sass +0 -42
  571. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat-helpers.scss +0 -8
  572. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat.scss +0 -21
  573. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_new-breakpoint.scss +0 -16
  574. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_private.scss +0 -107
  575. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_px-to-em.scss +0 -3
  576. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_fill-parent.scss +0 -7
  577. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_grid.scss +0 -5
  578. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_media.scss +0 -51
  579. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_omega.scss +0 -79
  580. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_outer-container.scss +0 -8
  581. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_pad.scss +0 -8
  582. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_private.scss +0 -50
  583. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_reset.scss +0 -12
  584. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_row.scss +0 -17
  585. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_shift.scss +0 -9
  586. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_span-columns.scss +0 -38
  587. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_to-deprecate.scss +0 -57
  588. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_visual-grid.scss +0 -41
  589. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_grid.scss +0 -7
  590. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_visual-grid.scss +0 -5
  591. data/lib/wp/wp-content/themes/stump/base.php +0 -36
  592. data/lib/wp/wp-content/themes/stump/functions.php +0 -19
  593. data/lib/wp/wp-content/themes/stump/index.php +0 -21
  594. data/lib/wp/wp-content/themes/stump/lang/ar.mo +0 -0
  595. data/lib/wp/wp-content/themes/stump/lang/ar.po +0 -270
  596. data/lib/wp/wp-content/themes/stump/lang/bg_BG.mo +0 -0
  597. data/lib/wp/wp-content/themes/stump/lang/bg_BG.po +0 -338
  598. data/lib/wp/wp-content/themes/stump/lang/ca.mo +0 -0
  599. data/lib/wp/wp-content/themes/stump/lang/ca.po +0 -517
  600. data/lib/wp/wp-content/themes/stump/lang/da_DK.mo +0 -0
  601. data/lib/wp/wp-content/themes/stump/lang/da_DK.po +0 -305
  602. data/lib/wp/wp-content/themes/stump/lang/de_DE.mo +0 -0
  603. data/lib/wp/wp-content/themes/stump/lang/de_DE.po +0 -271
  604. data/lib/wp/wp-content/themes/stump/lang/el.mo +0 -0
  605. data/lib/wp/wp-content/themes/stump/lang/el.po +0 -319
  606. data/lib/wp/wp-content/themes/stump/lang/es_ES.mo +0 -0
  607. data/lib/wp/wp-content/themes/stump/lang/es_ES.po +0 -270
  608. data/lib/wp/wp-content/themes/stump/lang/et.mo +0 -0
  609. data/lib/wp/wp-content/themes/stump/lang/et.po +0 -262
  610. data/lib/wp/wp-content/themes/stump/lang/fa_IR.mo +0 -0
  611. data/lib/wp/wp-content/themes/stump/lang/fa_IR.po +0 -273
  612. data/lib/wp/wp-content/themes/stump/lang/fi_FI.mo +0 -0
  613. data/lib/wp/wp-content/themes/stump/lang/fi_FI.po +0 -367
  614. data/lib/wp/wp-content/themes/stump/lang/fr_FR.mo +0 -0
  615. data/lib/wp/wp-content/themes/stump/lang/fr_FR.po +0 -336
  616. data/lib/wp/wp-content/themes/stump/lang/he_IL.mo +0 -0
  617. data/lib/wp/wp-content/themes/stump/lang/he_IL.po +0 -336
  618. data/lib/wp/wp-content/themes/stump/lang/hu_HU.mo +0 -0
  619. data/lib/wp/wp-content/themes/stump/lang/hu_HU.po +0 -271
  620. data/lib/wp/wp-content/themes/stump/lang/id_ID.mo +0 -0
  621. data/lib/wp/wp-content/themes/stump/lang/id_ID.po +0 -278
  622. data/lib/wp/wp-content/themes/stump/lang/it_IT.mo +0 -0
  623. data/lib/wp/wp-content/themes/stump/lang/it_IT.po +0 -269
  624. data/lib/wp/wp-content/themes/stump/lang/ja.mo +0 -0
  625. data/lib/wp/wp-content/themes/stump/lang/ja.po +0 -267
  626. data/lib/wp/wp-content/themes/stump/lang/ko_KR.mo +0 -0
  627. data/lib/wp/wp-content/themes/stump/lang/ko_KR.po +0 -282
  628. data/lib/wp/wp-content/themes/stump/lang/mk_MK.mo +0 -0
  629. data/lib/wp/wp-content/themes/stump/lang/mk_MK.po +0 -297
  630. data/lib/wp/wp-content/themes/stump/lang/ms_MY.mo +0 -0
  631. data/lib/wp/wp-content/themes/stump/lang/ms_MY.po +0 -342
  632. data/lib/wp/wp-content/themes/stump/lang/nb_NO.mo +0 -0
  633. data/lib/wp/wp-content/themes/stump/lang/nb_NO.po +0 -517
  634. data/lib/wp/wp-content/themes/stump/lang/nl_NL.mo +0 -0
  635. data/lib/wp/wp-content/themes/stump/lang/nl_NL.po +0 -261
  636. data/lib/wp/wp-content/themes/stump/lang/nn_NO.mo +0 -0
  637. data/lib/wp/wp-content/themes/stump/lang/nn_NO.po +0 -517
  638. data/lib/wp/wp-content/themes/stump/lang/pl_PL.mo +0 -0
  639. data/lib/wp/wp-content/themes/stump/lang/pl_PL.po +0 -283
  640. data/lib/wp/wp-content/themes/stump/lang/pt_BR.mo +0 -0
  641. data/lib/wp/wp-content/themes/stump/lang/pt_BR.po +0 -394
  642. data/lib/wp/wp-content/themes/stump/lang/ro_RO.mo +0 -0
  643. data/lib/wp/wp-content/themes/stump/lang/ro_RO.po +0 -271
  644. data/lib/wp/wp-content/themes/stump/lang/roots.pot +0 -244
  645. data/lib/wp/wp-content/themes/stump/lang/ru_RU.mo +0 -0
  646. data/lib/wp/wp-content/themes/stump/lang/ru_RU.po +0 -255
  647. data/lib/wp/wp-content/themes/stump/lang/sk_SK.mo +0 -0
  648. data/lib/wp/wp-content/themes/stump/lang/sk_SK.po +0 -267
  649. data/lib/wp/wp-content/themes/stump/lang/sr_RS.mo +0 -0
  650. data/lib/wp/wp-content/themes/stump/lang/sr_RS.pot +0 -261
  651. data/lib/wp/wp-content/themes/stump/lang/sv_SE.mo +0 -0
  652. data/lib/wp/wp-content/themes/stump/lang/sv_SE.po +0 -323
  653. data/lib/wp/wp-content/themes/stump/lang/tr_TR.mo +0 -0
  654. data/lib/wp/wp-content/themes/stump/lang/tr_TR.po +0 -405
  655. data/lib/wp/wp-content/themes/stump/lang/vi_VN.mo +0 -0
  656. data/lib/wp/wp-content/themes/stump/lang/vi_VN.po +0 -516
  657. data/lib/wp/wp-content/themes/stump/lang/zh_CN.mo +0 -0
  658. data/lib/wp/wp-content/themes/stump/lang/zh_CN.po +0 -329
  659. data/lib/wp/wp-content/themes/stump/lang/zh_TW.mo +0 -0
  660. data/lib/wp/wp-content/themes/stump/lang/zh_TW.po +0 -261
  661. data/lib/wp/wp-content/themes/stump/lib/activation.php +0 -215
  662. data/lib/wp/wp-content/themes/stump/lib/cleanup.php +0 -261
  663. data/lib/wp/wp-content/themes/stump/lib/comments.php +0 -52
  664. data/lib/wp/wp-content/themes/stump/lib/config.php +0 -79
  665. data/lib/wp/wp-content/themes/stump/lib/custom.php +0 -4
  666. data/lib/wp/wp-content/themes/stump/lib/gallery.php +0 -130
  667. data/lib/wp/wp-content/themes/stump/lib/init.php +0 -25
  668. data/lib/wp/wp-content/themes/stump/lib/nav.php +0 -93
  669. data/lib/wp/wp-content/themes/stump/lib/relative-urls.php +0 -50
  670. data/lib/wp/wp-content/themes/stump/lib/scripts.php +0 -67
  671. data/lib/wp/wp-content/themes/stump/lib/sidebar.php +0 -43
  672. data/lib/wp/wp-content/themes/stump/lib/titles.php +0 -37
  673. data/lib/wp/wp-content/themes/stump/lib/utils.php +0 -14
  674. data/lib/wp/wp-content/themes/stump/lib/widgets.php +0 -133
  675. data/lib/wp/wp-content/themes/stump/lib/wrapper.php +0 -49
  676. data/lib/wp/wp-content/themes/stump/package.json +0 -32
  677. data/lib/wp/wp-content/themes/stump/page.php +0 -2
  678. data/lib/wp/wp-content/themes/stump/screenshot.png +0 -0
  679. data/lib/wp/wp-content/themes/stump/single.php +0 -1
  680. data/lib/wp/wp-content/themes/stump/style.css +0 -11
  681. data/lib/wp/wp-content/themes/stump/template-custom.php +0 -8
  682. data/lib/wp/wp-content/themes/stump/templates/comment.php +0 -14
  683. data/lib/wp/wp-content/themes/stump/templates/comments.php +0 -80
  684. data/lib/wp/wp-content/themes/stump/templates/content-page.php +0 -4
  685. data/lib/wp/wp-content/themes/stump/templates/content-single.php +0 -15
  686. data/lib/wp/wp-content/themes/stump/templates/content.php +0 -9
  687. data/lib/wp/wp-content/themes/stump/templates/entry-meta.php +0 -2
  688. data/lib/wp/wp-content/themes/stump/templates/footer.php +0 -8
  689. data/lib/wp/wp-content/themes/stump/templates/head.php +0 -12
  690. data/lib/wp/wp-content/themes/stump/templates/header-top-navbar.php +0 -21
  691. data/lib/wp/wp-content/themes/stump/templates/header.php +0 -14
  692. data/lib/wp/wp-content/themes/stump/templates/page-header.php +0 -5
  693. data/lib/wp/wp-content/themes/stump/templates/searchform.php +0 -9
  694. data/lib/wp/wp-content/themes/stump/templates/sidebar.php +0 -1
  695. data/lib/wp/wp-cron.php +0 -115
  696. data/lib/wp/wp-includes/ID3/getid3.lib.php +0 -1376
  697. data/lib/wp/wp-includes/ID3/getid3.php +0 -1796
  698. data/lib/wp/wp-includes/ID3/license.commercial.txt +0 -27
  699. data/lib/wp/wp-includes/ID3/license.txt +0 -29
  700. data/lib/wp/wp-includes/ID3/module.audio-video.asf.php +0 -2013
  701. data/lib/wp/wp-includes/ID3/module.audio-video.flv.php +0 -745
  702. data/lib/wp/wp-includes/ID3/module.audio-video.matroska.php +0 -1751
  703. data/lib/wp/wp-includes/ID3/module.audio-video.quicktime.php +0 -2246
  704. data/lib/wp/wp-includes/ID3/module.audio-video.riff.php +0 -2586
  705. data/lib/wp/wp-includes/ID3/module.audio.ac3.php +0 -474
  706. data/lib/wp/wp-includes/ID3/module.audio.dts.php +0 -291
  707. data/lib/wp/wp-includes/ID3/module.audio.flac.php +0 -443
  708. data/lib/wp/wp-includes/ID3/module.audio.mp3.php +0 -2012
  709. data/lib/wp/wp-includes/ID3/module.audio.ogg.php +0 -756
  710. data/lib/wp/wp-includes/ID3/module.tag.apetag.php +0 -371
  711. data/lib/wp/wp-includes/ID3/module.tag.id3v1.php +0 -360
  712. data/lib/wp/wp-includes/ID3/module.tag.id3v2.php +0 -3424
  713. data/lib/wp/wp-includes/ID3/module.tag.lyrics3.php +0 -294
  714. data/lib/wp/wp-includes/ID3/readme.txt +0 -604
  715. data/lib/wp/wp-includes/SimplePie/Author.php +0 -157
  716. data/lib/wp/wp-includes/SimplePie/Cache.php +0 -133
  717. data/lib/wp/wp-includes/SimplePie/Cache/Base.php +0 -114
  718. data/lib/wp/wp-includes/SimplePie/Cache/DB.php +0 -137
  719. data/lib/wp/wp-includes/SimplePie/Cache/File.php +0 -173
  720. data/lib/wp/wp-includes/SimplePie/Cache/Memcache.php +0 -183
  721. data/lib/wp/wp-includes/SimplePie/Cache/MySQL.php +0 -438
  722. data/lib/wp/wp-includes/SimplePie/Caption.php +0 -210
  723. data/lib/wp/wp-includes/SimplePie/Category.php +0 -157
  724. data/lib/wp/wp-includes/SimplePie/Content/Type/Sniffer.php +0 -332
  725. data/lib/wp/wp-includes/SimplePie/Copyright.php +0 -130
  726. data/lib/wp/wp-includes/SimplePie/Core.php +0 -57
  727. data/lib/wp/wp-includes/SimplePie/Credit.php +0 -156
  728. data/lib/wp/wp-includes/SimplePie/Decode/HTML/Entities.php +0 -617
  729. data/lib/wp/wp-includes/SimplePie/Enclosure.php +0 -1380
  730. data/lib/wp/wp-includes/SimplePie/Exception.php +0 -52
  731. data/lib/wp/wp-includes/SimplePie/File.php +0 -292
  732. data/lib/wp/wp-includes/SimplePie/HTTP/Parser.php +0 -500
  733. data/lib/wp/wp-includes/SimplePie/IRI.php +0 -1238
  734. data/lib/wp/wp-includes/SimplePie/Item.php +0 -2964
  735. data/lib/wp/wp-includes/SimplePie/Locator.php +0 -372
  736. data/lib/wp/wp-includes/SimplePie/Misc.php +0 -2247
  737. data/lib/wp/wp-includes/SimplePie/Net/IPv6.php +0 -276
  738. data/lib/wp/wp-includes/SimplePie/Parse/Date.php +0 -983
  739. data/lib/wp/wp-includes/SimplePie/Parser.php +0 -407
  740. data/lib/wp/wp-includes/SimplePie/Rating.php +0 -129
  741. data/lib/wp/wp-includes/SimplePie/Registry.php +0 -225
  742. data/lib/wp/wp-includes/SimplePie/Restriction.php +0 -155
  743. data/lib/wp/wp-includes/SimplePie/Sanitize.php +0 -554
  744. data/lib/wp/wp-includes/SimplePie/Source.php +0 -611
  745. data/lib/wp/wp-includes/SimplePie/XML/Declaration/Parser.php +0 -362
  746. data/lib/wp/wp-includes/SimplePie/gzdecode.php +0 -371
  747. data/lib/wp/wp-includes/Text/Diff.php +0 -450
  748. data/lib/wp/wp-includes/Text/Diff/Engine/native.php +0 -436
  749. data/lib/wp/wp-includes/Text/Diff/Engine/shell.php +0 -162
  750. data/lib/wp/wp-includes/Text/Diff/Engine/string.php +0 -248
  751. data/lib/wp/wp-includes/Text/Diff/Engine/xdiff.php +0 -64
  752. data/lib/wp/wp-includes/Text/Diff/Renderer.php +0 -235
  753. data/lib/wp/wp-includes/Text/Diff/Renderer/inline.php +0 -206
  754. data/lib/wp/wp-includes/admin-bar.php +0 -870
  755. data/lib/wp/wp-includes/atomlib.php +0 -352
  756. data/lib/wp/wp-includes/author-template.php +0 -471
  757. data/lib/wp/wp-includes/bookmark-template.php +0 -298
  758. data/lib/wp/wp-includes/bookmark.php +0 -416
  759. data/lib/wp/wp-includes/cache.php +0 -704
  760. data/lib/wp/wp-includes/canonical.php +0 -586
  761. data/lib/wp/wp-includes/capabilities.php +0 -1539
  762. data/lib/wp/wp-includes/category-template.php +0 -1407
  763. data/lib/wp/wp-includes/category.php +0 -343
  764. data/lib/wp/wp-includes/certificates/ca-bundle.crt +0 -3785
  765. data/lib/wp/wp-includes/class-IXR.php +0 -1100
  766. data/lib/wp/wp-includes/class-feed.php +0 -140
  767. data/lib/wp/wp-includes/class-http.php +0 -2245
  768. data/lib/wp/wp-includes/class-json.php +0 -936
  769. data/lib/wp/wp-includes/class-oembed.php +0 -579
  770. data/lib/wp/wp-includes/class-phpass.php +0 -260
  771. data/lib/wp/wp-includes/class-phpmailer.php +0 -3265
  772. data/lib/wp/wp-includes/class-pop3.php +0 -652
  773. data/lib/wp/wp-includes/class-simplepie.php +0 -3119
  774. data/lib/wp/wp-includes/class-smtp.php +0 -943
  775. data/lib/wp/wp-includes/class-snoopy.php +0 -1256
  776. data/lib/wp/wp-includes/class-wp-admin-bar.php +0 -517
  777. data/lib/wp/wp-includes/class-wp-ajax-response.php +0 -199
  778. data/lib/wp/wp-includes/class-wp-customize-control.php +0 -1124
  779. data/lib/wp/wp-includes/class-wp-customize-manager.php +0 -1272
  780. data/lib/wp/wp-includes/class-wp-customize-panel.php +0 -200
  781. data/lib/wp/wp-includes/class-wp-customize-section.php +0 -196
  782. data/lib/wp/wp-includes/class-wp-customize-setting.php +0 -554
  783. data/lib/wp/wp-includes/class-wp-customize-widgets.php +0 -1556
  784. data/lib/wp/wp-includes/class-wp-editor.php +0 -1435
  785. data/lib/wp/wp-includes/class-wp-embed.php +0 -373
  786. data/lib/wp/wp-includes/class-wp-error.php +0 -276
  787. data/lib/wp/wp-includes/class-wp-http-ixr-client.php +0 -97
  788. data/lib/wp/wp-includes/class-wp-image-editor-gd.php +0 -459
  789. data/lib/wp/wp-includes/class-wp-image-editor-imagick.php +0 -512
  790. data/lib/wp/wp-includes/class-wp-image-editor.php +0 -475
  791. data/lib/wp/wp-includes/class-wp-theme.php +0 -1235
  792. data/lib/wp/wp-includes/class-wp-walker.php +0 -471
  793. data/lib/wp/wp-includes/class-wp-xmlrpc-server.php +0 -5984
  794. data/lib/wp/wp-includes/class-wp.php +0 -782
  795. data/lib/wp/wp-includes/class.wp-dependencies.php +0 -509
  796. data/lib/wp/wp-includes/class.wp-scripts.php +0 -247
  797. data/lib/wp/wp-includes/class.wp-styles.php +0 -210
  798. data/lib/wp/wp-includes/comment-template.php +0 -2286
  799. data/lib/wp/wp-includes/comment.php +0 -2606
  800. data/lib/wp/wp-includes/compat.php +0 -125
  801. data/lib/wp/wp-includes/cron.php +0 -469
  802. data/lib/wp/wp-includes/css/admin-bar-rtl.css +0 -1099
  803. data/lib/wp/wp-includes/css/admin-bar-rtl.min.css +0 -1
  804. data/lib/wp/wp-includes/css/admin-bar.css +0 -1099
  805. data/lib/wp/wp-includes/css/admin-bar.min.css +0 -1
  806. data/lib/wp/wp-includes/css/buttons-rtl.css +0 -364
  807. data/lib/wp/wp-includes/css/buttons-rtl.min.css +0 -1
  808. data/lib/wp/wp-includes/css/buttons.css +0 -364
  809. data/lib/wp/wp-includes/css/buttons.min.css +0 -1
  810. data/lib/wp/wp-includes/css/dashicons.css +0 -893
  811. data/lib/wp/wp-includes/css/dashicons.min.css +0 -1
  812. data/lib/wp/wp-includes/css/editor-rtl.css +0 -1993
  813. data/lib/wp/wp-includes/css/editor-rtl.min.css +0 -1
  814. data/lib/wp/wp-includes/css/editor.css +0 -1993
  815. data/lib/wp/wp-includes/css/editor.min.css +0 -1
  816. data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.css +0 -343
  817. data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.min.css +0 -19
  818. data/lib/wp/wp-includes/css/jquery-ui-dialog.css +0 -343
  819. data/lib/wp/wp-includes/css/jquery-ui-dialog.min.css +0 -19
  820. data/lib/wp/wp-includes/css/media-views-rtl.css +0 -2568
  821. data/lib/wp/wp-includes/css/media-views-rtl.min.css +0 -1
  822. data/lib/wp/wp-includes/css/media-views.css +0 -2568
  823. data/lib/wp/wp-includes/css/media-views.min.css +0 -1
  824. data/lib/wp/wp-includes/css/wp-auth-check-rtl.css +0 -100
  825. data/lib/wp/wp-includes/css/wp-auth-check-rtl.min.css +0 -1
  826. data/lib/wp/wp-includes/css/wp-auth-check.css +0 -100
  827. data/lib/wp/wp-includes/css/wp-auth-check.min.css +0 -1
  828. data/lib/wp/wp-includes/css/wp-pointer-rtl.css +0 -212
  829. data/lib/wp/wp-includes/css/wp-pointer-rtl.min.css +0 -1
  830. data/lib/wp/wp-includes/css/wp-pointer.css +0 -212
  831. data/lib/wp/wp-includes/css/wp-pointer.min.css +0 -1
  832. data/lib/wp/wp-includes/date.php +0 -475
  833. data/lib/wp/wp-includes/default-constants.php +0 -323
  834. data/lib/wp/wp-includes/default-filters.php +0 -307
  835. data/lib/wp/wp-includes/default-widgets.php +0 -1423
  836. data/lib/wp/wp-includes/deprecated.php +0 -3501
  837. data/lib/wp/wp-includes/feed-atom-comments.php +0 -115
  838. data/lib/wp/wp-includes/feed-atom.php +0 -87
  839. data/lib/wp/wp-includes/feed-rdf.php +0 -81
  840. data/lib/wp/wp-includes/feed-rss.php +0 -46
  841. data/lib/wp/wp-includes/feed-rss2-comments.php +0 -97
  842. data/lib/wp/wp-includes/feed-rss2.php +0 -115
  843. data/lib/wp/wp-includes/feed.php +0 -659
  844. data/lib/wp/wp-includes/fonts/dashicons.eot +0 -0
  845. data/lib/wp/wp-includes/fonts/dashicons.svg +0 -250
  846. data/lib/wp/wp-includes/fonts/dashicons.ttf +0 -0
  847. data/lib/wp/wp-includes/fonts/dashicons.woff +0 -0
  848. data/lib/wp/wp-includes/formatting.php +0 -4006
  849. data/lib/wp/wp-includes/functions.php +0 -4631
  850. data/lib/wp/wp-includes/functions.wp-scripts.php +0 -258
  851. data/lib/wp/wp-includes/functions.wp-styles.php +0 -245
  852. data/lib/wp/wp-includes/general-template.php +0 -2982
  853. data/lib/wp/wp-includes/http.php +0 -551
  854. data/lib/wp/wp-includes/images/admin-bar-sprite-2x.png +0 -0
  855. data/lib/wp/wp-includes/images/admin-bar-sprite.png +0 -0
  856. data/lib/wp/wp-includes/images/arrow-pointer-blue-2x.png +0 -0
  857. data/lib/wp/wp-includes/images/arrow-pointer-blue.png +0 -0
  858. data/lib/wp/wp-includes/images/blank.gif +0 -0
  859. data/lib/wp/wp-includes/images/crystal/archive.png +0 -0
  860. data/lib/wp/wp-includes/images/crystal/audio.png +0 -0
  861. data/lib/wp/wp-includes/images/crystal/code.png +0 -0
  862. data/lib/wp/wp-includes/images/crystal/default.png +0 -0
  863. data/lib/wp/wp-includes/images/crystal/document.png +0 -0
  864. data/lib/wp/wp-includes/images/crystal/interactive.png +0 -0
  865. data/lib/wp/wp-includes/images/crystal/license.txt +0 -9
  866. data/lib/wp/wp-includes/images/crystal/spreadsheet.png +0 -0
  867. data/lib/wp/wp-includes/images/crystal/text.png +0 -0
  868. data/lib/wp/wp-includes/images/crystal/video.png +0 -0
  869. data/lib/wp/wp-includes/images/down_arrow-2x.gif +0 -0
  870. data/lib/wp/wp-includes/images/down_arrow.gif +0 -0
  871. data/lib/wp/wp-includes/images/icon-pointer-flag-2x.png +0 -0
  872. data/lib/wp/wp-includes/images/icon-pointer-flag.png +0 -0
  873. data/lib/wp/wp-includes/images/media/archive.png +0 -0
  874. data/lib/wp/wp-includes/images/media/audio.png +0 -0
  875. data/lib/wp/wp-includes/images/media/code.png +0 -0
  876. data/lib/wp/wp-includes/images/media/default.png +0 -0
  877. data/lib/wp/wp-includes/images/media/document.png +0 -0
  878. data/lib/wp/wp-includes/images/media/interactive.png +0 -0
  879. data/lib/wp/wp-includes/images/media/spreadsheet.png +0 -0
  880. data/lib/wp/wp-includes/images/media/text.png +0 -0
  881. data/lib/wp/wp-includes/images/media/video.png +0 -0
  882. data/lib/wp/wp-includes/images/rss-2x.png +0 -0
  883. data/lib/wp/wp-includes/images/rss.png +0 -0
  884. data/lib/wp/wp-includes/images/smilies/icon_arrow.gif +0 -0
  885. data/lib/wp/wp-includes/images/smilies/icon_biggrin.gif +0 -0
  886. data/lib/wp/wp-includes/images/smilies/icon_confused.gif +0 -0
  887. data/lib/wp/wp-includes/images/smilies/icon_cool.gif +0 -0
  888. data/lib/wp/wp-includes/images/smilies/icon_cry.gif +0 -0
  889. data/lib/wp/wp-includes/images/smilies/icon_eek.gif +0 -0
  890. data/lib/wp/wp-includes/images/smilies/icon_evil.gif +0 -0
  891. data/lib/wp/wp-includes/images/smilies/icon_exclaim.gif +0 -0
  892. data/lib/wp/wp-includes/images/smilies/icon_idea.gif +0 -0
  893. data/lib/wp/wp-includes/images/smilies/icon_lol.gif +0 -0
  894. data/lib/wp/wp-includes/images/smilies/icon_mad.gif +0 -0
  895. data/lib/wp/wp-includes/images/smilies/icon_mrgreen.gif +0 -0
  896. data/lib/wp/wp-includes/images/smilies/icon_neutral.gif +0 -0
  897. data/lib/wp/wp-includes/images/smilies/icon_question.gif +0 -0
  898. data/lib/wp/wp-includes/images/smilies/icon_razz.gif +0 -0
  899. data/lib/wp/wp-includes/images/smilies/icon_redface.gif +0 -0
  900. data/lib/wp/wp-includes/images/smilies/icon_rolleyes.gif +0 -0
  901. data/lib/wp/wp-includes/images/smilies/icon_sad.gif +0 -0
  902. data/lib/wp/wp-includes/images/smilies/icon_smile.gif +0 -0
  903. data/lib/wp/wp-includes/images/smilies/icon_surprised.gif +0 -0
  904. data/lib/wp/wp-includes/images/smilies/icon_twisted.gif +0 -0
  905. data/lib/wp/wp-includes/images/smilies/icon_wink.gif +0 -0
  906. data/lib/wp/wp-includes/images/spinner-2x.gif +0 -0
  907. data/lib/wp/wp-includes/images/spinner.gif +0 -0
  908. data/lib/wp/wp-includes/images/toggle-arrow-2x.png +0 -0
  909. data/lib/wp/wp-includes/images/toggle-arrow.png +0 -0
  910. data/lib/wp/wp-includes/images/uploader-icons-2x.png +0 -0
  911. data/lib/wp/wp-includes/images/uploader-icons.png +0 -0
  912. data/lib/wp/wp-includes/images/wlw/wp-comments.png +0 -0
  913. data/lib/wp/wp-includes/images/wlw/wp-icon.png +0 -0
  914. data/lib/wp/wp-includes/images/wlw/wp-watermark.png +0 -0
  915. data/lib/wp/wp-includes/images/wpicons-2x.png +0 -0
  916. data/lib/wp/wp-includes/images/wpicons.png +0 -0
  917. data/lib/wp/wp-includes/images/wpspin-2x.gif +0 -0
  918. data/lib/wp/wp-includes/images/wpspin.gif +0 -0
  919. data/lib/wp/wp-includes/images/xit-2x.gif +0 -0
  920. data/lib/wp/wp-includes/images/xit.gif +0 -0
  921. data/lib/wp/wp-includes/js/admin-bar.js +0 -365
  922. data/lib/wp/wp-includes/js/admin-bar.min.js +0 -1
  923. data/lib/wp/wp-includes/js/autosave.js +0 -589
  924. data/lib/wp/wp-includes/js/autosave.min.js +0 -1
  925. data/lib/wp/wp-includes/js/backbone.min.js +0 -1
  926. data/lib/wp/wp-includes/js/colorpicker.js +0 -707
  927. data/lib/wp/wp-includes/js/colorpicker.min.js +0 -1
  928. data/lib/wp/wp-includes/js/comment-reply.js +0 -47
  929. data/lib/wp/wp-includes/js/comment-reply.min.js +0 -1
  930. data/lib/wp/wp-includes/js/crop/cropper.css +0 -165
  931. data/lib/wp/wp-includes/js/crop/cropper.js +0 -516
  932. data/lib/wp/wp-includes/js/crop/marqueeHoriz.gif +0 -0
  933. data/lib/wp/wp-includes/js/crop/marqueeVert.gif +0 -0
  934. data/lib/wp/wp-includes/js/customize-base.js +0 -617
  935. data/lib/wp/wp-includes/js/customize-base.min.js +0 -1
  936. data/lib/wp/wp-includes/js/customize-loader.js +0 -246
  937. data/lib/wp/wp-includes/js/customize-loader.min.js +0 -1
  938. data/lib/wp/wp-includes/js/customize-models.js +0 -247
  939. data/lib/wp/wp-includes/js/customize-models.min.js +0 -1
  940. data/lib/wp/wp-includes/js/customize-preview-widgets.js +0 -129
  941. data/lib/wp/wp-includes/js/customize-preview-widgets.min.js +0 -1
  942. data/lib/wp/wp-includes/js/customize-preview.js +0 -154
  943. data/lib/wp/wp-includes/js/customize-preview.min.js +0 -1
  944. data/lib/wp/wp-includes/js/customize-views.js +0 -231
  945. data/lib/wp/wp-includes/js/customize-views.min.js +0 -1
  946. data/lib/wp/wp-includes/js/heartbeat.js +0 -738
  947. data/lib/wp/wp-includes/js/heartbeat.min.js +0 -1
  948. data/lib/wp/wp-includes/js/hoverIntent.js +0 -115
  949. data/lib/wp/wp-includes/js/hoverIntent.min.js +0 -1
  950. data/lib/wp/wp-includes/js/imgareaselect/border-anim-h.gif +0 -0
  951. data/lib/wp/wp-includes/js/imgareaselect/border-anim-v.gif +0 -0
  952. data/lib/wp/wp-includes/js/imgareaselect/imgareaselect.css +0 -41
  953. data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.js +0 -1205
  954. data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.min.js +0 -1
  955. data/lib/wp/wp-includes/js/jcrop/Jcrop.gif +0 -0
  956. data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.css +0 -29
  957. data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.js +0 -22
  958. data/lib/wp/wp-includes/js/jquery/jquery-migrate.js +0 -521
  959. data/lib/wp/wp-includes/js/jquery/jquery-migrate.min.js +0 -2
  960. data/lib/wp/wp-includes/js/jquery/jquery.color.min.js +0 -2
  961. data/lib/wp/wp-includes/js/jquery/jquery.form.js +0 -1193
  962. data/lib/wp/wp-includes/js/jquery/jquery.form.min.js +0 -11
  963. data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.js +0 -134
  964. data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.min.js +0 -1
  965. data/lib/wp/wp-includes/js/jquery/jquery.js +0 -5
  966. data/lib/wp/wp-includes/js/jquery/jquery.masonry.min.js +0 -11
  967. data/lib/wp/wp-includes/js/jquery/jquery.query.js +0 -11
  968. data/lib/wp/wp-includes/js/jquery/jquery.schedule.js +0 -36
  969. data/lib/wp/wp-includes/js/jquery/jquery.serialize-object.js +0 -31
  970. data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.js +0 -99
  971. data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.min.js +0 -1
  972. data/lib/wp/wp-includes/js/jquery/jquery.ui.touch-punch.js +0 -11
  973. data/lib/wp/wp-includes/js/jquery/suggest.js +0 -316
  974. data/lib/wp/wp-includes/js/jquery/suggest.min.js +0 -1
  975. data/lib/wp/wp-includes/js/jquery/ui/accordion.min.js +0 -11
  976. data/lib/wp/wp-includes/js/jquery/ui/autocomplete.min.js +0 -11
  977. data/lib/wp/wp-includes/js/jquery/ui/button.min.js +0 -11
  978. data/lib/wp/wp-includes/js/jquery/ui/core.min.js +0 -11
  979. data/lib/wp/wp-includes/js/jquery/ui/datepicker.min.js +0 -12
  980. data/lib/wp/wp-includes/js/jquery/ui/dialog.min.js +0 -11
  981. data/lib/wp/wp-includes/js/jquery/ui/draggable.min.js +0 -11
  982. data/lib/wp/wp-includes/js/jquery/ui/droppable.min.js +0 -11
  983. data/lib/wp/wp-includes/js/jquery/ui/effect-blind.min.js +0 -11
  984. data/lib/wp/wp-includes/js/jquery/ui/effect-bounce.min.js +0 -11
  985. data/lib/wp/wp-includes/js/jquery/ui/effect-clip.min.js +0 -11
  986. data/lib/wp/wp-includes/js/jquery/ui/effect-drop.min.js +0 -11
  987. data/lib/wp/wp-includes/js/jquery/ui/effect-explode.min.js +0 -11
  988. data/lib/wp/wp-includes/js/jquery/ui/effect-fade.min.js +0 -11
  989. data/lib/wp/wp-includes/js/jquery/ui/effect-fold.min.js +0 -11
  990. data/lib/wp/wp-includes/js/jquery/ui/effect-highlight.min.js +0 -11
  991. data/lib/wp/wp-includes/js/jquery/ui/effect-puff.min.js +0 -11
  992. data/lib/wp/wp-includes/js/jquery/ui/effect-pulsate.min.js +0 -11
  993. data/lib/wp/wp-includes/js/jquery/ui/effect-scale.min.js +0 -11
  994. data/lib/wp/wp-includes/js/jquery/ui/effect-shake.min.js +0 -11
  995. data/lib/wp/wp-includes/js/jquery/ui/effect-size.min.js +0 -11
  996. data/lib/wp/wp-includes/js/jquery/ui/effect-slide.min.js +0 -11
  997. data/lib/wp/wp-includes/js/jquery/ui/effect-transfer.min.js +0 -11
  998. data/lib/wp/wp-includes/js/jquery/ui/effect.min.js +0 -21
  999. data/lib/wp/wp-includes/js/jquery/ui/menu.min.js +0 -11
  1000. data/lib/wp/wp-includes/js/jquery/ui/mouse.min.js +0 -11
  1001. data/lib/wp/wp-includes/js/jquery/ui/position.min.js +0 -11
  1002. data/lib/wp/wp-includes/js/jquery/ui/progressbar.min.js +0 -11
  1003. data/lib/wp/wp-includes/js/jquery/ui/resizable.min.js +0 -11
  1004. data/lib/wp/wp-includes/js/jquery/ui/selectable.min.js +0 -11
  1005. data/lib/wp/wp-includes/js/jquery/ui/selectmenu.min.js +0 -11
  1006. data/lib/wp/wp-includes/js/jquery/ui/slider.min.js +0 -11
  1007. data/lib/wp/wp-includes/js/jquery/ui/sortable.min.js +0 -11
  1008. data/lib/wp/wp-includes/js/jquery/ui/spinner.min.js +0 -11
  1009. data/lib/wp/wp-includes/js/jquery/ui/tabs.min.js +0 -11
  1010. data/lib/wp/wp-includes/js/jquery/ui/tooltip.min.js +0 -11
  1011. data/lib/wp/wp-includes/js/jquery/ui/widget.min.js +0 -11
  1012. data/lib/wp/wp-includes/js/json2.js +0 -480
  1013. data/lib/wp/wp-includes/js/json2.min.js +0 -1
  1014. data/lib/wp/wp-includes/js/masonry.min.js +0 -1
  1015. data/lib/wp/wp-includes/js/mce-view.js +0 -829
  1016. data/lib/wp/wp-includes/js/mce-view.min.js +0 -1
  1017. data/lib/wp/wp-includes/js/media-audiovideo.js +0 -831
  1018. data/lib/wp/wp-includes/js/media-audiovideo.min.js +0 -1
  1019. data/lib/wp/wp-includes/js/media-editor.js +0 -1114
  1020. data/lib/wp/wp-includes/js/media-editor.min.js +0 -1
  1021. data/lib/wp/wp-includes/js/media-grid.js +0 -732
  1022. data/lib/wp/wp-includes/js/media-grid.min.js +0 -1
  1023. data/lib/wp/wp-includes/js/media-models.js +0 -1362
  1024. data/lib/wp/wp-includes/js/media-models.min.js +0 -1
  1025. data/lib/wp/wp-includes/js/media-views.js +0 -7484
  1026. data/lib/wp/wp-includes/js/media-views.min.js +0 -3
  1027. data/lib/wp/wp-includes/js/mediaelement/background.png +0 -0
  1028. data/lib/wp/wp-includes/js/mediaelement/bigplay.png +0 -0
  1029. data/lib/wp/wp-includes/js/mediaelement/bigplay.svg +0 -1
  1030. data/lib/wp/wp-includes/js/mediaelement/controls.png +0 -0
  1031. data/lib/wp/wp-includes/js/mediaelement/controls.svg +0 -1
  1032. data/lib/wp/wp-includes/js/mediaelement/flashmediaelement.swf +0 -0
  1033. data/lib/wp/wp-includes/js/mediaelement/loading.gif +0 -0
  1034. data/lib/wp/wp-includes/js/mediaelement/mediaelement-and-player.min.js +0 -181
  1035. data/lib/wp/wp-includes/js/mediaelement/mediaelementplayer.min.css +0 -1
  1036. data/lib/wp/wp-includes/js/mediaelement/silverlightmediaelement.xap +0 -0
  1037. data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.css +0 -274
  1038. data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.js +0 -34
  1039. data/lib/wp/wp-includes/js/mediaelement/wp-playlist.js +0 -175
  1040. data/lib/wp/wp-includes/js/plupload/handlers.js +0 -488
  1041. data/lib/wp/wp-includes/js/plupload/handlers.min.js +0 -1
  1042. data/lib/wp/wp-includes/js/plupload/license.txt +0 -339
  1043. data/lib/wp/wp-includes/js/plupload/plupload.flash.swf +0 -0
  1044. data/lib/wp/wp-includes/js/plupload/plupload.full.min.js +0 -28
  1045. data/lib/wp/wp-includes/js/plupload/plupload.silverlight.xap +0 -0
  1046. data/lib/wp/wp-includes/js/plupload/wp-plupload.js +0 -376
  1047. data/lib/wp/wp-includes/js/plupload/wp-plupload.min.js +0 -1
  1048. data/lib/wp/wp-includes/js/quicktags.js +0 -652
  1049. data/lib/wp/wp-includes/js/quicktags.min.js +0 -1
  1050. data/lib/wp/wp-includes/js/shortcode.js +0 -356
  1051. data/lib/wp/wp-includes/js/shortcode.min.js +0 -1
  1052. data/lib/wp/wp-includes/js/swfobject.js +0 -4
  1053. data/lib/wp/wp-includes/js/swfupload/handlers.js +0 -376
  1054. data/lib/wp/wp-includes/js/swfupload/handlers.min.js +0 -1
  1055. data/lib/wp/wp-includes/js/swfupload/license.txt +0 -32
  1056. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js +0 -53
  1057. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.queue.js +0 -98
  1058. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.speed.js +0 -342
  1059. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.swfobject.js +0 -105
  1060. data/lib/wp/wp-includes/js/swfupload/swfupload.js +0 -980
  1061. data/lib/wp/wp-includes/js/swfupload/swfupload.swf +0 -0
  1062. data/lib/wp/wp-includes/js/thickbox/loadingAnimation.gif +0 -0
  1063. data/lib/wp/wp-includes/js/thickbox/macFFBgHack.png +0 -0
  1064. data/lib/wp/wp-includes/js/thickbox/thickbox.css +0 -138
  1065. data/lib/wp/wp-includes/js/thickbox/thickbox.js +0 -314
  1066. data/lib/wp/wp-includes/js/tinymce/langs/wp-langs-en.js +0 -519
  1067. data/lib/wp/wp-includes/js/tinymce/license.txt +0 -504
  1068. data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.js +0 -370
  1069. data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.min.js +0 -1
  1070. data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.js +0 -112
  1071. data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js +0 -1
  1072. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css +0 -212
  1073. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.js +0 -304
  1074. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js +0 -1
  1075. data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.js +0 -64
  1076. data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.min.js +0 -1
  1077. data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.js +0 -136
  1078. data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js +0 -1
  1079. data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.js +0 -30
  1080. data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.min.js +0 -1
  1081. data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.js +0 -450
  1082. data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.min.js +0 -1
  1083. data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.js +0 -786
  1084. data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.min.js +0 -1
  1085. data/lib/wp/wp-includes/js/tinymce/plugins/media/moxieplayer.swf +0 -0
  1086. data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.js +0 -774
  1087. data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.min.js +0 -1
  1088. data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.js +0 -1553
  1089. data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.min.js +0 -1
  1090. data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.js +0 -125
  1091. data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js +0 -1
  1092. data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.js +0 -272
  1093. data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js +0 -1
  1094. data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.js +0 -513
  1095. data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +0 -1
  1096. data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +0 -207
  1097. data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js +0 -1
  1098. data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js +0 -92
  1099. data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.min.js +0 -1
  1100. data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +0 -1035
  1101. data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +0 -1
  1102. data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js +0 -78
  1103. data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.min.js +0 -1
  1104. data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.js +0 -130
  1105. data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.min.js +0 -1
  1106. data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.js +0 -63
  1107. data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.min.js +0 -1
  1108. data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.js +0 -694
  1109. data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.min.js +0 -1
  1110. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css +0 -1
  1111. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.min.css +0 -1
  1112. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md +0 -1
  1113. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
  1114. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +0 -62
  1115. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  1116. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
  1117. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  1118. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg +0 -63
  1119. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  1120. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  1121. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
  1122. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/loader.gif +0 -0
  1123. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/object.gif +0 -0
  1124. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/trans.gif +0 -0
  1125. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css +0 -1
  1126. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.min.css +0 -1
  1127. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/audio.png +0 -0
  1128. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png +0 -0
  1129. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png +0 -0
  1130. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/embedded.png +0 -0
  1131. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png +0 -0
  1132. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery.png +0 -0
  1133. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more-2x.png +0 -0
  1134. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more.png +0 -0
  1135. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak-2x.png +0 -0
  1136. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak.png +0 -0
  1137. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-audio.png +0 -0
  1138. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-video.png +0 -0
  1139. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/video.png +0 -0
  1140. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/wp-content.css +0 -618
  1141. data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.js +0 -617
  1142. data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.min.js +0 -1
  1143. data/lib/wp/wp-includes/js/tinymce/tiny_mce_popup.js +0 -539
  1144. data/lib/wp/wp-includes/js/tinymce/tinymce.min.js +0 -11
  1145. data/lib/wp/wp-includes/js/tinymce/utils/editable_selects.js +0 -70
  1146. data/lib/wp/wp-includes/js/tinymce/utils/form_utils.js +0 -210
  1147. data/lib/wp/wp-includes/js/tinymce/utils/mctabs.js +0 -164
  1148. data/lib/wp/wp-includes/js/tinymce/utils/validate.js +0 -252
  1149. data/lib/wp/wp-includes/js/tinymce/wp-mce-help.php +0 -145
  1150. data/lib/wp/wp-includes/js/tinymce/wp-tinymce.js.gz +0 -0
  1151. data/lib/wp/wp-includes/js/tinymce/wp-tinymce.php +0 -39
  1152. data/lib/wp/wp-includes/js/tw-sack.js +0 -193
  1153. data/lib/wp/wp-includes/js/tw-sack.min.js +0 -1
  1154. data/lib/wp/wp-includes/js/underscore.min.js +0 -1
  1155. data/lib/wp/wp-includes/js/utils.js +0 -197
  1156. data/lib/wp/wp-includes/js/utils.min.js +0 -1
  1157. data/lib/wp/wp-includes/js/wp-ajax-response.js +0 -64
  1158. data/lib/wp/wp-includes/js/wp-ajax-response.min.js +0 -1
  1159. data/lib/wp/wp-includes/js/wp-auth-check.js +0 -112
  1160. data/lib/wp/wp-includes/js/wp-auth-check.min.js +0 -1
  1161. data/lib/wp/wp-includes/js/wp-backbone.js +0 -386
  1162. data/lib/wp/wp-includes/js/wp-backbone.min.js +0 -1
  1163. data/lib/wp/wp-includes/js/wp-list-revisions.js +0 -24
  1164. data/lib/wp/wp-includes/js/wp-list-revisions.min.js +0 -1
  1165. data/lib/wp/wp-includes/js/wp-lists.js +0 -469
  1166. data/lib/wp/wp-includes/js/wp-lists.min.js +0 -1
  1167. data/lib/wp/wp-includes/js/wp-pointer.js +0 -282
  1168. data/lib/wp/wp-includes/js/wp-pointer.min.js +0 -1
  1169. data/lib/wp/wp-includes/js/wp-util.js +0 -106
  1170. data/lib/wp/wp-includes/js/wp-util.min.js +0 -1
  1171. data/lib/wp/wp-includes/js/wpdialog.js +0 -19
  1172. data/lib/wp/wp-includes/js/wpdialog.min.js +0 -1
  1173. data/lib/wp/wp-includes/js/wplink.js +0 -615
  1174. data/lib/wp/wp-includes/js/wplink.min.js +0 -1
  1175. data/lib/wp/wp-includes/js/zxcvbn-async.js +0 -18
  1176. data/lib/wp/wp-includes/js/zxcvbn-async.min.js +0 -1
  1177. data/lib/wp/wp-includes/js/zxcvbn.min.js +0 -47
  1178. data/lib/wp/wp-includes/kses.php +0 -1526
  1179. data/lib/wp/wp-includes/l10n.php +0 -908
  1180. data/lib/wp/wp-includes/link-template.php +0 -3141
  1181. data/lib/wp/wp-includes/load.php +0 -828
  1182. data/lib/wp/wp-includes/locale.php +0 -368
  1183. data/lib/wp/wp-includes/media-template.php +0 -1235
  1184. data/lib/wp/wp-includes/media.php +0 -3329
  1185. data/lib/wp/wp-includes/meta.php +0 -1221
  1186. data/lib/wp/wp-includes/ms-blogs.php +0 -939
  1187. data/lib/wp/wp-includes/ms-default-constants.php +0 -153
  1188. data/lib/wp/wp-includes/ms-default-filters.php +0 -82
  1189. data/lib/wp/wp-includes/ms-deprecated.php +0 -347
  1190. data/lib/wp/wp-includes/ms-files.php +0 -82
  1191. data/lib/wp/wp-includes/ms-functions.php +0 -2476
  1192. data/lib/wp/wp-includes/ms-load.php +0 -458
  1193. data/lib/wp/wp-includes/ms-settings.php +0 -213
  1194. data/lib/wp/wp-includes/nav-menu-template.php +0 -678
  1195. data/lib/wp/wp-includes/nav-menu.php +0 -895
  1196. data/lib/wp/wp-includes/option.php +0 -1440
  1197. data/lib/wp/wp-includes/pluggable-deprecated.php +0 -192
  1198. data/lib/wp/wp-includes/pluggable.php +0 -2283
  1199. data/lib/wp/wp-includes/plugin.php +0 -920
  1200. data/lib/wp/wp-includes/pomo/entry.php +0 -78
  1201. data/lib/wp/wp-includes/pomo/mo.php +0 -262
  1202. data/lib/wp/wp-includes/pomo/po.php +0 -384
  1203. data/lib/wp/wp-includes/pomo/streams.php +0 -209
  1204. data/lib/wp/wp-includes/pomo/translations.php +0 -275
  1205. data/lib/wp/wp-includes/post-formats.php +0 -243
  1206. data/lib/wp/wp-includes/post-template.php +0 -1766
  1207. data/lib/wp/wp-includes/post-thumbnail-template.php +0 -142
  1208. data/lib/wp/wp-includes/post.php +0 -5842
  1209. data/lib/wp/wp-includes/query.php +0 -4666
  1210. data/lib/wp/wp-includes/registration-functions.php +0 -7
  1211. data/lib/wp/wp-includes/registration.php +0 -7
  1212. data/lib/wp/wp-includes/revision.php +0 -657
  1213. data/lib/wp/wp-includes/rewrite.php +0 -2180
  1214. data/lib/wp/wp-includes/rss-functions.php +0 -9
  1215. data/lib/wp/wp-includes/rss.php +0 -936
  1216. data/lib/wp/wp-includes/script-loader.php +0 -1045
  1217. data/lib/wp/wp-includes/session.php +0 -430
  1218. data/lib/wp/wp-includes/shortcodes.php +0 -410
  1219. data/lib/wp/wp-includes/taxonomy.php +0 -4006
  1220. data/lib/wp/wp-includes/template-loader.php +0 -76
  1221. data/lib/wp/wp-includes/template.php +0 -505
  1222. data/lib/wp/wp-includes/theme-compat/comments-popup.php +0 -128
  1223. data/lib/wp/wp-includes/theme-compat/comments.php +0 -101
  1224. data/lib/wp/wp-includes/theme-compat/footer.php +0 -30
  1225. data/lib/wp/wp-includes/theme-compat/header.php +0 -49
  1226. data/lib/wp/wp-includes/theme-compat/sidebar.php +0 -83
  1227. data/lib/wp/wp-includes/theme.php +0 -2014
  1228. data/lib/wp/wp-includes/update.php +0 -674
  1229. data/lib/wp/wp-includes/user.php +0 -2292
  1230. data/lib/wp/wp-includes/vars.php +0 -144
  1231. data/lib/wp/wp-includes/version.php +0 -35
  1232. data/lib/wp/wp-includes/widgets.php +0 -1514
  1233. data/lib/wp/wp-includes/wlwmanifest.xml +0 -43
  1234. data/lib/wp/wp-includes/wp-db.php +0 -2190
  1235. data/lib/wp/wp-includes/wp-diff.php +0 -523
  1236. data/lib/wp/wp-links-opml.php +0 -80
  1237. data/lib/wp/wp-load.php +0 -73
  1238. data/lib/wp/wp-login.php +0 -952
  1239. data/lib/wp/wp-mail.php +0 -260
  1240. data/lib/wp/wp-settings.php +0 -374
  1241. data/lib/wp/wp-signup.php +0 -749
  1242. data/lib/wp/wp-trackback.php +0 -127
  1243. data/lib/wp/xmlrpc.php +0 -101
@@ -1,3329 +0,0 @@
1
- <?php
2
- /**
3
- * WordPress API for media display.
4
- *
5
- * @package WordPress
6
- * @subpackage Media
7
- */
8
-
9
- /**
10
- * Scale down the default size of an image.
11
- *
12
- * This is so that the image is a better fit for the editor and theme.
13
- *
14
- * The $size parameter accepts either an array or a string. The supported string
15
- * values are 'thumb' or 'thumbnail' for the given thumbnail size or defaults at
16
- * 128 width and 96 height in pixels. Also supported for the string value is
17
- * 'medium' and 'full'. The 'full' isn't actually supported, but any value other
18
- * than the supported will result in the content_width size or 500 if that is
19
- * not set.
20
- *
21
- * Finally, there is a filter named 'editor_max_image_size', that will be called
22
- * on the calculated array for width and height, respectively. The second
23
- * parameter will be the value that was in the $size parameter. The returned
24
- * type for the hook is an array with the width as the first element and the
25
- * height as the second element.
26
- *
27
- * @since 2.5.0
28
- * @uses wp_constrain_dimensions() This function passes the widths and the heights.
29
- *
30
- * @param int $width Width of the image
31
- * @param int $height Height of the image
32
- * @param string|array $size Size of what the result image should be.
33
- * @param context Could be 'display' (like in a theme) or 'edit' (like inserting into an editor)
34
- * @return array Width and height of what the result image should resize to.
35
- */
36
- function image_constrain_size_for_editor($width, $height, $size = 'medium', $context = null ) {
37
- global $content_width, $_wp_additional_image_sizes;
38
-
39
- if ( ! $context )
40
- $context = is_admin() ? 'edit' : 'display';
41
-
42
- if ( is_array($size) ) {
43
- $max_width = $size[0];
44
- $max_height = $size[1];
45
- }
46
- elseif ( $size == 'thumb' || $size == 'thumbnail' ) {
47
- $max_width = intval(get_option('thumbnail_size_w'));
48
- $max_height = intval(get_option('thumbnail_size_h'));
49
- // last chance thumbnail size defaults
50
- if ( !$max_width && !$max_height ) {
51
- $max_width = 128;
52
- $max_height = 96;
53
- }
54
- }
55
- elseif ( $size == 'medium' ) {
56
- $max_width = intval(get_option('medium_size_w'));
57
- $max_height = intval(get_option('medium_size_h'));
58
- // if no width is set, default to the theme content width if available
59
- }
60
- elseif ( $size == 'large' ) {
61
- // We're inserting a large size image into the editor. If it's a really
62
- // big image we'll scale it down to fit reasonably within the editor
63
- // itself, and within the theme's content width if it's known. The user
64
- // can resize it in the editor if they wish.
65
- $max_width = intval(get_option('large_size_w'));
66
- $max_height = intval(get_option('large_size_h'));
67
- if ( intval($content_width) > 0 )
68
- $max_width = min( intval($content_width), $max_width );
69
- } elseif ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) {
70
- $max_width = intval( $_wp_additional_image_sizes[$size]['width'] );
71
- $max_height = intval( $_wp_additional_image_sizes[$size]['height'] );
72
- if ( intval($content_width) > 0 && 'edit' == $context ) // Only in admin. Assume that theme authors know what they're doing.
73
- $max_width = min( intval($content_width), $max_width );
74
- }
75
- // $size == 'full' has no constraint
76
- else {
77
- $max_width = $width;
78
- $max_height = $height;
79
- }
80
-
81
- /**
82
- * Filter the maximum image size dimensions for the editor.
83
- *
84
- * @since 2.5.0
85
- *
86
- * @param array $max_image_size An array with the width as the first element,
87
- * and the height as the second element.
88
- * @param string|array $size Size of what the result image should be.
89
- * @param string $context The context the image is being resized for.
90
- * Possible values are 'display' (like in a theme)
91
- * or 'edit' (like inserting into an editor).
92
- */
93
- list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size, $context );
94
-
95
- return wp_constrain_dimensions( $width, $height, $max_width, $max_height );
96
- }
97
-
98
- /**
99
- * Retrieve width and height attributes using given width and height values.
100
- *
101
- * Both attributes are required in the sense that both parameters must have a
102
- * value, but are optional in that if you set them to false or null, then they
103
- * will not be added to the returned string.
104
- *
105
- * You can set the value using a string, but it will only take numeric values.
106
- * If you wish to put 'px' after the numbers, then it will be stripped out of
107
- * the return.
108
- *
109
- * @since 2.5.0
110
- *
111
- * @param int|string $width Optional. Width attribute value.
112
- * @param int|string $height Optional. Height attribute value.
113
- * @return string HTML attributes for width and, or height.
114
- */
115
- function image_hwstring($width, $height) {
116
- $out = '';
117
- if ($width)
118
- $out .= 'width="'.intval($width).'" ';
119
- if ($height)
120
- $out .= 'height="'.intval($height).'" ';
121
- return $out;
122
- }
123
-
124
- /**
125
- * Scale an image to fit a particular size (such as 'thumb' or 'medium').
126
- *
127
- * Array with image url, width, height, and whether is intermediate size, in
128
- * that order is returned on success is returned. $is_intermediate is true if
129
- * $url is a resized image, false if it is the original.
130
- *
131
- * The URL might be the original image, or it might be a resized version. This
132
- * function won't create a new resized copy, it will just return an already
133
- * resized one if it exists.
134
- *
135
- * A plugin may use the 'image_downsize' filter to hook into and offer image
136
- * resizing services for images. The hook must return an array with the same
137
- * elements that are returned in the function. The first element being the URL
138
- * to the new image that was resized.
139
- *
140
- * @since 2.5.0
141
- *
142
- * @param int $id Attachment ID for image.
143
- * @param array|string $size Optional, default is 'medium'. Size of image, either array or string.
144
- * @return bool|array False on failure, array on success.
145
- */
146
- function image_downsize($id, $size = 'medium') {
147
-
148
- if ( !wp_attachment_is_image($id) )
149
- return false;
150
-
151
- /**
152
- * Filter whether to preempt the output of image_downsize().
153
- *
154
- * Passing a truthy value to the filter will effectively short-circuit
155
- * down-sizing the image, returning that value as output instead.
156
- *
157
- * @since 2.5.0
158
- *
159
- * @param bool $downsize Whether to short-circuit the image downsize. Default false.
160
- * @param int $id Attachment ID for image.
161
- * @param array|string $size Size of image, either array or string. Default 'medium'.
162
- */
163
- if ( $out = apply_filters( 'image_downsize', false, $id, $size ) ) {
164
- return $out;
165
- }
166
-
167
- $img_url = wp_get_attachment_url($id);
168
- $meta = wp_get_attachment_metadata($id);
169
- $width = $height = 0;
170
- $is_intermediate = false;
171
- $img_url_basename = wp_basename($img_url);
172
-
173
- // try for a new style intermediate size
174
- if ( $intermediate = image_get_intermediate_size($id, $size) ) {
175
- $img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);
176
- $width = $intermediate['width'];
177
- $height = $intermediate['height'];
178
- $is_intermediate = true;
179
- }
180
- elseif ( $size == 'thumbnail' ) {
181
- // fall back to the old thumbnail
182
- if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) {
183
- $img_url = str_replace($img_url_basename, wp_basename($thumb_file), $img_url);
184
- $width = $info[0];
185
- $height = $info[1];
186
- $is_intermediate = true;
187
- }
188
- }
189
- if ( !$width && !$height && isset( $meta['width'], $meta['height'] ) ) {
190
- // any other type: use the real image
191
- $width = $meta['width'];
192
- $height = $meta['height'];
193
- }
194
-
195
- if ( $img_url) {
196
- // we have the actual image size, but might need to further constrain it if content_width is narrower
197
- list( $width, $height ) = image_constrain_size_for_editor( $width, $height, $size );
198
-
199
- return array( $img_url, $width, $height, $is_intermediate );
200
- }
201
- return false;
202
-
203
- }
204
-
205
- /**
206
- * Register a new image size.
207
- *
208
- * Cropping behavior for the image size is dependent on the value of $crop:
209
- * 1. If false (default), images will be scaled, not cropped.
210
- * 2. If an array in the form of array( x_crop_position, y_crop_position ):
211
- * - x_crop_position accepts 'left' 'center', or 'right'.
212
- * - y_crop_position accepts 'top', 'center', or 'bottom'.
213
- * Images will be cropped to the specified dimensions within the defined crop area.
214
- * 3. If true, images will be cropped to the specified dimensions using center positions.
215
- *
216
- * @since 2.9.0
217
- *
218
- * @param string $name Image size identifier.
219
- * @param int $width Image width in pixels.
220
- * @param int $height Image height in pixels.
221
- * @param bool|array $crop Optional. Whether to crop images to specified height and width or resize.
222
- * An array can specify positioning of the crop area. Default false.
223
- * @return bool|array False, if no image was created. Metadata array on success.
224
- */
225
- function add_image_size( $name, $width = 0, $height = 0, $crop = false ) {
226
- global $_wp_additional_image_sizes;
227
-
228
- $_wp_additional_image_sizes[ $name ] = array(
229
- 'width' => absint( $width ),
230
- 'height' => absint( $height ),
231
- 'crop' => $crop,
232
- );
233
- }
234
-
235
- /**
236
- * Check if an image size exists.
237
- *
238
- * @since 3.9.0
239
- *
240
- * @param string $name The image size to check.
241
- * @return bool True if the image size exists, false if not.
242
- */
243
- function has_image_size( $name ) {
244
- global $_wp_additional_image_sizes;
245
-
246
- return isset( $_wp_additional_image_sizes[ $name ] );
247
- }
248
-
249
- /**
250
- * Remove a new image size.
251
- *
252
- * @since 3.9.0
253
- *
254
- * @param string $name The image size to remove.
255
- * @return bool True if the image size was successfully removed, false on failure.
256
- */
257
- function remove_image_size( $name ) {
258
- global $_wp_additional_image_sizes;
259
-
260
- if ( isset( $_wp_additional_image_sizes[ $name ] ) ) {
261
- unset( $_wp_additional_image_sizes[ $name ] );
262
- return true;
263
- }
264
-
265
- return false;
266
- }
267
-
268
- /**
269
- * Registers an image size for the post thumbnail.
270
- *
271
- * @since 2.9.0
272
- * @see add_image_size() for details on cropping behavior.
273
- *
274
- * @param int $width Image width in pixels.
275
- * @param int $height Image height in pixels.
276
- * @param bool|array $crop Optional. Whether to crop images to specified height and width or resize.
277
- * An array can specify positioning of the crop area. Default false.
278
- * @return bool|array False, if no image was created. Metadata array on success.
279
- */
280
- function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) {
281
- add_image_size( 'post-thumbnail', $width, $height, $crop );
282
- }
283
-
284
- /**
285
- * An <img src /> tag for an image attachment, scaling it down if requested.
286
- *
287
- * The filter 'get_image_tag_class' allows for changing the class name for the
288
- * image without having to use regular expressions on the HTML content. The
289
- * parameters are: what WordPress will use for the class, the Attachment ID,
290
- * image align value, and the size the image should be.
291
- *
292
- * The second filter 'get_image_tag' has the HTML content, which can then be
293
- * further manipulated by a plugin to change all attribute values and even HTML
294
- * content.
295
- *
296
- * @since 2.5.0
297
- *
298
- * @param int $id Attachment ID.
299
- * @param string $alt Image Description for the alt attribute.
300
- * @param string $title Image Description for the title attribute.
301
- * @param string $align Part of the class name for aligning the image.
302
- * @param string $size Optional. Default is 'medium'.
303
- * @return string HTML IMG element for given image attachment
304
- */
305
- function get_image_tag($id, $alt, $title, $align, $size='medium') {
306
-
307
- list( $img_src, $width, $height ) = image_downsize($id, $size);
308
- $hwstring = image_hwstring($width, $height);
309
-
310
- $title = $title ? 'title="' . esc_attr( $title ) . '" ' : '';
311
-
312
- $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
313
-
314
- /**
315
- * Filter the value of the attachment's image tag class attribute.
316
- *
317
- * @since 2.6.0
318
- *
319
- * @param string $class CSS class name or space-separated list of classes.
320
- * @param int $id Attachment ID.
321
- * @param string $align Part of the class name for aligning the image.
322
- * @param string $size Optional. Default is 'medium'.
323
- */
324
- $class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );
325
-
326
- $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
327
-
328
- /**
329
- * Filter the HTML content for the image tag.
330
- *
331
- * @since 2.6.0
332
- *
333
- * @param string $html HTML content for the image.
334
- * @param int $id Attachment ID.
335
- * @param string $alt Alternate text.
336
- * @param string $title Attachment title.
337
- * @param string $align Part of the class name for aligning the image.
338
- * @param string $size Optional. Default is 'medium'.
339
- */
340
- $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
341
-
342
- return $html;
343
- }
344
-
345
- /**
346
- * Calculates the new dimensions for a downsampled image.
347
- *
348
- * If either width or height are empty, no constraint is applied on
349
- * that dimension.
350
- *
351
- * @since 2.5.0
352
- *
353
- * @param int $current_width Current width of the image.
354
- * @param int $current_height Current height of the image.
355
- * @param int $max_width Optional. Maximum wanted width.
356
- * @param int $max_height Optional. Maximum wanted height.
357
- * @return array First item is the width, the second item is the height.
358
- */
359
- function wp_constrain_dimensions( $current_width, $current_height, $max_width=0, $max_height=0 ) {
360
- if ( !$max_width and !$max_height )
361
- return array( $current_width, $current_height );
362
-
363
- $width_ratio = $height_ratio = 1.0;
364
- $did_width = $did_height = false;
365
-
366
- if ( $max_width > 0 && $current_width > 0 && $current_width > $max_width ) {
367
- $width_ratio = $max_width / $current_width;
368
- $did_width = true;
369
- }
370
-
371
- if ( $max_height > 0 && $current_height > 0 && $current_height > $max_height ) {
372
- $height_ratio = $max_height / $current_height;
373
- $did_height = true;
374
- }
375
-
376
- // Calculate the larger/smaller ratios
377
- $smaller_ratio = min( $width_ratio, $height_ratio );
378
- $larger_ratio = max( $width_ratio, $height_ratio );
379
-
380
- if ( intval( $current_width * $larger_ratio ) > $max_width || intval( $current_height * $larger_ratio ) > $max_height )
381
- // The larger ratio is too big. It would result in an overflow.
382
- $ratio = $smaller_ratio;
383
- else
384
- // The larger ratio fits, and is likely to be a more "snug" fit.
385
- $ratio = $larger_ratio;
386
-
387
- // Very small dimensions may result in 0, 1 should be the minimum.
388
- $w = max ( 1, intval( $current_width * $ratio ) );
389
- $h = max ( 1, intval( $current_height * $ratio ) );
390
-
391
- // Sometimes, due to rounding, we'll end up with a result like this: 465x700 in a 177x177 box is 117x176... a pixel short
392
- // We also have issues with recursive calls resulting in an ever-changing result. Constraining to the result of a constraint should yield the original result.
393
- // Thus we look for dimensions that are one pixel shy of the max value and bump them up
394
- if ( $did_width && $w == $max_width - 1 )
395
- $w = $max_width; // Round it up
396
- if ( $did_height && $h == $max_height - 1 )
397
- $h = $max_height; // Round it up
398
-
399
- return array( $w, $h );
400
- }
401
-
402
- /**
403
- * Retrieve calculated resize dimensions for use in WP_Image_Editor.
404
- *
405
- * Calculates dimensions and coordinates for a resized image that fits
406
- * within a specified width and height.
407
- *
408
- * Cropping behavior is dependent on the value of $crop:
409
- * 1. If false (default), images will not be cropped.
410
- * 2. If an array in the form of array( x_crop_position, y_crop_position ):
411
- * - x_crop_position accepts 'left' 'center', or 'right'.
412
- * - y_crop_position accepts 'top', 'center', or 'bottom'.
413
- * Images will be cropped to the specified dimensions within the defined crop area.
414
- * 3. If true, images will be cropped to the specified dimensions using center positions.
415
- *
416
- * @since 2.5.0
417
- *
418
- * @param int $orig_w Original width in pixels.
419
- * @param int $orig_h Original height in pixels.
420
- * @param int $dest_w New width in pixels.
421
- * @param int $dest_h New height in pixels.
422
- * @param bool|array $crop Optional. Whether to crop image to specified height and width or resize.
423
- * An array can specify positioning of the crop area. Default false.
424
- * @return bool|array False on failure. Returned array matches parameters for `imagecopyresampled()`.
425
- */
426
- function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = false) {
427
-
428
- if ($orig_w <= 0 || $orig_h <= 0)
429
- return false;
430
- // at least one of dest_w or dest_h must be specific
431
- if ($dest_w <= 0 && $dest_h <= 0)
432
- return false;
433
-
434
- /**
435
- * Filter whether to preempt calculating the image resize dimensions.
436
- *
437
- * Passing a non-null value to the filter will effectively short-circuit
438
- * image_resize_dimensions(), returning that value instead.
439
- *
440
- * @since 3.4.0
441
- *
442
- * @param null|mixed $null Whether to preempt output of the resize dimensions.
443
- * @param int $orig_w Original width in pixels.
444
- * @param int $orig_h Original height in pixels.
445
- * @param int $dest_w New width in pixels.
446
- * @param int $dest_h New height in pixels.
447
- * @param bool|array $crop Whether to crop image to specified height and width or resize.
448
- * An array can specify positioning of the crop area. Default false.
449
- */
450
- $output = apply_filters( 'image_resize_dimensions', null, $orig_w, $orig_h, $dest_w, $dest_h, $crop );
451
- if ( null !== $output )
452
- return $output;
453
-
454
- if ( $crop ) {
455
- // crop the largest possible portion of the original image that we can size to $dest_w x $dest_h
456
- $aspect_ratio = $orig_w / $orig_h;
457
- $new_w = min($dest_w, $orig_w);
458
- $new_h = min($dest_h, $orig_h);
459
-
460
- if ( !$new_w ) {
461
- $new_w = intval($new_h * $aspect_ratio);
462
- }
463
-
464
- if ( !$new_h ) {
465
- $new_h = intval($new_w / $aspect_ratio);
466
- }
467
-
468
- $size_ratio = max($new_w / $orig_w, $new_h / $orig_h);
469
-
470
- $crop_w = round($new_w / $size_ratio);
471
- $crop_h = round($new_h / $size_ratio);
472
-
473
- if ( ! is_array( $crop ) || count( $crop ) !== 2 ) {
474
- $crop = array( 'center', 'center' );
475
- }
476
-
477
- list( $x, $y ) = $crop;
478
-
479
- if ( 'left' === $x ) {
480
- $s_x = 0;
481
- } elseif ( 'right' === $x ) {
482
- $s_x = $orig_w - $crop_w;
483
- } else {
484
- $s_x = floor( ( $orig_w - $crop_w ) / 2 );
485
- }
486
-
487
- if ( 'top' === $y ) {
488
- $s_y = 0;
489
- } elseif ( 'bottom' === $y ) {
490
- $s_y = $orig_h - $crop_h;
491
- } else {
492
- $s_y = floor( ( $orig_h - $crop_h ) / 2 );
493
- }
494
- } else {
495
- // don't crop, just resize using $dest_w x $dest_h as a maximum bounding box
496
- $crop_w = $orig_w;
497
- $crop_h = $orig_h;
498
-
499
- $s_x = 0;
500
- $s_y = 0;
501
-
502
- list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );
503
- }
504
-
505
- // if the resulting image would be the same size or larger we don't want to resize it
506
- if ( $new_w >= $orig_w && $new_h >= $orig_h )
507
- return false;
508
-
509
- // the return array matches the parameters to imagecopyresampled()
510
- // int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h
511
- return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );
512
-
513
- }
514
-
515
- /**
516
- * Resize an image to make a thumbnail or intermediate size.
517
- *
518
- * The returned array has the file size, the image width, and image height. The
519
- * filter 'image_make_intermediate_size' can be used to hook in and change the
520
- * values of the returned array. The only parameter is the resized file path.
521
- *
522
- * @since 2.5.0
523
- *
524
- * @param string $file File path.
525
- * @param int $width Image width.
526
- * @param int $height Image height.
527
- * @param bool $crop Optional, default is false. Whether to crop image to specified height and width or resize.
528
- * @return bool|array False, if no image was created. Metadata array on success.
529
- */
530
- function image_make_intermediate_size( $file, $width, $height, $crop = false ) {
531
- if ( $width || $height ) {
532
- $editor = wp_get_image_editor( $file );
533
-
534
- if ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $width, $height, $crop ) ) )
535
- return false;
536
-
537
- $resized_file = $editor->save();
538
-
539
- if ( ! is_wp_error( $resized_file ) && $resized_file ) {
540
- unset( $resized_file['path'] );
541
- return $resized_file;
542
- }
543
- }
544
- return false;
545
- }
546
-
547
- /**
548
- * Retrieve the image's intermediate size (resized) path, width, and height.
549
- *
550
- * The $size parameter can be an array with the width and height respectively.
551
- * If the size matches the 'sizes' metadata array for width and height, then it
552
- * will be used. If there is no direct match, then the nearest image size larger
553
- * than the specified size will be used. If nothing is found, then the function
554
- * will break out and return false.
555
- *
556
- * The metadata 'sizes' is used for compatible sizes that can be used for the
557
- * parameter $size value.
558
- *
559
- * The url path will be given, when the $size parameter is a string.
560
- *
561
- * If you are passing an array for the $size, you should consider using
562
- * add_image_size() so that a cropped version is generated. It's much more
563
- * efficient than having to find the closest-sized image and then having the
564
- * browser scale down the image.
565
- *
566
- * @since 2.5.0
567
- * @see add_image_size()
568
- *
569
- * @param int $post_id Attachment ID for image.
570
- * @param array|string $size Optional, default is 'thumbnail'. Size of image, either array or string.
571
- * @return bool|array False on failure or array of file path, width, and height on success.
572
- */
573
- function image_get_intermediate_size($post_id, $size='thumbnail') {
574
- if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) )
575
- return false;
576
-
577
- // get the best one for a specified set of dimensions
578
- if ( is_array($size) && !empty($imagedata['sizes']) ) {
579
- foreach ( $imagedata['sizes'] as $_size => $data ) {
580
- // already cropped to width or height; so use this size
581
- if ( ( $data['width'] == $size[0] && $data['height'] <= $size[1] ) || ( $data['height'] == $size[1] && $data['width'] <= $size[0] ) ) {
582
- $file = $data['file'];
583
- list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size );
584
- return compact( 'file', 'width', 'height' );
585
- }
586
- // add to lookup table: area => size
587
- $areas[$data['width'] * $data['height']] = $_size;
588
- }
589
- if ( !$size || !empty($areas) ) {
590
- // find for the smallest image not smaller than the desired size
591
- ksort($areas);
592
- foreach ( $areas as $_size ) {
593
- $data = $imagedata['sizes'][$_size];
594
- if ( $data['width'] >= $size[0] || $data['height'] >= $size[1] ) {
595
- // Skip images with unexpectedly divergent aspect ratios (crops)
596
- // First, we calculate what size the original image would be if constrained to a box the size of the current image in the loop
597
- $maybe_cropped = image_resize_dimensions($imagedata['width'], $imagedata['height'], $data['width'], $data['height'], false );
598
- // If the size doesn't match within one pixel, then it is of a different aspect ratio, so we skip it, unless it's the thumbnail size
599
- if ( 'thumbnail' != $_size && ( !$maybe_cropped || ( $maybe_cropped[4] != $data['width'] && $maybe_cropped[4] + 1 != $data['width'] ) || ( $maybe_cropped[5] != $data['height'] && $maybe_cropped[5] + 1 != $data['height'] ) ) )
600
- continue;
601
- // If we're still here, then we're going to use this size
602
- $file = $data['file'];
603
- list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size );
604
- return compact( 'file', 'width', 'height' );
605
- }
606
- }
607
- }
608
- }
609
-
610
- if ( is_array($size) || empty($size) || empty($imagedata['sizes'][$size]) )
611
- return false;
612
-
613
- $data = $imagedata['sizes'][$size];
614
- // include the full filesystem path of the intermediate file
615
- if ( empty($data['path']) && !empty($data['file']) ) {
616
- $file_url = wp_get_attachment_url($post_id);
617
- $data['path'] = path_join( dirname($imagedata['file']), $data['file'] );
618
- $data['url'] = path_join( dirname($file_url), $data['file'] );
619
- }
620
- return $data;
621
- }
622
-
623
- /**
624
- * Get the available image sizes
625
- * @since 3.0.0
626
- * @return array Returns a filtered array of image size strings
627
- */
628
- function get_intermediate_image_sizes() {
629
- global $_wp_additional_image_sizes;
630
- $image_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes
631
- if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )
632
- $image_sizes = array_merge( $image_sizes, array_keys( $_wp_additional_image_sizes ) );
633
-
634
- /**
635
- * Filter the list of intermediate image sizes.
636
- *
637
- * @since 2.5.0
638
- *
639
- * @param array $image_sizes An array of intermediate image sizes. Defaults
640
- * are 'thumbnail', 'medium', 'large'.
641
- */
642
- return apply_filters( 'intermediate_image_sizes', $image_sizes );
643
- }
644
-
645
- /**
646
- * Retrieve an image to represent an attachment.
647
- *
648
- * A mime icon for files, thumbnail or intermediate size for images.
649
- *
650
- * @since 2.5.0
651
- *
652
- * @param int $attachment_id Image attachment ID.
653
- * @param string $size Optional, default is 'thumbnail'.
654
- * @param bool $icon Optional, default is false. Whether it is an icon.
655
- * @return bool|array Returns an array (url, width, height), or false, if no image is available.
656
- */
657
- function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) {
658
-
659
- // get a thumbnail or intermediate image if there is one
660
- if ( $image = image_downsize($attachment_id, $size) )
661
- return $image;
662
-
663
- $src = false;
664
-
665
- if ( $icon && $src = wp_mime_type_icon($attachment_id) ) {
666
- /** This filter is documented in wp-includes/post.php */
667
- $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );
668
- $src_file = $icon_dir . '/' . wp_basename($src);
669
- @list($width, $height) = getimagesize($src_file);
670
- }
671
- if ( $src && $width && $height )
672
- return array( $src, $width, $height );
673
- return false;
674
- }
675
-
676
- /**
677
- * Get an HTML img element representing an image attachment
678
- *
679
- * While $size will accept an array, it is better to register a size with
680
- * add_image_size() so that a cropped version is generated. It's much more
681
- * efficient than having to find the closest-sized image and then having the
682
- * browser scale down the image.
683
- *
684
- * @since 2.5.0
685
- *
686
- * @see add_image_size()
687
- * @uses wp_get_attachment_image_src() Gets attachment file URL and dimensions
688
- *
689
- * @param int $attachment_id Image attachment ID.
690
- * @param string|array $size Optional. Default 'thumbnail'.
691
- * @param bool $icon Optional. Whether it is an icon. Default false.
692
- * @param string|array $attr Optional. Attributes for the image markup. Default empty string.
693
- * @return string HTML img element or empty string on failure.
694
- */
695
- function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $attr = '') {
696
-
697
- $html = '';
698
- $image = wp_get_attachment_image_src($attachment_id, $size, $icon);
699
- if ( $image ) {
700
- list($src, $width, $height) = $image;
701
- $hwstring = image_hwstring($width, $height);
702
- $size_class = $size;
703
- if ( is_array( $size_class ) ) {
704
- $size_class = join( 'x', $size_class );
705
- }
706
- $attachment = get_post($attachment_id);
707
- $default_attr = array(
708
- 'src' => $src,
709
- 'class' => "attachment-$size_class",
710
- 'alt' => trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first
711
- );
712
- if ( empty($default_attr['alt']) )
713
- $default_attr['alt'] = trim(strip_tags( $attachment->post_excerpt )); // If not, Use the Caption
714
- if ( empty($default_attr['alt']) )
715
- $default_attr['alt'] = trim(strip_tags( $attachment->post_title )); // Finally, use the title
716
-
717
- $attr = wp_parse_args($attr, $default_attr);
718
-
719
- /**
720
- * Filter the list of attachment image attributes.
721
- *
722
- * @since 2.8.0
723
- *
724
- * @param array $attr Attributes for the image markup.
725
- * @param WP_Post $attachment Image attachment post.
726
- * @param string|array $size Requested size.
727
- */
728
- $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size );
729
- $attr = array_map( 'esc_attr', $attr );
730
- $html = rtrim("<img $hwstring");
731
- foreach ( $attr as $name => $value ) {
732
- $html .= " $name=" . '"' . $value . '"';
733
- }
734
- $html .= ' />';
735
- }
736
-
737
- return $html;
738
- }
739
-
740
- /**
741
- * Adds a 'wp-post-image' class to post thumbnails
742
- * Uses the begin_fetch_post_thumbnail_html and end_fetch_post_thumbnail_html action hooks to
743
- * dynamically add/remove itself so as to only filter post thumbnails
744
- *
745
- * @since 2.9.0
746
- * @param array $attr Attributes including src, class, alt, title
747
- * @return array
748
- */
749
- function _wp_post_thumbnail_class_filter( $attr ) {
750
- $attr['class'] .= ' wp-post-image';
751
- return $attr;
752
- }
753
-
754
- /**
755
- * Adds _wp_post_thumbnail_class_filter to the wp_get_attachment_image_attributes filter
756
- *
757
- * @since 2.9.0
758
- */
759
- function _wp_post_thumbnail_class_filter_add( $attr ) {
760
- add_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );
761
- }
762
-
763
- /**
764
- * Removes _wp_post_thumbnail_class_filter from the wp_get_attachment_image_attributes filter
765
- *
766
- * @since 2.9.0
767
- */
768
- function _wp_post_thumbnail_class_filter_remove( $attr ) {
769
- remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );
770
- }
771
-
772
- add_shortcode('wp_caption', 'img_caption_shortcode');
773
- add_shortcode('caption', 'img_caption_shortcode');
774
-
775
- /**
776
- * The Caption shortcode.
777
- *
778
- * Allows a plugin to replace the content that would otherwise be returned. The
779
- * filter is 'img_caption_shortcode' and passes an empty string, the attr
780
- * parameter and the content parameter values.
781
- *
782
- * The supported attributes for the shortcode are 'id', 'align', 'width', and
783
- * 'caption'.
784
- *
785
- * @since 2.6.0
786
- *
787
- * @param array $attr {
788
- * Attributes of the caption shortcode.
789
- *
790
- * @type string $id ID of the div element for the caption.
791
- * @type string $align Class name that aligns the caption. Default 'alignnone'. Accepts 'alignleft',
792
- * 'aligncenter', alignright', 'alignnone'.
793
- * @type int $width The width of the caption, in pixels.
794
- * @type string $caption The caption text.
795
- * @type string $class Additional class name(s) added to the caption container.
796
- * }
797
- * @param string $content Optional. Shortcode content.
798
- * @return string HTML content to display the caption.
799
- */
800
- function img_caption_shortcode( $attr, $content = null ) {
801
- // New-style shortcode with the caption inside the shortcode with the link and image tags.
802
- if ( ! isset( $attr['caption'] ) ) {
803
- if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {
804
- $content = $matches[1];
805
- $attr['caption'] = trim( $matches[2] );
806
- }
807
- }
808
-
809
- /**
810
- * Filter the default caption shortcode output.
811
- *
812
- * If the filtered output isn't empty, it will be used instead of generating
813
- * the default caption template.
814
- *
815
- * @since 2.6.0
816
- *
817
- * @see img_caption_shortcode()
818
- *
819
- * @param string $output The caption output. Default empty.
820
- * @param array $attr Attributes of the caption shortcode.
821
- * @param string $content The image element, possibly wrapped in a hyperlink.
822
- */
823
- $output = apply_filters( 'img_caption_shortcode', '', $attr, $content );
824
- if ( $output != '' )
825
- return $output;
826
-
827
- $atts = shortcode_atts( array(
828
- 'id' => '',
829
- 'align' => 'alignnone',
830
- 'width' => '',
831
- 'caption' => '',
832
- 'class' => '',
833
- ), $attr, 'caption' );
834
-
835
- $atts['width'] = (int) $atts['width'];
836
- if ( $atts['width'] < 1 || empty( $atts['caption'] ) )
837
- return $content;
838
-
839
- if ( ! empty( $atts['id'] ) )
840
- $atts['id'] = 'id="' . esc_attr( $atts['id'] ) . '" ';
841
-
842
- $class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] );
843
-
844
- if ( current_theme_supports( 'html5', 'caption' ) ) {
845
- return '<figure ' . $atts['id'] . 'style="width: ' . (int) $atts['width'] . 'px;" class="' . esc_attr( $class ) . '">'
846
- . do_shortcode( $content ) . '<figcaption class="wp-caption-text">' . $atts['caption'] . '</figcaption></figure>';
847
- }
848
-
849
- $caption_width = 10 + $atts['width'];
850
-
851
- /**
852
- * Filter the width of an image's caption.
853
- *
854
- * By default, the caption is 10 pixels greater than the width of the image,
855
- * to prevent post content from running up against a floated image.
856
- *
857
- * @since 3.7.0
858
- *
859
- * @see img_caption_shortcode()
860
- *
861
- * @param int $caption_width Width of the caption in pixels. To remove this inline style,
862
- * return zero.
863
- * @param array $atts Attributes of the caption shortcode.
864
- * @param string $content The image element, possibly wrapped in a hyperlink.
865
- */
866
- $caption_width = apply_filters( 'img_caption_shortcode_width', $caption_width, $atts, $content );
867
-
868
- $style = '';
869
- if ( $caption_width )
870
- $style = 'style="width: ' . (int) $caption_width . 'px" ';
871
-
872
- return '<div ' . $atts['id'] . $style . 'class="' . esc_attr( $class ) . '">'
873
- . do_shortcode( $content ) . '<p class="wp-caption-text">' . $atts['caption'] . '</p></div>';
874
- }
875
-
876
- add_shortcode('gallery', 'gallery_shortcode');
877
-
878
- /**
879
- * The Gallery shortcode.
880
- *
881
- * This implements the functionality of the Gallery Shortcode for displaying
882
- * WordPress images on a post.
883
- *
884
- * @since 2.5.0
885
- *
886
- * @param array $attr {
887
- * Attributes of the gallery shortcode.
888
- *
889
- * @type string $order Order of the images in the gallery. Default 'ASC'. Accepts 'ASC', 'DESC'.
890
- * @type string $orderby The field to use when ordering the images. Default 'menu_order ID'.
891
- * Accepts any valid SQL ORDERBY statement.
892
- * @type int $id Post ID.
893
- * @type string $itemtag HTML tag to use for each image in the gallery.
894
- * Default 'dl', or 'figure' when the theme registers HTML5 gallery support.
895
- * @type string $icontag HTML tag to use for each image's icon.
896
- * Default 'dt', or 'div' when the theme registers HTML5 gallery support.
897
- * @type string $captiontag HTML tag to use for each image's caption.
898
- * Default 'dd', or 'figcaption' when the theme registers HTML5 gallery support.
899
- * @type int $columns Number of columns of images to display. Default 3.
900
- * @type string $size Size of the images to display. Default 'thumbnail'.
901
- * @type string $ids A comma-separated list of IDs of attachments to display. Default empty.
902
- * @type string $include A comma-separated list of IDs of attachments to include. Default empty.
903
- * @type string $exclude A comma-separated list of IDs of attachments to exclude. Default empty.
904
- * @type string $link What to link each image to. Default empty (links to the attachment page).
905
- * Accepts 'file', 'none'.
906
- * }
907
- * @return string HTML content to display gallery.
908
- */
909
- function gallery_shortcode( $attr ) {
910
- $post = get_post();
911
-
912
- static $instance = 0;
913
- $instance++;
914
-
915
- if ( ! empty( $attr['ids'] ) ) {
916
- // 'ids' is explicitly ordered, unless you specify otherwise.
917
- if ( empty( $attr['orderby'] ) ) {
918
- $attr['orderby'] = 'post__in';
919
- }
920
- $attr['include'] = $attr['ids'];
921
- }
922
-
923
- /**
924
- * Filter the default gallery shortcode output.
925
- *
926
- * If the filtered output isn't empty, it will be used instead of generating
927
- * the default gallery template.
928
- *
929
- * @since 2.5.0
930
- *
931
- * @see gallery_shortcode()
932
- *
933
- * @param string $output The gallery output. Default empty.
934
- * @param array $attr Attributes of the gallery shortcode.
935
- */
936
- $output = apply_filters( 'post_gallery', '', $attr );
937
- if ( $output != '' ) {
938
- return $output;
939
- }
940
-
941
- // We're trusting author input, so let's at least make sure it looks like a valid orderby statement
942
- if ( isset( $attr['orderby'] ) ) {
943
- $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
944
- if ( ! $attr['orderby'] ) {
945
- unset( $attr['orderby'] );
946
- }
947
- }
948
-
949
- $html5 = current_theme_supports( 'html5', 'gallery' );
950
- $atts = shortcode_atts( array(
951
- 'order' => 'ASC',
952
- 'orderby' => 'menu_order ID',
953
- 'id' => $post ? $post->ID : 0,
954
- 'itemtag' => $html5 ? 'figure' : 'dl',
955
- 'icontag' => $html5 ? 'div' : 'dt',
956
- 'captiontag' => $html5 ? 'figcaption' : 'dd',
957
- 'columns' => 3,
958
- 'size' => 'thumbnail',
959
- 'include' => '',
960
- 'exclude' => '',
961
- 'link' => ''
962
- ), $attr, 'gallery' );
963
-
964
- $id = intval( $atts['id'] );
965
-
966
- if ( ! empty( $atts['include'] ) ) {
967
- $_attachments = get_posts( array( 'include' => $atts['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
968
-
969
- $attachments = array();
970
- foreach ( $_attachments as $key => $val ) {
971
- $attachments[$val->ID] = $_attachments[$key];
972
- }
973
- } elseif ( ! empty( $atts['exclude'] ) ) {
974
- $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $atts['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
975
- } else {
976
- $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) );
977
- }
978
-
979
- if ( empty( $attachments ) ) {
980
- return '';
981
- }
982
-
983
- if ( is_feed() ) {
984
- $output = "\n";
985
- foreach ( $attachments as $att_id => $attachment ) {
986
- $output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . "\n";
987
- }
988
- return $output;
989
- }
990
-
991
- $itemtag = tag_escape( $atts['itemtag'] );
992
- $captiontag = tag_escape( $atts['captiontag'] );
993
- $icontag = tag_escape( $atts['icontag'] );
994
- $valid_tags = wp_kses_allowed_html( 'post' );
995
- if ( ! isset( $valid_tags[ $itemtag ] ) ) {
996
- $itemtag = 'dl';
997
- }
998
- if ( ! isset( $valid_tags[ $captiontag ] ) ) {
999
- $captiontag = 'dd';
1000
- }
1001
- if ( ! isset( $valid_tags[ $icontag ] ) ) {
1002
- $icontag = 'dt';
1003
- }
1004
-
1005
- $columns = intval( $atts['columns'] );
1006
- $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
1007
- $float = is_rtl() ? 'right' : 'left';
1008
-
1009
- $selector = "gallery-{$instance}";
1010
-
1011
- $gallery_style = '';
1012
-
1013
- /**
1014
- * Filter whether to print default gallery styles.
1015
- *
1016
- * @since 3.1.0
1017
- *
1018
- * @param bool $print Whether to print default gallery styles.
1019
- * Defaults to false if the theme supports HTML5 galleries.
1020
- * Otherwise, defaults to true.
1021
- */
1022
- if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
1023
- $gallery_style = "
1024
- <style type='text/css'>
1025
- #{$selector} {
1026
- margin: auto;
1027
- }
1028
- #{$selector} .gallery-item {
1029
- float: {$float};
1030
- margin-top: 10px;
1031
- text-align: center;
1032
- width: {$itemwidth}%;
1033
- }
1034
- #{$selector} img {
1035
- border: 2px solid #cfcfcf;
1036
- }
1037
- #{$selector} .gallery-caption {
1038
- margin-left: 0;
1039
- }
1040
- /* see gallery_shortcode() in wp-includes/media.php */
1041
- </style>\n\t\t";
1042
- }
1043
-
1044
- $size_class = sanitize_html_class( $atts['size'] );
1045
- $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
1046
-
1047
- /**
1048
- * Filter the default gallery shortcode CSS styles.
1049
- *
1050
- * @since 2.5.0
1051
- *
1052
- * @param string $gallery_style Default gallery shortcode CSS styles.
1053
- * @param string $gallery_div Opening HTML div container for the gallery shortcode output.
1054
- */
1055
- $output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );
1056
-
1057
- $i = 0;
1058
- foreach ( $attachments as $id => $attachment ) {
1059
- if ( ! empty( $atts['link'] ) && 'file' === $atts['link'] ) {
1060
- $image_output = wp_get_attachment_link( $id, $atts['size'], false, false );
1061
- } elseif ( ! empty( $atts['link'] ) && 'none' === $atts['link'] ) {
1062
- $image_output = wp_get_attachment_image( $id, $atts['size'], false );
1063
- } else {
1064
- $image_output = wp_get_attachment_link( $id, $atts['size'], true, false );
1065
- }
1066
- $image_meta = wp_get_attachment_metadata( $id );
1067
-
1068
- $orientation = '';
1069
- if ( isset( $image_meta['height'], $image_meta['width'] ) ) {
1070
- $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
1071
- }
1072
- $output .= "<{$itemtag} class='gallery-item'>";
1073
- $output .= "
1074
- <{$icontag} class='gallery-icon {$orientation}'>
1075
- $image_output
1076
- </{$icontag}>";
1077
- if ( $captiontag && trim($attachment->post_excerpt) ) {
1078
- $output .= "
1079
- <{$captiontag} class='wp-caption-text gallery-caption'>
1080
- " . wptexturize($attachment->post_excerpt) . "
1081
- </{$captiontag}>";
1082
- }
1083
- $output .= "</{$itemtag}>";
1084
- if ( ! $html5 && $columns > 0 && ++$i % $columns == 0 ) {
1085
- $output .= '<br style="clear: both" />';
1086
- }
1087
- }
1088
-
1089
- if ( ! $html5 && $columns > 0 && $i % $columns !== 0 ) {
1090
- $output .= "
1091
- <br style='clear: both' />";
1092
- }
1093
-
1094
- $output .= "
1095
- </div>\n";
1096
-
1097
- return $output;
1098
- }
1099
-
1100
- /**
1101
- * Output the templates used by playlists.
1102
- *
1103
- * @since 3.9.0
1104
- */
1105
- function wp_underscore_playlist_templates() {
1106
- ?>
1107
- <script type="text/html" id="tmpl-wp-playlist-current-item">
1108
- <# if ( data.image ) { #>
1109
- <img src="{{ data.thumb.src }}"/>
1110
- <# } #>
1111
- <div class="wp-playlist-caption">
1112
- <span class="wp-playlist-item-meta wp-playlist-item-title">&#8220;{{ data.title }}&#8221;</span>
1113
- <# if ( data.meta.album ) { #><span class="wp-playlist-item-meta wp-playlist-item-album">{{ data.meta.album }}</span><# } #>
1114
- <# if ( data.meta.artist ) { #><span class="wp-playlist-item-meta wp-playlist-item-artist">{{ data.meta.artist }}</span><# } #>
1115
- </div>
1116
- </script>
1117
- <script type="text/html" id="tmpl-wp-playlist-item">
1118
- <div class="wp-playlist-item">
1119
- <a class="wp-playlist-caption" href="{{ data.src }}">
1120
- {{ data.index ? ( data.index + '. ' ) : '' }}
1121
- <# if ( data.caption ) { #>
1122
- {{ data.caption }}
1123
- <# } else { #>
1124
- <span class="wp-playlist-item-title">&#8220;{{{ data.title }}}&#8221;</span>
1125
- <# if ( data.artists && data.meta.artist ) { #>
1126
- <span class="wp-playlist-item-artist"> &mdash; {{ data.meta.artist }}</span>
1127
- <# } #>
1128
- <# } #>
1129
- </a>
1130
- <# if ( data.meta.length_formatted ) { #>
1131
- <div class="wp-playlist-item-length">{{ data.meta.length_formatted }}</div>
1132
- <# } #>
1133
- </div>
1134
- </script>
1135
- <?php
1136
- }
1137
-
1138
- /**
1139
- * Output and enqueue default scripts and styles for playlists.
1140
- *
1141
- * @since 3.9.0
1142
- *
1143
- * @param string $type Type of playlist. Accepts 'audio' or 'video'.
1144
- */
1145
- function wp_playlist_scripts( $type ) {
1146
- wp_enqueue_style( 'wp-mediaelement' );
1147
- wp_enqueue_script( 'wp-playlist' );
1148
- ?>
1149
- <!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ) ?>');</script><![endif]-->
1150
- <?php
1151
- add_action( 'wp_footer', 'wp_underscore_playlist_templates', 0 );
1152
- add_action( 'admin_footer', 'wp_underscore_playlist_templates', 0 );
1153
- }
1154
- add_action( 'wp_playlist_scripts', 'wp_playlist_scripts' );
1155
-
1156
- /**
1157
- * The playlist shortcode.
1158
- *
1159
- * This implements the functionality of the playlist shortcode for displaying
1160
- * a collection of WordPress audio or video files in a post.
1161
- *
1162
- * @since 3.9.0
1163
- *
1164
- * @param array $attr {
1165
- * Array of default playlist attributes.
1166
- *
1167
- * @type string $type Type of playlist to display. Accepts 'audio' or 'video'. Default 'audio'.
1168
- * @type string $order Designates ascending or descending order of items in the playlist.
1169
- * Accepts 'ASC', 'DESC'. Default 'ASC'.
1170
- * @type string $orderby Any column, or columns, to sort the playlist. If $ids are
1171
- * passed, this defaults to the order of the $ids array ('post__in').
1172
- * Otherwise default is 'menu_order ID'.
1173
- * @type int $id If an explicit $ids array is not present, this parameter
1174
- * will determine which attachments are used for the playlist.
1175
- * Default is the current post ID.
1176
- * @type array $ids Create a playlist out of these explicit attachment IDs. If empty,
1177
- * a playlist will be created from all $type attachments of $id.
1178
- * Default empty.
1179
- * @type array $exclude List of specific attachment IDs to exclude from the playlist. Default empty.
1180
- * @type string $style Playlist style to use. Accepts 'light' or 'dark'. Default 'light'.
1181
- * @type bool $tracklist Whether to show or hide the playlist. Default true.
1182
- * @type bool $tracknumbers Whether to show or hide the numbers next to entries in the playlist. Default true.
1183
- * @type bool $images Show or hide the video or audio thumbnail (Featured Image/post
1184
- * thumbnail). Default true.
1185
- * @type bool $artists Whether to show or hide artist name in the playlist. Default true.
1186
- * }
1187
- *
1188
- * @return string Playlist output. Empty string if the passed type is unsupported.
1189
- */
1190
- function wp_playlist_shortcode( $attr ) {
1191
- global $content_width;
1192
- $post = get_post();
1193
-
1194
- static $instance = 0;
1195
- $instance++;
1196
-
1197
- if ( ! empty( $attr['ids'] ) ) {
1198
- // 'ids' is explicitly ordered, unless you specify otherwise.
1199
- if ( empty( $attr['orderby'] ) ) {
1200
- $attr['orderby'] = 'post__in';
1201
- }
1202
- $attr['include'] = $attr['ids'];
1203
- }
1204
-
1205
- /**
1206
- * Filter the playlist output.
1207
- *
1208
- * Passing a non-empty value to the filter will short-circuit generation
1209
- * of the default playlist output, returning the passed value instead.
1210
- *
1211
- * @since 3.9.0
1212
- *
1213
- * @param string $output Playlist output. Default empty.
1214
- * @param array $attr An array of shortcode attributes.
1215
- */
1216
- $output = apply_filters( 'post_playlist', '', $attr );
1217
- if ( $output != '' ) {
1218
- return $output;
1219
- }
1220
-
1221
- /*
1222
- * We're trusting author input, so let's at least make sure it looks
1223
- * like a valid orderby statement.
1224
- */
1225
- if ( isset( $attr['orderby'] ) ) {
1226
- $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
1227
- if ( ! $attr['orderby'] )
1228
- unset( $attr['orderby'] );
1229
- }
1230
-
1231
- $atts = shortcode_atts( array(
1232
- 'type' => 'audio',
1233
- 'order' => 'ASC',
1234
- 'orderby' => 'menu_order ID',
1235
- 'id' => $post ? $post->ID : 0,
1236
- 'include' => '',
1237
- 'exclude' => '',
1238
- 'style' => 'light',
1239
- 'tracklist' => true,
1240
- 'tracknumbers' => true,
1241
- 'images' => true,
1242
- 'artists' => true
1243
- ), $attr, 'playlist' );
1244
-
1245
- $id = intval( $atts['id'] );
1246
-
1247
- $args = array(
1248
- 'post_status' => 'inherit',
1249
- 'post_type' => 'attachment',
1250
- 'post_mime_type' => $atts['type'],
1251
- 'order' => $atts['order'],
1252
- 'orderby' => $atts['orderby']
1253
- );
1254
-
1255
- if ( ! empty( $atts['include'] ) ) {
1256
- $args['include'] = $atts['include'];
1257
- $_attachments = get_posts( $args );
1258
-
1259
- $attachments = array();
1260
- foreach ( $_attachments as $key => $val ) {
1261
- $attachments[$val->ID] = $_attachments[$key];
1262
- }
1263
- } elseif ( ! empty( $atts['exclude'] ) ) {
1264
- $args['post_parent'] = $id;
1265
- $args['exclude'] = $atts['exclude'];
1266
- $attachments = get_children( $args );
1267
- } else {
1268
- $args['post_parent'] = $id;
1269
- $attachments = get_children( $args );
1270
- }
1271
-
1272
- if ( empty( $attachments ) ) {
1273
- return '';
1274
- }
1275
-
1276
- if ( is_feed() ) {
1277
- $output = "\n";
1278
- foreach ( $attachments as $att_id => $attachment ) {
1279
- $output .= wp_get_attachment_link( $att_id ) . "\n";
1280
- }
1281
- return $output;
1282
- }
1283
-
1284
- $outer = 22; // default padding and border of wrapper
1285
-
1286
- $default_width = 640;
1287
- $default_height = 360;
1288
-
1289
- $theme_width = empty( $content_width ) ? $default_width : ( $content_width - $outer );
1290
- $theme_height = empty( $content_width ) ? $default_height : round( ( $default_height * $theme_width ) / $default_width );
1291
-
1292
- $data = array(
1293
- 'type' => $atts['type'],
1294
- // don't pass strings to JSON, will be truthy in JS
1295
- 'tracklist' => wp_validate_boolean( $atts['tracklist'] ),
1296
- 'tracknumbers' => wp_validate_boolean( $atts['tracknumbers'] ),
1297
- 'images' => wp_validate_boolean( $atts['images'] ),
1298
- 'artists' => wp_validate_boolean( $atts['artists'] ),
1299
- );
1300
-
1301
- $tracks = array();
1302
- foreach ( $attachments as $attachment ) {
1303
- $url = wp_get_attachment_url( $attachment->ID );
1304
- $ftype = wp_check_filetype( $url, wp_get_mime_types() );
1305
- $track = array(
1306
- 'src' => $url,
1307
- 'type' => $ftype['type'],
1308
- 'title' => $attachment->post_title,
1309
- 'caption' => $attachment->post_excerpt,
1310
- 'description' => $attachment->post_content
1311
- );
1312
-
1313
- $track['meta'] = array();
1314
- $meta = wp_get_attachment_metadata( $attachment->ID );
1315
- if ( ! empty( $meta ) ) {
1316
-
1317
- foreach ( wp_get_attachment_id3_keys( $attachment ) as $key => $label ) {
1318
- if ( ! empty( $meta[ $key ] ) ) {
1319
- $track['meta'][ $key ] = $meta[ $key ];
1320
- }
1321
- }
1322
-
1323
- if ( 'video' === $atts['type'] ) {
1324
- if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) {
1325
- $width = $meta['width'];
1326
- $height = $meta['height'];
1327
- $theme_height = round( ( $height * $theme_width ) / $width );
1328
- } else {
1329
- $width = $default_width;
1330
- $height = $default_height;
1331
- }
1332
-
1333
- $track['dimensions'] = array(
1334
- 'original' => compact( 'width', 'height' ),
1335
- 'resized' => array(
1336
- 'width' => $theme_width,
1337
- 'height' => $theme_height
1338
- )
1339
- );
1340
- }
1341
- }
1342
-
1343
- if ( $atts['images'] ) {
1344
- $thumb_id = get_post_thumbnail_id( $attachment->ID );
1345
- if ( ! empty( $thumb_id ) ) {
1346
- list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'full' );
1347
- $track['image'] = compact( 'src', 'width', 'height' );
1348
- list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'thumbnail' );
1349
- $track['thumb'] = compact( 'src', 'width', 'height' );
1350
- } else {
1351
- $src = wp_mime_type_icon( $attachment->ID );
1352
- $width = 48;
1353
- $height = 64;
1354
- $track['image'] = compact( 'src', 'width', 'height' );
1355
- $track['thumb'] = compact( 'src', 'width', 'height' );
1356
- }
1357
- }
1358
-
1359
- $tracks[] = $track;
1360
- }
1361
- $data['tracks'] = $tracks;
1362
-
1363
- $safe_type = esc_attr( $atts['type'] );
1364
- $safe_style = esc_attr( $atts['style'] );
1365
-
1366
- ob_start();
1367
-
1368
- if ( 1 === $instance ) {
1369
- /**
1370
- * Print and enqueue playlist scripts, styles, and JavaScript templates.
1371
- *
1372
- * @since 3.9.0
1373
- *
1374
- * @param string $type Type of playlist. Possible values are 'audio' or 'video'.
1375
- * @param string $style The 'theme' for the playlist. Core provides 'light' and 'dark'.
1376
- */
1377
- do_action( 'wp_playlist_scripts', $atts['type'], $atts['style'] );
1378
- } ?>
1379
- <div class="wp-playlist wp-<?php echo $safe_type ?>-playlist wp-playlist-<?php echo $safe_style ?>">
1380
- <?php if ( 'audio' === $atts['type'] ): ?>
1381
- <div class="wp-playlist-current-item"></div>
1382
- <?php endif ?>
1383
- <<?php echo $safe_type ?> controls="controls" preload="none" width="<?php
1384
- echo (int) $theme_width;
1385
- ?>"<?php if ( 'video' === $safe_type ):
1386
- echo ' height="', (int) $theme_height, '"';
1387
- else:
1388
- echo ' style="visibility: hidden"';
1389
- endif; ?>></<?php echo $safe_type ?>>
1390
- <div class="wp-playlist-next"></div>
1391
- <div class="wp-playlist-prev"></div>
1392
- <noscript>
1393
- <ol><?php
1394
- foreach ( $attachments as $att_id => $attachment ) {
1395
- printf( '<li>%s</li>', wp_get_attachment_link( $att_id ) );
1396
- }
1397
- ?></ol>
1398
- </noscript>
1399
- <script type="application/json" class="wp-playlist-script"><?php echo json_encode( $data ) ?></script>
1400
- </div>
1401
- <?php
1402
- return ob_get_clean();
1403
- }
1404
- add_shortcode( 'playlist', 'wp_playlist_shortcode' );
1405
-
1406
- /**
1407
- * Provide a No-JS Flash fallback as a last resort for audio / video
1408
- *
1409
- * @since 3.6.0
1410
- *
1411
- * @param string $url
1412
- * @return string Fallback HTML
1413
- */
1414
- function wp_mediaelement_fallback( $url ) {
1415
- /**
1416
- * Filter the Mediaelement fallback output for no-JS.
1417
- *
1418
- * @since 3.6.0
1419
- *
1420
- * @param string $output Fallback output for no-JS.
1421
- * @param string $url Media file URL.
1422
- */
1423
- return apply_filters( 'wp_mediaelement_fallback', sprintf( '<a href="%1$s">%1$s</a>', esc_url( $url ) ), $url );
1424
- }
1425
-
1426
- /**
1427
- * Return a filtered list of WP-supported audio formats.
1428
- *
1429
- * @since 3.6.0
1430
- * @return array
1431
- */
1432
- function wp_get_audio_extensions() {
1433
- /**
1434
- * Filter the list of supported audio formats.
1435
- *
1436
- * @since 3.6.0
1437
- *
1438
- * @param array $extensions An array of support audio formats. Defaults are
1439
- * 'mp3', 'ogg', 'wma', 'm4a', 'wav'.
1440
- */
1441
- return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'wma', 'm4a', 'wav' ) );
1442
- }
1443
-
1444
- /**
1445
- * Return useful keys to use to lookup data from an attachment's stored metadata.
1446
- *
1447
- * @since 3.9.0
1448
- *
1449
- * @param WP_Post $attachment The current attachment, provided for context.
1450
- * @param string $context The context. Accepts 'edit', 'display'. Default 'display'.
1451
- * @return array Key/value pairs of field keys to labels.
1452
- */
1453
- function wp_get_attachment_id3_keys( $attachment, $context = 'display' ) {
1454
- $fields = array(
1455
- 'artist' => __( 'Artist' ),
1456
- 'album' => __( 'Album' ),
1457
- );
1458
-
1459
- if ( 'display' === $context ) {
1460
- $fields['genre'] = __( 'Genre' );
1461
- $fields['year'] = __( 'Year' );
1462
- $fields['length_formatted'] = _x( 'Length', 'video or audio' );
1463
- } elseif ( 'js' === $context ) {
1464
- $fields['bitrate'] = __( 'Bitrate' );
1465
- $fields['bitrate_mode'] = __( 'Bitrate Mode' );
1466
- }
1467
-
1468
- /**
1469
- * Filter the editable list of keys to look up data from an attachment's metadata.
1470
- *
1471
- * @since 3.9.0
1472
- *
1473
- * @param array $fields Key/value pairs of field keys to labels.
1474
- * @param WP_Post $attachment Attachment object.
1475
- * @param string $context The context. Accepts 'edit', 'display'. Default 'display'.
1476
- */
1477
- return apply_filters( 'wp_get_attachment_id3_keys', $fields, $attachment, $context );
1478
- }
1479
- /**
1480
- * The Audio shortcode.
1481
- *
1482
- * This implements the functionality of the Audio Shortcode for displaying
1483
- * WordPress mp3s in a post.
1484
- *
1485
- * @since 3.6.0
1486
- *
1487
- * @param array $attr {
1488
- * Attributes of the audio shortcode.
1489
- *
1490
- * @type string $src URL to the source of the audio file. Default empty.
1491
- * @type string $loop The 'loop' attribute for the `<audio>` element. Default empty.
1492
- * @type string $autoplay The 'autoplay' attribute for the `<audio>` element. Default empty.
1493
- * @type string $preload The 'preload' attribute for the `<audio>` element. Default empty.
1494
- * @type string $class The 'class' attribute for the `<audio>` element. Default 'wp-audio-shortcode'.
1495
- * @type string $id The 'id' attribute for the `<audio>` element. Default 'audio-{$post_id}-{$instances}'.
1496
- * @type string $style The 'style' attribute for the `<audio>` element. Default 'width: 100%'.
1497
- * }
1498
- * @param string $content Optional. Shortcode content.
1499
- * @return string HTML content to display audio.
1500
- */
1501
- function wp_audio_shortcode( $attr, $content = '' ) {
1502
- $post_id = get_post() ? get_the_ID() : 0;
1503
-
1504
- static $instances = 0;
1505
- $instances++;
1506
-
1507
- /**
1508
- * Filter the default audio shortcode output.
1509
- *
1510
- * If the filtered output isn't empty, it will be used instead of generating the default audio template.
1511
- *
1512
- * @since 3.6.0
1513
- *
1514
- * @param string $html Empty variable to be replaced with shortcode markup.
1515
- * @param array $attr Attributes of the shortcode. @see wp_audio_shortcode()
1516
- * @param string $content Shortcode content.
1517
- * @param int $instances Unique numeric ID of this audio shortcode instance.
1518
- */
1519
- $override = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instances );
1520
- if ( '' !== $override ) {
1521
- return $override;
1522
- }
1523
-
1524
- $audio = null;
1525
-
1526
- $default_types = wp_get_audio_extensions();
1527
- $defaults_atts = array(
1528
- 'src' => '',
1529
- 'loop' => '',
1530
- 'autoplay' => '',
1531
- 'preload' => 'none'
1532
- );
1533
- foreach ( $default_types as $type ) {
1534
- $defaults_atts[$type] = '';
1535
- }
1536
-
1537
- $atts = shortcode_atts( $defaults_atts, $attr, 'audio' );
1538
-
1539
- $primary = false;
1540
- if ( ! empty( $atts['src'] ) ) {
1541
- $type = wp_check_filetype( $atts['src'], wp_get_mime_types() );
1542
- if ( ! in_array( strtolower( $type['ext'] ), $default_types ) ) {
1543
- return sprintf( '<a class="wp-embedded-audio" href="%s">%s</a>', esc_url( $atts['src'] ), esc_html( $atts['src'] ) );
1544
- }
1545
- $primary = true;
1546
- array_unshift( $default_types, 'src' );
1547
- } else {
1548
- foreach ( $default_types as $ext ) {
1549
- if ( ! empty( $atts[ $ext ] ) ) {
1550
- $type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() );
1551
- if ( strtolower( $type['ext'] ) === $ext ) {
1552
- $primary = true;
1553
- }
1554
- }
1555
- }
1556
- }
1557
-
1558
- if ( ! $primary ) {
1559
- $audios = get_attached_media( 'audio', $post_id );
1560
- if ( empty( $audios ) ) {
1561
- return;
1562
- }
1563
-
1564
- $audio = reset( $audios );
1565
- $atts['src'] = wp_get_attachment_url( $audio->ID );
1566
- if ( empty( $atts['src'] ) ) {
1567
- return;
1568
- }
1569
-
1570
- array_unshift( $default_types, 'src' );
1571
- }
1572
-
1573
- /**
1574
- * Filter the media library used for the audio shortcode.
1575
- *
1576
- * @since 3.6.0
1577
- *
1578
- * @param string $library Media library used for the audio shortcode.
1579
- */
1580
- $library = apply_filters( 'wp_audio_shortcode_library', 'mediaelement' );
1581
- if ( 'mediaelement' === $library && did_action( 'init' ) ) {
1582
- wp_enqueue_style( 'wp-mediaelement' );
1583
- wp_enqueue_script( 'wp-mediaelement' );
1584
- }
1585
-
1586
- /**
1587
- * Filter the class attribute for the audio shortcode output container.
1588
- *
1589
- * @since 3.6.0
1590
- *
1591
- * @param string $class CSS class or list of space-separated classes.
1592
- */
1593
- $html_atts = array(
1594
- 'class' => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ),
1595
- 'id' => sprintf( 'audio-%d-%d', $post_id, $instances ),
1596
- 'loop' => $atts['loop'],
1597
- 'autoplay' => $atts['autoplay'],
1598
- 'preload' => $atts['preload'],
1599
- 'style' => 'width: 100%; visibility: hidden;',
1600
- );
1601
-
1602
- // These ones should just be omitted altogether if they are blank
1603
- foreach ( array( 'loop', 'autoplay', 'preload' ) as $a ) {
1604
- if ( empty( $html_atts[$a] ) ) {
1605
- unset( $html_atts[$a] );
1606
- }
1607
- }
1608
-
1609
- $attr_strings = array();
1610
- foreach ( $html_atts as $k => $v ) {
1611
- $attr_strings[] = $k . '="' . esc_attr( $v ) . '"';
1612
- }
1613
-
1614
- $html = '';
1615
- if ( 'mediaelement' === $library && 1 === $instances ) {
1616
- $html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n";
1617
- }
1618
- $html .= sprintf( '<audio %s controls="controls">', join( ' ', $attr_strings ) );
1619
-
1620
- $fileurl = '';
1621
- $source = '<source type="%s" src="%s" />';
1622
- foreach ( $default_types as $fallback ) {
1623
- if ( ! empty( $atts[ $fallback ] ) ) {
1624
- if ( empty( $fileurl ) ) {
1625
- $fileurl = $atts[ $fallback ];
1626
- }
1627
- $type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() );
1628
- $url = add_query_arg( '_', $instances, $atts[ $fallback ] );
1629
- $html .= sprintf( $source, $type['type'], esc_url( $url ) );
1630
- }
1631
- }
1632
-
1633
- if ( 'mediaelement' === $library ) {
1634
- $html .= wp_mediaelement_fallback( $fileurl );
1635
- }
1636
- $html .= '</audio>';
1637
-
1638
- /**
1639
- * Filter the audio shortcode output.
1640
- *
1641
- * @since 3.6.0
1642
- *
1643
- * @param string $html Audio shortcode HTML output.
1644
- * @param array $atts Array of audio shortcode attributes.
1645
- * @param string $audio Audio file.
1646
- * @param int $post_id Post ID.
1647
- * @param string $library Media library used for the audio shortcode.
1648
- */
1649
- return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );
1650
- }
1651
- add_shortcode( 'audio', 'wp_audio_shortcode' );
1652
-
1653
- /**
1654
- * Return a filtered list of WP-supported video formats
1655
- *
1656
- * @since 3.6.0
1657
- * @return array
1658
- */
1659
- function wp_get_video_extensions() {
1660
- /**
1661
- * Filter the list of supported video formats.
1662
- *
1663
- * @since 3.6.0
1664
- *
1665
- * @param array $extensions An array of support video formats. Defaults are
1666
- * 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv'.
1667
- */
1668
- return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv' ) );
1669
- }
1670
-
1671
- /**
1672
- * The Video shortcode.
1673
- *
1674
- * This implements the functionality of the Video Shortcode for displaying
1675
- * WordPress mp4s in a post.
1676
- *
1677
- * @since 3.6.0
1678
- *
1679
- * @param array $attr {
1680
- * Attributes of the shortcode.
1681
- *
1682
- * @type string $src URL to the source of the video file. Default empty.
1683
- * @type int $height Height of the video embed in pixels. Default 360.
1684
- * @type int $width Width of the video embed in pixels. Default $content_width or 640.
1685
- * @type string $poster The 'poster' attribute for the `<video>` element. Default empty.
1686
- * @type string $loop The 'loop' attribute for the `<video>` element. Default empty.
1687
- * @type string $autoplay The 'autoplay' attribute for the `<video>` element. Default empty.
1688
- * @type string $preload The 'preload' attribute for the `<video>` element.
1689
- * Default 'metadata'.
1690
- * @type string $class The 'class' attribute for the `<video>` element.
1691
- * Default 'wp-video-shortcode'.
1692
- * @type string $id The 'id' attribute for the `<video>` element.
1693
- * Default 'video-{$post_id}-{$instances}'.
1694
- * }
1695
- * @param string $content Optional. Shortcode content.
1696
- * @return string HTML content to display video.
1697
- */
1698
- function wp_video_shortcode( $attr, $content = '' ) {
1699
- global $content_width;
1700
- $post_id = get_post() ? get_the_ID() : 0;
1701
-
1702
- static $instances = 0;
1703
- $instances++;
1704
-
1705
- /**
1706
- * Filter the default video shortcode output.
1707
- *
1708
- * If the filtered output isn't empty, it will be used instead of generating
1709
- * the default video template.
1710
- *
1711
- * @since 3.6.0
1712
- *
1713
- * @see wp_video_shortcode()
1714
- *
1715
- * @param string $html Empty variable to be replaced with shortcode markup.
1716
- * @param array $attr Attributes of the video shortcode.
1717
- * @param string $content Video shortcode content.
1718
- * @param int $instances Unique numeric ID of this video shortcode instance.
1719
- */
1720
- $override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instances );
1721
- if ( '' !== $override ) {
1722
- return $override;
1723
- }
1724
-
1725
- $video = null;
1726
-
1727
- $default_types = wp_get_video_extensions();
1728
- $defaults_atts = array(
1729
- 'src' => '',
1730
- 'poster' => '',
1731
- 'loop' => '',
1732
- 'autoplay' => '',
1733
- 'preload' => 'metadata',
1734
- 'width' => 640,
1735
- 'height' => 360,
1736
- );
1737
-
1738
- foreach ( $default_types as $type ) {
1739
- $defaults_atts[$type] = '';
1740
- }
1741
-
1742
- $atts = shortcode_atts( $defaults_atts, $attr, 'video' );
1743
-
1744
- if ( is_admin() ) {
1745
- // shrink the video so it isn't huge in the admin
1746
- if ( $atts['width'] > $defaults_atts['width'] ) {
1747
- $atts['height'] = round( ( $atts['height'] * $defaults_atts['width'] ) / $atts['width'] );
1748
- $atts['width'] = $defaults_atts['width'];
1749
- }
1750
- } else {
1751
- // if the video is bigger than the theme
1752
- if ( ! empty( $content_width ) && $atts['width'] > $content_width ) {
1753
- $atts['height'] = round( ( $atts['height'] * $content_width ) / $atts['width'] );
1754
- $atts['width'] = $content_width;
1755
- }
1756
- }
1757
-
1758
- $yt_pattern = '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#';
1759
-
1760
- $primary = false;
1761
- if ( ! empty( $atts['src'] ) ) {
1762
- if ( ! preg_match( $yt_pattern, $atts['src'] ) ) {
1763
- $type = wp_check_filetype( $atts['src'], wp_get_mime_types() );
1764
- if ( ! in_array( strtolower( $type['ext'] ), $default_types ) ) {
1765
- return sprintf( '<a class="wp-embedded-video" href="%s">%s</a>', esc_url( $atts['src'] ), esc_html( $atts['src'] ) );
1766
- }
1767
- }
1768
- $primary = true;
1769
- array_unshift( $default_types, 'src' );
1770
- } else {
1771
- foreach ( $default_types as $ext ) {
1772
- if ( ! empty( $atts[ $ext ] ) ) {
1773
- $type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() );
1774
- if ( strtolower( $type['ext'] ) === $ext ) {
1775
- $primary = true;
1776
- }
1777
- }
1778
- }
1779
- }
1780
-
1781
- if ( ! $primary ) {
1782
- $videos = get_attached_media( 'video', $post_id );
1783
- if ( empty( $videos ) ) {
1784
- return;
1785
- }
1786
-
1787
- $video = reset( $videos );
1788
- $atts['src'] = wp_get_attachment_url( $video->ID );
1789
- if ( empty( $atts['src'] ) ) {
1790
- return;
1791
- }
1792
-
1793
- array_unshift( $default_types, 'src' );
1794
- }
1795
-
1796
- /**
1797
- * Filter the media library used for the video shortcode.
1798
- *
1799
- * @since 3.6.0
1800
- *
1801
- * @param string $library Media library used for the video shortcode.
1802
- */
1803
- $library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' );
1804
- if ( 'mediaelement' === $library && did_action( 'init' ) ) {
1805
- wp_enqueue_style( 'wp-mediaelement' );
1806
- wp_enqueue_script( 'wp-mediaelement' );
1807
- }
1808
-
1809
- /**
1810
- * Filter the class attribute for the video shortcode output container.
1811
- *
1812
- * @since 3.6.0
1813
- *
1814
- * @param string $class CSS class or list of space-separated classes.
1815
- */
1816
- $html_atts = array(
1817
- 'class' => apply_filters( 'wp_video_shortcode_class', 'wp-video-shortcode' ),
1818
- 'id' => sprintf( 'video-%d-%d', $post_id, $instances ),
1819
- 'width' => absint( $atts['width'] ),
1820
- 'height' => absint( $atts['height'] ),
1821
- 'poster' => esc_url( $atts['poster'] ),
1822
- 'loop' => $atts['loop'],
1823
- 'autoplay' => $atts['autoplay'],
1824
- 'preload' => $atts['preload'],
1825
- );
1826
-
1827
- // These ones should just be omitted altogether if they are blank
1828
- foreach ( array( 'poster', 'loop', 'autoplay', 'preload' ) as $a ) {
1829
- if ( empty( $html_atts[$a] ) ) {
1830
- unset( $html_atts[$a] );
1831
- }
1832
- }
1833
-
1834
- $attr_strings = array();
1835
- foreach ( $html_atts as $k => $v ) {
1836
- $attr_strings[] = $k . '="' . esc_attr( $v ) . '"';
1837
- }
1838
-
1839
- $html = '';
1840
- if ( 'mediaelement' === $library && 1 === $instances ) {
1841
- $html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n";
1842
- }
1843
- $html .= sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) );
1844
-
1845
- $fileurl = '';
1846
- $source = '<source type="%s" src="%s" />';
1847
- foreach ( $default_types as $fallback ) {
1848
- if ( ! empty( $atts[ $fallback ] ) ) {
1849
- if ( empty( $fileurl ) ) {
1850
- $fileurl = $atts[ $fallback ];
1851
- }
1852
- if ( 'src' === $fallback && preg_match( $yt_pattern, $atts['src'] ) ) {
1853
- $type = array( 'type' => 'video/youtube' );
1854
- } else {
1855
- $type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() );
1856
- }
1857
- $url = add_query_arg( '_', $instances, $atts[ $fallback ] );
1858
- $html .= sprintf( $source, $type['type'], esc_url( $url ) );
1859
- }
1860
- }
1861
-
1862
- if ( ! empty( $content ) ) {
1863
- if ( false !== strpos( $content, "\n" ) ) {
1864
- $content = str_replace( array( "\r\n", "\n", "\t" ), '', $content );
1865
- }
1866
- $html .= trim( $content );
1867
- }
1868
-
1869
- if ( 'mediaelement' === $library ) {
1870
- $html .= wp_mediaelement_fallback( $fileurl );
1871
- }
1872
- $html .= '</video>';
1873
-
1874
- $width_rule = $height_rule = '';
1875
- if ( ! empty( $atts['width'] ) ) {
1876
- $width_rule = sprintf( 'width: %dpx; ', $atts['width'] );
1877
- }
1878
- if ( ! empty( $atts['height'] ) ) {
1879
- $height_rule = sprintf( 'height: %dpx; ', $atts['height'] );
1880
- }
1881
- $output = sprintf( '<div style="%s%s" class="wp-video">%s</div>', $width_rule, $height_rule, $html );
1882
-
1883
- /**
1884
- * Filter the output of the video shortcode.
1885
- *
1886
- * @since 3.6.0
1887
- *
1888
- * @param string $output Video shortcode HTML output.
1889
- * @param array $atts Array of video shortcode attributes.
1890
- * @param string $video Video file.
1891
- * @param int $post_id Post ID.
1892
- * @param string $library Media library used for the video shortcode.
1893
- */
1894
- return apply_filters( 'wp_video_shortcode', $output, $atts, $video, $post_id, $library );
1895
- }
1896
- add_shortcode( 'video', 'wp_video_shortcode' );
1897
-
1898
- /**
1899
- * Display previous image link that has the same post parent.
1900
- *
1901
- * @since 2.5.0
1902
- * @param string $size Optional, default is 'thumbnail'. Size of image, either array or string. 0 or 'none' will default to post_title or $text;
1903
- * @param string $text Optional, default is false. If included, link will reflect $text variable.
1904
- * @return string HTML content.
1905
- */
1906
- function previous_image_link($size = 'thumbnail', $text = false) {
1907
- adjacent_image_link(true, $size, $text);
1908
- }
1909
-
1910
- /**
1911
- * Display next image link that has the same post parent.
1912
- *
1913
- * @since 2.5.0
1914
- * @param string $size Optional, default is 'thumbnail'. Size of image, either array or string. 0 or 'none' will default to post_title or $text;
1915
- * @param string $text Optional, default is false. If included, link will reflect $text variable.
1916
- * @return string HTML content.
1917
- */
1918
- function next_image_link($size = 'thumbnail', $text = false) {
1919
- adjacent_image_link(false, $size, $text);
1920
- }
1921
-
1922
- /**
1923
- * Display next or previous image link that has the same post parent.
1924
- *
1925
- * Retrieves the current attachment object from the $post global.
1926
- *
1927
- * @since 2.5.0
1928
- *
1929
- * @param bool $prev Optional. Default is true to display previous link, false for next.
1930
- */
1931
- function adjacent_image_link($prev = true, $size = 'thumbnail', $text = false) {
1932
- $post = get_post();
1933
- $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
1934
-
1935
- foreach ( $attachments as $k => $attachment ) {
1936
- if ( $attachment->ID == $post->ID ) {
1937
- break;
1938
- }
1939
- }
1940
-
1941
- $output = '';
1942
- $attachment_id = 0;
1943
-
1944
- if ( $attachments ) {
1945
- $k = $prev ? $k - 1 : $k + 1;
1946
-
1947
- if ( isset( $attachments[ $k ] ) ) {
1948
- $attachment_id = $attachments[ $k ]->ID;
1949
- $output = wp_get_attachment_link( $attachment_id, $size, true, false, $text );
1950
- }
1951
- }
1952
-
1953
- $adjacent = $prev ? 'previous' : 'next';
1954
-
1955
- /**
1956
- * Filter the adjacent image link.
1957
- *
1958
- * The dynamic portion of the hook name, $adjacent, refers to the type of adjacency,
1959
- * either 'next', or 'previous'.
1960
- *
1961
- * @since 3.5.0
1962
- *
1963
- * @param string $output Adjacent image HTML markup.
1964
- * @param int $attachment_id Attachment ID
1965
- * @param string $size Image size.
1966
- * @param string $text Link text.
1967
- */
1968
- echo apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );
1969
- }
1970
-
1971
- /**
1972
- * Retrieve taxonomies attached to the attachment.
1973
- *
1974
- * @since 2.5.0
1975
- *
1976
- * @param int|array|object $attachment Attachment ID, Attachment data array, or Attachment data object.
1977
- * @return array Empty array on failure. List of taxonomies on success.
1978
- */
1979
- function get_attachment_taxonomies($attachment) {
1980
- if ( is_int( $attachment ) )
1981
- $attachment = get_post($attachment);
1982
- else if ( is_array($attachment) )
1983
- $attachment = (object) $attachment;
1984
-
1985
- if ( ! is_object($attachment) )
1986
- return array();
1987
-
1988
- $filename = basename($attachment->guid);
1989
-
1990
- $objects = array('attachment');
1991
-
1992
- if ( false !== strpos($filename, '.') )
1993
- $objects[] = 'attachment:' . substr($filename, strrpos($filename, '.') + 1);
1994
- if ( !empty($attachment->post_mime_type) ) {
1995
- $objects[] = 'attachment:' . $attachment->post_mime_type;
1996
- if ( false !== strpos($attachment->post_mime_type, '/') )
1997
- foreach ( explode('/', $attachment->post_mime_type) as $token )
1998
- if ( !empty($token) )
1999
- $objects[] = "attachment:$token";
2000
- }
2001
-
2002
- $taxonomies = array();
2003
- foreach ( $objects as $object )
2004
- if ( $taxes = get_object_taxonomies($object) )
2005
- $taxonomies = array_merge($taxonomies, $taxes);
2006
-
2007
- return array_unique($taxonomies);
2008
- }
2009
-
2010
- /**
2011
- * Return all of the taxonomy names that are registered for attachments.
2012
- *
2013
- * Handles mime-type-specific taxonomies such as attachment:image and attachment:video.
2014
- *
2015
- * @since 3.5.0
2016
- * @see get_attachment_taxonomies()
2017
- * @uses get_taxonomies()
2018
- *
2019
- * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default.
2020
- * @return array The names of all taxonomy of $object_type.
2021
- */
2022
- function get_taxonomies_for_attachments( $output = 'names' ) {
2023
- $taxonomies = array();
2024
- foreach ( get_taxonomies( array(), 'objects' ) as $taxonomy ) {
2025
- foreach ( $taxonomy->object_type as $object_type ) {
2026
- if ( 'attachment' == $object_type || 0 === strpos( $object_type, 'attachment:' ) ) {
2027
- if ( 'names' == $output )
2028
- $taxonomies[] = $taxonomy->name;
2029
- else
2030
- $taxonomies[ $taxonomy->name ] = $taxonomy;
2031
- break;
2032
- }
2033
- }
2034
- }
2035
-
2036
- return $taxonomies;
2037
- }
2038
-
2039
- /**
2040
- * Create new GD image resource with transparency support
2041
- * @TODO: Deprecate if possible.
2042
- *
2043
- * @since 2.9.0
2044
- *
2045
- * @param int $width Image width
2046
- * @param int $height Image height
2047
- * @return image resource
2048
- */
2049
- function wp_imagecreatetruecolor($width, $height) {
2050
- $img = imagecreatetruecolor($width, $height);
2051
- if ( is_resource($img) && function_exists('imagealphablending') && function_exists('imagesavealpha') ) {
2052
- imagealphablending($img, false);
2053
- imagesavealpha($img, true);
2054
- }
2055
- return $img;
2056
- }
2057
-
2058
- /**
2059
- * Register an embed handler. This function should probably only be used for sites that do not support oEmbed.
2060
- *
2061
- * @since 2.9.0
2062
- * @see WP_Embed::register_handler()
2063
- */
2064
- function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
2065
- global $wp_embed;
2066
- $wp_embed->register_handler( $id, $regex, $callback, $priority );
2067
- }
2068
-
2069
- /**
2070
- * Unregister a previously registered embed handler.
2071
- *
2072
- * @since 2.9.0
2073
- * @see WP_Embed::unregister_handler()
2074
- */
2075
- function wp_embed_unregister_handler( $id, $priority = 10 ) {
2076
- global $wp_embed;
2077
- $wp_embed->unregister_handler( $id, $priority );
2078
- }
2079
-
2080
- /**
2081
- * Create default array of embed parameters.
2082
- *
2083
- * The width defaults to the content width as specified by the theme. If the
2084
- * theme does not specify a content width, then 500px is used.
2085
- *
2086
- * The default height is 1.5 times the width, or 1000px, whichever is smaller.
2087
- *
2088
- * The 'embed_defaults' filter can be used to adjust either of these values.
2089
- *
2090
- * @since 2.9.0
2091
- *
2092
- * @param string $url Optional. The URL that should be embedded. Default empty.
2093
- *
2094
- * @return array Default embed parameters.
2095
- */
2096
- function wp_embed_defaults( $url = '' ) {
2097
- if ( ! empty( $GLOBALS['content_width'] ) )
2098
- $width = (int) $GLOBALS['content_width'];
2099
-
2100
- if ( empty( $width ) )
2101
- $width = 500;
2102
-
2103
- $height = min( ceil( $width * 1.5 ), 1000 );
2104
-
2105
- /**
2106
- * Filter the default array of embed dimensions.
2107
- *
2108
- * @since 2.9.0
2109
- *
2110
- * @param int $width Width of the embed in pixels.
2111
- * @param int $height Height of the embed in pixels.
2112
- * @param string $url The URL that should be embedded.
2113
- */
2114
- return apply_filters( 'embed_defaults', compact( 'width', 'height' ), $url );
2115
- }
2116
-
2117
- /**
2118
- * Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.
2119
- *
2120
- * @since 2.9.0
2121
- * @uses wp_constrain_dimensions() This function passes the widths and the heights.
2122
- *
2123
- * @param int $example_width The width of an example embed.
2124
- * @param int $example_height The height of an example embed.
2125
- * @param int $max_width The maximum allowed width.
2126
- * @param int $max_height The maximum allowed height.
2127
- * @return array The maximum possible width and height based on the example ratio.
2128
- */
2129
- function wp_expand_dimensions( $example_width, $example_height, $max_width, $max_height ) {
2130
- $example_width = (int) $example_width;
2131
- $example_height = (int) $example_height;
2132
- $max_width = (int) $max_width;
2133
- $max_height = (int) $max_height;
2134
-
2135
- return wp_constrain_dimensions( $example_width * 1000000, $example_height * 1000000, $max_width, $max_height );
2136
- }
2137
-
2138
- /**
2139
- * Attempts to fetch the embed HTML for a provided URL using oEmbed.
2140
- *
2141
- * @since 2.9.0
2142
- * @see WP_oEmbed
2143
- *
2144
- * @uses _wp_oembed_get_object()
2145
- * @uses WP_oEmbed::get_html()
2146
- *
2147
- * @param string $url The URL that should be embedded.
2148
- * @param array $args Additional arguments and parameters.
2149
- * @return bool|string False on failure or the embed HTML on success.
2150
- */
2151
- function wp_oembed_get( $url, $args = '' ) {
2152
- require_once( ABSPATH . WPINC . '/class-oembed.php' );
2153
- $oembed = _wp_oembed_get_object();
2154
- return $oembed->get_html( $url, $args );
2155
- }
2156
-
2157
- /**
2158
- * Adds a URL format and oEmbed provider URL pair.
2159
- *
2160
- * @since 2.9.0
2161
- * @see WP_oEmbed
2162
- *
2163
- * @uses _wp_oembed_get_object()
2164
- *
2165
- * @param string $format The format of URL that this provider can handle. You can use asterisks as wildcards.
2166
- * @param string $provider The URL to the oEmbed provider.
2167
- * @param boolean $regex Whether the $format parameter is in a regex format.
2168
- */
2169
- function wp_oembed_add_provider( $format, $provider, $regex = false ) {
2170
- require_once( ABSPATH . WPINC . '/class-oembed.php' );
2171
-
2172
- if ( did_action( 'plugins_loaded' ) ) {
2173
- $oembed = _wp_oembed_get_object();
2174
- $oembed->providers[$format] = array( $provider, $regex );
2175
- } else {
2176
- WP_oEmbed::_add_provider_early( $format, $provider, $regex );
2177
- }
2178
- }
2179
-
2180
- /**
2181
- * Removes an oEmbed provider.
2182
- *
2183
- * @since 3.5.0
2184
- * @see WP_oEmbed
2185
- *
2186
- * @uses _wp_oembed_get_object()
2187
- *
2188
- * @param string $format The URL format for the oEmbed provider to remove.
2189
- */
2190
- function wp_oembed_remove_provider( $format ) {
2191
- require_once( ABSPATH . WPINC . '/class-oembed.php' );
2192
-
2193
- if ( did_action( 'plugins_loaded' ) ) {
2194
- $oembed = _wp_oembed_get_object();
2195
-
2196
- if ( isset( $oembed->providers[ $format ] ) ) {
2197
- unset( $oembed->providers[ $format ] );
2198
- return true;
2199
- }
2200
- } else {
2201
- WP_oEmbed::_remove_provider_early( $format );
2202
- }
2203
-
2204
- return false;
2205
- }
2206
-
2207
- /**
2208
- * Determines if default embed handlers should be loaded.
2209
- *
2210
- * Checks to make sure that the embeds library hasn't already been loaded. If
2211
- * it hasn't, then it will load the embeds library.
2212
- *
2213
- * @since 2.9.0
2214
- */
2215
- function wp_maybe_load_embeds() {
2216
- /**
2217
- * Filter whether to load the default embed handlers.
2218
- *
2219
- * Returning a falsey value will prevent loading the default embed handlers.
2220
- *
2221
- * @since 2.9.0
2222
- *
2223
- * @param bool $maybe_load_embeds Whether to load the embeds library. Default true.
2224
- */
2225
- if ( ! apply_filters( 'load_default_embeds', true ) ) {
2226
- return;
2227
- }
2228
-
2229
- wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/embed/([^/]+)#i', 'wp_embed_handler_youtube' );
2230
-
2231
- wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
2232
-
2233
- /**
2234
- * Filter the audio embed handler callback.
2235
- *
2236
- * @since 3.6.0
2237
- *
2238
- * @param callback $handler Audio embed handler callback function.
2239
- */
2240
- wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . join( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 );
2241
-
2242
- /**
2243
- * Filter the video embed handler callback.
2244
- *
2245
- * @since 3.6.0
2246
- *
2247
- * @param callback $handler Video embed handler callback function.
2248
- */
2249
- wp_embed_register_handler( 'video', '#^https?://.+?\.(' . join( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );
2250
- }
2251
-
2252
- /**
2253
- * The Google Video embed handler callback. Google Video does not support oEmbed.
2254
- *
2255
- * @see WP_Embed::register_handler()
2256
- * @see WP_Embed::shortcode()
2257
- *
2258
- * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
2259
- * @param array $attr Embed attributes.
2260
- * @param string $url The original URL that was matched by the regex.
2261
- * @param array $rawattr The original unmodified attributes.
2262
- * @return string The embed HTML.
2263
- */
2264
- function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
2265
- // If the user supplied a fixed width AND height, use it
2266
- if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {
2267
- $width = (int) $rawattr['width'];
2268
- $height = (int) $rawattr['height'];
2269
- } else {
2270
- list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] );
2271
- }
2272
-
2273
- /**
2274
- * Filter the Google Video embed output.
2275
- *
2276
- * @since 2.9.0
2277
- *
2278
- * @param string $html Google Video HTML embed markup.
2279
- * @param array $matches The regex matches from the provided regex.
2280
- * @param array $attr An array of embed attributes.
2281
- * @param string $url The original URL that was matched by the regex.
2282
- * @param array $rawattr The original unmodified attributes.
2283
- */
2284
- return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&amp;hl=en&amp;fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always" />', $matches, $attr, $url, $rawattr );
2285
- }
2286
-
2287
- /**
2288
- * YouTube embed handler callback.
2289
- *
2290
- * Catches URLs that can be parsed but aren't supported by oEmbed.
2291
- *
2292
- * @since 4.0.0
2293
- *
2294
- * @param array $matches The regex matches from the provided regex when calling
2295
- * {@see wp_embed_register_handler()}.
2296
- * @param array $attr Embed attributes.
2297
- * @param string $url The original URL that was matched by the regex.
2298
- * @param array $rawattr The original unmodified attributes.
2299
- * @return string The embed HTML.
2300
- */
2301
- function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
2302
- global $wp_embed;
2303
- $embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" );
2304
- /**
2305
- * Filter the YoutTube embed output.
2306
- *
2307
- * @since 4.0.0
2308
- *
2309
- * @see wp_embed_handler_youtube()
2310
- *
2311
- * @param string $embed YouTube embed output.
2312
- * @param array $attr An array of embed attributes.
2313
- * @param string $url The original URL that was matched by the regex.
2314
- * @param array $rawattr The original unmodified attributes.
2315
- */
2316
- return apply_filters( 'wp_embed_handler_youtube', $embed, $attr, $url, $rawattr );
2317
- }
2318
-
2319
- /**
2320
- * Audio embed handler callback.
2321
- *
2322
- * @since 3.6.0
2323
- *
2324
- * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
2325
- * @param array $attr Embed attributes.
2326
- * @param string $url The original URL that was matched by the regex.
2327
- * @param array $rawattr The original unmodified attributes.
2328
- * @return string The embed HTML.
2329
- */
2330
- function wp_embed_handler_audio( $matches, $attr, $url, $rawattr ) {
2331
- $audio = sprintf( '[audio src="%s" /]', esc_url( $url ) );
2332
-
2333
- /**
2334
- * Filter the audio embed output.
2335
- *
2336
- * @since 3.6.0
2337
- *
2338
- * @param string $audio Audio embed output.
2339
- * @param array $attr An array of embed attributes.
2340
- * @param string $url The original URL that was matched by the regex.
2341
- * @param array $rawattr The original unmodified attributes.
2342
- */
2343
- return apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr );
2344
- }
2345
-
2346
- /**
2347
- * Video embed handler callback.
2348
- *
2349
- * @since 3.6.0
2350
- *
2351
- * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
2352
- * @param array $attr Embed attributes.
2353
- * @param string $url The original URL that was matched by the regex.
2354
- * @param array $rawattr The original unmodified attributes.
2355
- * @return string The embed HTML.
2356
- */
2357
- function wp_embed_handler_video( $matches, $attr, $url, $rawattr ) {
2358
- $dimensions = '';
2359
- if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {
2360
- $dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] );
2361
- $dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] );
2362
- }
2363
- $video = sprintf( '[video %s src="%s" /]', $dimensions, esc_url( $url ) );
2364
-
2365
- /**
2366
- * Filter the video embed output.
2367
- *
2368
- * @since 3.6.0
2369
- *
2370
- * @param string $video Video embed output.
2371
- * @param array $attr An array of embed attributes.
2372
- * @param string $url The original URL that was matched by the regex.
2373
- * @param array $rawattr The original unmodified attributes.
2374
- */
2375
- return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr );
2376
- }
2377
-
2378
- /**
2379
- * Converts a shorthand byte value to an integer byte value.
2380
- *
2381
- * @since 2.3.0
2382
- *
2383
- * @param string $size A shorthand byte value.
2384
- * @return int An integer byte value.
2385
- */
2386
- function wp_convert_hr_to_bytes( $size ) {
2387
- $size = strtolower( $size );
2388
- $bytes = (int) $size;
2389
- if ( strpos( $size, 'k' ) !== false )
2390
- $bytes = intval( $size ) * 1024;
2391
- elseif ( strpos( $size, 'm' ) !== false )
2392
- $bytes = intval($size) * 1024 * 1024;
2393
- elseif ( strpos( $size, 'g' ) !== false )
2394
- $bytes = intval( $size ) * 1024 * 1024 * 1024;
2395
- return $bytes;
2396
- }
2397
-
2398
- /**
2399
- * Determine the maximum upload size allowed in php.ini.
2400
- *
2401
- * @since 2.5.0
2402
- *
2403
- * @return int Allowed upload size.
2404
- */
2405
- function wp_max_upload_size() {
2406
- $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
2407
- $p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );
2408
-
2409
- /**
2410
- * Filter the maximum upload size allowed in php.ini.
2411
- *
2412
- * @since 2.5.0
2413
- *
2414
- * @param int $size Max upload size limit in bytes.
2415
- * @param int $u_bytes Maximum upload filesize in bytes.
2416
- * @param int $p_bytes Maximum size of POST data in bytes.
2417
- */
2418
- return apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes );
2419
- }
2420
-
2421
- /**
2422
- * Returns a WP_Image_Editor instance and loads file into it.
2423
- *
2424
- * @since 3.5.0
2425
- * @access public
2426
- *
2427
- * @param string $path Path to file to load
2428
- * @param array $args Additional data. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} }
2429
- * @return WP_Image_Editor|WP_Error
2430
- */
2431
- function wp_get_image_editor( $path, $args = array() ) {
2432
- $args['path'] = $path;
2433
-
2434
- if ( ! isset( $args['mime_type'] ) ) {
2435
- $file_info = wp_check_filetype( $args['path'] );
2436
-
2437
- // If $file_info['type'] is false, then we let the editor attempt to
2438
- // figure out the file type, rather than forcing a failure based on extension.
2439
- if ( isset( $file_info ) && $file_info['type'] )
2440
- $args['mime_type'] = $file_info['type'];
2441
- }
2442
-
2443
- $implementation = _wp_image_editor_choose( $args );
2444
-
2445
- if ( $implementation ) {
2446
- $editor = new $implementation( $path );
2447
- $loaded = $editor->load();
2448
-
2449
- if ( is_wp_error( $loaded ) )
2450
- return $loaded;
2451
-
2452
- return $editor;
2453
- }
2454
-
2455
- return new WP_Error( 'image_no_editor', __('No editor could be selected.') );
2456
- }
2457
-
2458
- /**
2459
- * Tests whether there is an editor that supports a given mime type or methods.
2460
- *
2461
- * @since 3.5.0
2462
- * @access public
2463
- *
2464
- * @param string|array $args Array of requirements. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} }
2465
- * @return boolean true if an eligible editor is found; false otherwise
2466
- */
2467
- function wp_image_editor_supports( $args = array() ) {
2468
- return (bool) _wp_image_editor_choose( $args );
2469
- }
2470
-
2471
- /**
2472
- * Tests which editors are capable of supporting the request.
2473
- *
2474
- * @since 3.5.0
2475
- * @access private
2476
- *
2477
- * @param array $args Additional data. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} }
2478
- * @return string|bool Class name for the first editor that claims to support the request. False if no editor claims to support the request.
2479
- */
2480
- function _wp_image_editor_choose( $args = array() ) {
2481
- require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
2482
- require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';
2483
- require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php';
2484
-
2485
- /**
2486
- * Filter the list of image editing library classes.
2487
- *
2488
- * @since 3.5.0
2489
- *
2490
- * @param array $image_editors List of available image editors. Defaults are
2491
- * 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD'.
2492
- */
2493
- $implementations = apply_filters( 'wp_image_editors', array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) );
2494
-
2495
- foreach ( $implementations as $implementation ) {
2496
- if ( ! call_user_func( array( $implementation, 'test' ), $args ) )
2497
- continue;
2498
-
2499
- if ( isset( $args['mime_type'] ) &&
2500
- ! call_user_func(
2501
- array( $implementation, 'supports_mime_type' ),
2502
- $args['mime_type'] ) ) {
2503
- continue;
2504
- }
2505
-
2506
- if ( isset( $args['methods'] ) &&
2507
- array_diff( $args['methods'], get_class_methods( $implementation ) ) ) {
2508
- continue;
2509
- }
2510
-
2511
- return $implementation;
2512
- }
2513
-
2514
- return false;
2515
- }
2516
-
2517
- /**
2518
- * Prints default plupload arguments.
2519
- *
2520
- * @since 3.4.0
2521
- */
2522
- function wp_plupload_default_settings() {
2523
- global $wp_scripts;
2524
-
2525
- $data = $wp_scripts->get_data( 'wp-plupload', 'data' );
2526
- if ( $data && false !== strpos( $data, '_wpPluploadSettings' ) )
2527
- return;
2528
-
2529
- $max_upload_size = wp_max_upload_size();
2530
-
2531
- $defaults = array(
2532
- 'runtimes' => 'html5,flash,silverlight,html4',
2533
- 'file_data_name' => 'async-upload', // key passed to $_FILE.
2534
- 'url' => admin_url( 'async-upload.php', 'relative' ),
2535
- 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
2536
- 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
2537
- 'filters' => array(
2538
- 'max_file_size' => $max_upload_size . 'b',
2539
- ),
2540
- );
2541
-
2542
- // Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos
2543
- // when enabled. See #29602.
2544
- if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&
2545
- strpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) {
2546
-
2547
- $defaults['multi_selection'] = false;
2548
- }
2549
-
2550
- /**
2551
- * Filter the Plupload default settings.
2552
- *
2553
- * @since 3.4.0
2554
- *
2555
- * @param array $defaults Default Plupload settings array.
2556
- */
2557
- $defaults = apply_filters( 'plupload_default_settings', $defaults );
2558
-
2559
- $params = array(
2560
- 'action' => 'upload-attachment',
2561
- );
2562
-
2563
- /**
2564
- * Filter the Plupload default parameters.
2565
- *
2566
- * @since 3.4.0
2567
- *
2568
- * @param array $params Default Plupload parameters array.
2569
- */
2570
- $params = apply_filters( 'plupload_default_params', $params );
2571
- $params['_wpnonce'] = wp_create_nonce( 'media-form' );
2572
- $defaults['multipart_params'] = $params;
2573
-
2574
- $settings = array(
2575
- 'defaults' => $defaults,
2576
- 'browser' => array(
2577
- 'mobile' => wp_is_mobile(),
2578
- 'supported' => _device_can_upload(),
2579
- ),
2580
- 'limitExceeded' => is_multisite() && ! is_upload_space_available()
2581
- );
2582
-
2583
- $script = 'var _wpPluploadSettings = ' . json_encode( $settings ) . ';';
2584
-
2585
- if ( $data )
2586
- $script = "$data\n$script";
2587
-
2588
- $wp_scripts->add_data( 'wp-plupload', 'data', $script );
2589
- }
2590
- add_action( 'customize_controls_enqueue_scripts', 'wp_plupload_default_settings' );
2591
-
2592
- /**
2593
- * Prepares an attachment post object for JS, where it is expected
2594
- * to be JSON-encoded and fit into an Attachment model.
2595
- *
2596
- * @since 3.5.0
2597
- *
2598
- * @param mixed $attachment Attachment ID or object.
2599
- * @return array Array of attachment details.
2600
- */
2601
- function wp_prepare_attachment_for_js( $attachment ) {
2602
- if ( ! $attachment = get_post( $attachment ) )
2603
- return;
2604
-
2605
- if ( 'attachment' != $attachment->post_type )
2606
- return;
2607
-
2608
- $meta = wp_get_attachment_metadata( $attachment->ID );
2609
- if ( false !== strpos( $attachment->post_mime_type, '/' ) )
2610
- list( $type, $subtype ) = explode( '/', $attachment->post_mime_type );
2611
- else
2612
- list( $type, $subtype ) = array( $attachment->post_mime_type, '' );
2613
-
2614
- $attachment_url = wp_get_attachment_url( $attachment->ID );
2615
-
2616
- $response = array(
2617
- 'id' => $attachment->ID,
2618
- 'title' => $attachment->post_title,
2619
- 'filename' => wp_basename( $attachment->guid ),
2620
- 'url' => $attachment_url,
2621
- 'link' => get_attachment_link( $attachment->ID ),
2622
- 'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
2623
- 'author' => $attachment->post_author,
2624
- 'description' => $attachment->post_content,
2625
- 'caption' => $attachment->post_excerpt,
2626
- 'name' => $attachment->post_name,
2627
- 'status' => $attachment->post_status,
2628
- 'uploadedTo' => $attachment->post_parent,
2629
- 'date' => strtotime( $attachment->post_date_gmt ) * 1000,
2630
- 'modified' => strtotime( $attachment->post_modified_gmt ) * 1000,
2631
- 'menuOrder' => $attachment->menu_order,
2632
- 'mime' => $attachment->post_mime_type,
2633
- 'type' => $type,
2634
- 'subtype' => $subtype,
2635
- 'icon' => wp_mime_type_icon( $attachment->ID ),
2636
- 'dateFormatted' => mysql2date( get_option('date_format'), $attachment->post_date ),
2637
- 'nonces' => array(
2638
- 'update' => false,
2639
- 'delete' => false,
2640
- 'edit' => false
2641
- ),
2642
- 'editLink' => false,
2643
- 'meta' => false,
2644
- );
2645
-
2646
- $author = new WP_User( $attachment->post_author );
2647
- $response['authorName'] = $author->display_name;
2648
-
2649
- if ( $attachment->post_parent ) {
2650
- $post_parent = get_post( $attachment->post_parent );
2651
- } else {
2652
- $post_parent = false;
2653
- }
2654
-
2655
- if ( $post_parent ) {
2656
- $parent_type = get_post_type_object( $post_parent->post_type );
2657
- if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $attachment->post_parent ) ) {
2658
- $response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' );
2659
- }
2660
- $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' );
2661
- }
2662
-
2663
- $attached_file = get_attached_file( $attachment->ID );
2664
- if ( file_exists( $attached_file ) ) {
2665
- $bytes = filesize( $attached_file );
2666
- $response['filesizeInBytes'] = $bytes;
2667
- $response['filesizeHumanReadable'] = size_format( $bytes );
2668
- }
2669
-
2670
- if ( current_user_can( 'edit_post', $attachment->ID ) ) {
2671
- $response['nonces']['update'] = wp_create_nonce( 'update-post_' . $attachment->ID );
2672
- $response['nonces']['edit'] = wp_create_nonce( 'image_editor-' . $attachment->ID );
2673
- $response['editLink'] = get_edit_post_link( $attachment->ID, 'raw' );
2674
- }
2675
-
2676
- if ( current_user_can( 'delete_post', $attachment->ID ) )
2677
- $response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID );
2678
-
2679
- if ( $meta && 'image' === $type ) {
2680
- $sizes = array();
2681
-
2682
- /** This filter is documented in wp-admin/includes/media.php */
2683
- $possible_sizes = apply_filters( 'image_size_names_choose', array(
2684
- 'thumbnail' => __('Thumbnail'),
2685
- 'medium' => __('Medium'),
2686
- 'large' => __('Large'),
2687
- 'full' => __('Full Size'),
2688
- ) );
2689
- unset( $possible_sizes['full'] );
2690
-
2691
- // Loop through all potential sizes that may be chosen. Try to do this with some efficiency.
2692
- // First: run the image_downsize filter. If it returns something, we can use its data.
2693
- // If the filter does not return something, then image_downsize() is just an expensive
2694
- // way to check the image metadata, which we do second.
2695
- foreach ( $possible_sizes as $size => $label ) {
2696
-
2697
- /** This filter is documented in wp-includes/media.php */
2698
- if ( $downsize = apply_filters( 'image_downsize', false, $attachment->ID, $size ) ) {
2699
- if ( ! $downsize[3] )
2700
- continue;
2701
- $sizes[ $size ] = array(
2702
- 'height' => $downsize[2],
2703
- 'width' => $downsize[1],
2704
- 'url' => $downsize[0],
2705
- 'orientation' => $downsize[2] > $downsize[1] ? 'portrait' : 'landscape',
2706
- );
2707
- } elseif ( isset( $meta['sizes'][ $size ] ) ) {
2708
- if ( ! isset( $base_url ) )
2709
- $base_url = str_replace( wp_basename( $attachment_url ), '', $attachment_url );
2710
-
2711
- // Nothing from the filter, so consult image metadata if we have it.
2712
- $size_meta = $meta['sizes'][ $size ];
2713
-
2714
- // We have the actual image size, but might need to further constrain it if content_width is narrower.
2715
- // Thumbnail, medium, and full sizes are also checked against the site's height/width options.
2716
- list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, 'edit' );
2717
-
2718
- $sizes[ $size ] = array(
2719
- 'height' => $height,
2720
- 'width' => $width,
2721
- 'url' => $base_url . $size_meta['file'],
2722
- 'orientation' => $height > $width ? 'portrait' : 'landscape',
2723
- );
2724
- }
2725
- }
2726
-
2727
- $sizes['full'] = array( 'url' => $attachment_url );
2728
-
2729
- if ( isset( $meta['height'], $meta['width'] ) ) {
2730
- $sizes['full']['height'] = $meta['height'];
2731
- $sizes['full']['width'] = $meta['width'];
2732
- $sizes['full']['orientation'] = $meta['height'] > $meta['width'] ? 'portrait' : 'landscape';
2733
- }
2734
-
2735
- $response = array_merge( $response, array( 'sizes' => $sizes ), $sizes['full'] );
2736
- } elseif ( $meta && 'video' === $type ) {
2737
- if ( isset( $meta['width'] ) )
2738
- $response['width'] = (int) $meta['width'];
2739
- if ( isset( $meta['height'] ) )
2740
- $response['height'] = (int) $meta['height'];
2741
- }
2742
-
2743
- if ( $meta && ( 'audio' === $type || 'video' === $type ) ) {
2744
- if ( isset( $meta['length_formatted'] ) )
2745
- $response['fileLength'] = $meta['length_formatted'];
2746
-
2747
- $response['meta'] = array();
2748
- foreach ( wp_get_attachment_id3_keys( $attachment, 'js' ) as $key => $label ) {
2749
- $response['meta'][ $key ] = false;
2750
-
2751
- if ( ! empty( $meta[ $key ] ) ) {
2752
- $response['meta'][ $key ] = $meta[ $key ];
2753
- }
2754
- }
2755
-
2756
- $id = get_post_thumbnail_id( $attachment->ID );
2757
- if ( ! empty( $id ) ) {
2758
- list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'full' );
2759
- $response['image'] = compact( 'src', 'width', 'height' );
2760
- list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'thumbnail' );
2761
- $response['thumb'] = compact( 'src', 'width', 'height' );
2762
- } else {
2763
- $src = wp_mime_type_icon( $attachment->ID );
2764
- $width = 48;
2765
- $height = 64;
2766
- $response['image'] = compact( 'src', 'width', 'height' );
2767
- $response['thumb'] = compact( 'src', 'width', 'height' );
2768
- }
2769
- }
2770
-
2771
- if ( function_exists('get_compat_media_markup') )
2772
- $response['compat'] = get_compat_media_markup( $attachment->ID, array( 'in_modal' => true ) );
2773
-
2774
- /**
2775
- * Filter the attachment data prepared for JavaScript.
2776
- *
2777
- * @since 3.5.0
2778
- *
2779
- * @param array $response Array of prepared attachment data.
2780
- * @param int|object $attachment Attachment ID or object.
2781
- * @param array $meta Array of attachment meta data.
2782
- */
2783
- return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );
2784
- }
2785
-
2786
- /**
2787
- * Enqueues all scripts, styles, settings, and templates necessary to use
2788
- * all media JS APIs.
2789
- *
2790
- * @since 3.5.0
2791
- */
2792
- function wp_enqueue_media( $args = array() ) {
2793
-
2794
- // Enqueue me just once per page, please.
2795
- if ( did_action( 'wp_enqueue_media' ) )
2796
- return;
2797
-
2798
- global $content_width, $wpdb, $wp_locale;
2799
-
2800
- $defaults = array(
2801
- 'post' => null,
2802
- );
2803
- $args = wp_parse_args( $args, $defaults );
2804
-
2805
- // We're going to pass the old thickbox media tabs to `media_upload_tabs`
2806
- // to ensure plugins will work. We will then unset those tabs.
2807
- $tabs = array(
2808
- // handler action suffix => tab label
2809
- 'type' => '',
2810
- 'type_url' => '',
2811
- 'gallery' => '',
2812
- 'library' => '',
2813
- );
2814
-
2815
- /** This filter is documented in wp-admin/includes/media.php */
2816
- $tabs = apply_filters( 'media_upload_tabs', $tabs );
2817
- unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] );
2818
-
2819
- $props = array(
2820
- 'link' => get_option( 'image_default_link_type' ), // db default is 'file'
2821
- 'align' => get_option( 'image_default_align' ), // empty default
2822
- 'size' => get_option( 'image_default_size' ), // empty default
2823
- );
2824
-
2825
- $exts = array_merge( wp_get_audio_extensions(), wp_get_video_extensions() );
2826
- $mimes = get_allowed_mime_types();
2827
- $ext_mimes = array();
2828
- foreach ( $exts as $ext ) {
2829
- foreach ( $mimes as $ext_preg => $mime_match ) {
2830
- if ( preg_match( '#' . $ext . '#i', $ext_preg ) ) {
2831
- $ext_mimes[ $ext ] = $mime_match;
2832
- break;
2833
- }
2834
- }
2835
- }
2836
-
2837
- $has_audio = $wpdb->get_var( "
2838
- SELECT ID
2839
- FROM $wpdb->posts
2840
- WHERE post_type = 'attachment'
2841
- AND post_mime_type LIKE 'audio%'
2842
- LIMIT 1
2843
- " );
2844
- $has_video = $wpdb->get_var( "
2845
- SELECT ID
2846
- FROM $wpdb->posts
2847
- WHERE post_type = 'attachment'
2848
- AND post_mime_type LIKE 'video%'
2849
- LIMIT 1
2850
- " );
2851
- $months = $wpdb->get_results( $wpdb->prepare( "
2852
- SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
2853
- FROM $wpdb->posts
2854
- WHERE post_type = %s
2855
- ORDER BY post_date DESC
2856
- ", 'attachment' ) );
2857
- foreach ( $months as $month_year ) {
2858
- $month_year->text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month_year->month ), $month_year->year );
2859
- }
2860
-
2861
- $settings = array(
2862
- 'tabs' => $tabs,
2863
- 'tabUrl' => add_query_arg( array( 'chromeless' => true ), admin_url('media-upload.php') ),
2864
- 'mimeTypes' => wp_list_pluck( get_post_mime_types(), 0 ),
2865
- /** This filter is documented in wp-admin/includes/media.php */
2866
- 'captions' => ! apply_filters( 'disable_captions', '' ),
2867
- 'nonce' => array(
2868
- 'sendToEditor' => wp_create_nonce( 'media-send-to-editor' ),
2869
- ),
2870
- 'post' => array(
2871
- 'id' => 0,
2872
- ),
2873
- 'defaultProps' => $props,
2874
- 'attachmentCounts' => array(
2875
- 'audio' => ( $has_audio ) ? 1 : 0,
2876
- 'video' => ( $has_video ) ? 1 : 0
2877
- ),
2878
- 'embedExts' => $exts,
2879
- 'embedMimes' => $ext_mimes,
2880
- 'contentWidth' => $content_width,
2881
- 'months' => $months,
2882
- 'mediaTrash' => MEDIA_TRASH ? 1 : 0
2883
- );
2884
-
2885
- $post = null;
2886
- if ( isset( $args['post'] ) ) {
2887
- $post = get_post( $args['post'] );
2888
- $settings['post'] = array(
2889
- 'id' => $post->ID,
2890
- 'nonce' => wp_create_nonce( 'update-post_' . $post->ID ),
2891
- );
2892
-
2893
- $thumbnail_support = current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' );
2894
- if ( ! $thumbnail_support && 'attachment' === $post->post_type && $post->post_mime_type ) {
2895
- if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) {
2896
- $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
2897
- } elseif ( 0 === strpos( $post->post_mime_type, 'video/' ) ) {
2898
- $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
2899
- }
2900
- }
2901
-
2902
- if ( $thumbnail_support ) {
2903
- $featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true );
2904
- $settings['post']['featuredImageId'] = $featured_image_id ? $featured_image_id : -1;
2905
- }
2906
- }
2907
-
2908
- $hier = $post && is_post_type_hierarchical( $post->post_type );
2909
-
2910
- $strings = array(
2911
- // Generic
2912
- 'url' => __( 'URL' ),
2913
- 'addMedia' => __( 'Add Media' ),
2914
- 'search' => __( 'Search' ),
2915
- 'select' => __( 'Select' ),
2916
- 'cancel' => __( 'Cancel' ),
2917
- 'update' => __( 'Update' ),
2918
- 'replace' => __( 'Replace' ),
2919
- 'remove' => __( 'Remove' ),
2920
- 'back' => __( 'Back' ),
2921
- /* translators: This is a would-be plural string used in the media manager.
2922
- If there is not a word you can use in your language to avoid issues with the
2923
- lack of plural support here, turn it into "selected: %d" then translate it.
2924
- */
2925
- 'selected' => __( '%d selected' ),
2926
- 'dragInfo' => __( 'Drag and drop to reorder images.' ),
2927
-
2928
- // Upload
2929
- 'uploadFilesTitle' => __( 'Upload Files' ),
2930
- 'uploadImagesTitle' => __( 'Upload Images' ),
2931
-
2932
- // Library
2933
- 'mediaLibraryTitle' => __( 'Media Library' ),
2934
- 'insertMediaTitle' => __( 'Insert Media' ),
2935
- 'createNewGallery' => __( 'Create a new gallery' ),
2936
- 'createNewPlaylist' => __( 'Create a new playlist' ),
2937
- 'createNewVideoPlaylist' => __( 'Create a new video playlist' ),
2938
- 'returnToLibrary' => __( '&#8592; Return to library' ),
2939
- 'allMediaItems' => __( 'All media items' ),
2940
- 'allMediaTypes' => __( 'All media types' ),
2941
- 'allDates' => __( 'All dates' ),
2942
- 'noItemsFound' => __( 'No items found.' ),
2943
- 'insertIntoPost' => $hier ? __( 'Insert into page' ) : __( 'Insert into post' ),
2944
- 'unattached' => __( 'Unattached' ),
2945
- 'trash' => _x( 'Trash', 'noun' ),
2946
- 'uploadedToThisPost' => $hier ? __( 'Uploaded to this page' ) : __( 'Uploaded to this post' ),
2947
- 'warnDelete' => __( "You are about to permanently delete this item.\n 'Cancel' to stop, 'OK' to delete." ),
2948
- 'warnBulkDelete' => __( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ),
2949
- 'warnBulkTrash' => __( "You are about to trash these items.\n 'Cancel' to stop, 'OK' to delete." ),
2950
- 'bulkSelect' => __( 'Bulk Select' ),
2951
- 'cancelSelection' => __( 'Cancel Selection' ),
2952
- 'trashSelected' => __( 'Trash Selected' ),
2953
- 'untrashSelected' => __( 'Untrash Selected' ),
2954
- 'deleteSelected' => __( 'Delete Selected' ),
2955
- 'deletePermanently' => __( 'Delete Permanently' ),
2956
- 'apply' => __( 'Apply' ),
2957
- 'filterByDate' => __( 'Filter by date' ),
2958
- 'filterByType' => __( 'Filter by type' ),
2959
- 'searchMediaLabel' => __( 'Search Media' ),
2960
-
2961
- // Library Details
2962
- 'attachmentDetails' => __( 'Attachment Details' ),
2963
-
2964
- // From URL
2965
- 'insertFromUrlTitle' => __( 'Insert from URL' ),
2966
-
2967
- // Featured Images
2968
- 'setFeaturedImageTitle' => __( 'Set Featured Image' ),
2969
- 'setFeaturedImage' => __( 'Set featured image' ),
2970
-
2971
- // Gallery
2972
- 'createGalleryTitle' => __( 'Create Gallery' ),
2973
- 'editGalleryTitle' => __( 'Edit Gallery' ),
2974
- 'cancelGalleryTitle' => __( '&#8592; Cancel Gallery' ),
2975
- 'insertGallery' => __( 'Insert gallery' ),
2976
- 'updateGallery' => __( 'Update gallery' ),
2977
- 'addToGallery' => __( 'Add to gallery' ),
2978
- 'addToGalleryTitle' => __( 'Add to Gallery' ),
2979
- 'reverseOrder' => __( 'Reverse order' ),
2980
-
2981
- // Edit Image
2982
- 'imageDetailsTitle' => __( 'Image Details' ),
2983
- 'imageReplaceTitle' => __( 'Replace Image' ),
2984
- 'imageDetailsCancel' => __( 'Cancel Edit' ),
2985
- 'editImage' => __( 'Edit Image' ),
2986
-
2987
- // Crop Image
2988
- 'chooseImage' => __( 'Choose Image' ),
2989
- 'selectAndCrop' => __( 'Select and Crop' ),
2990
- 'skipCropping' => __( 'Skip Cropping' ),
2991
- 'cropImage' => __( 'Crop Image' ),
2992
- 'cropYourImage' => __( 'Crop your image' ),
2993
- 'cropping' => __( 'Cropping&hellip;' ),
2994
- 'suggestedDimensions' => __( 'Suggested image dimensions:' ),
2995
- 'cropError' => __( 'There has been an error cropping your image.' ),
2996
-
2997
- // Edit Audio
2998
- 'audioDetailsTitle' => __( 'Audio Details' ),
2999
- 'audioReplaceTitle' => __( 'Replace Audio' ),
3000
- 'audioAddSourceTitle' => __( 'Add Audio Source' ),
3001
- 'audioDetailsCancel' => __( 'Cancel Edit' ),
3002
-
3003
- // Edit Video
3004
- 'videoDetailsTitle' => __( 'Video Details' ),
3005
- 'videoReplaceTitle' => __( 'Replace Video' ),
3006
- 'videoAddSourceTitle' => __( 'Add Video Source' ),
3007
- 'videoDetailsCancel' => __( 'Cancel Edit' ),
3008
- 'videoSelectPosterImageTitle' => __( 'Select Poster Image' ),
3009
- 'videoAddTrackTitle' => __( 'Add Subtitles' ),
3010
-
3011
- // Playlist
3012
- 'playlistDragInfo' => __( 'Drag and drop to reorder tracks.' ),
3013
- 'createPlaylistTitle' => __( 'Create Audio Playlist' ),
3014
- 'editPlaylistTitle' => __( 'Edit Audio Playlist' ),
3015
- 'cancelPlaylistTitle' => __( '&#8592; Cancel Audio Playlist' ),
3016
- 'insertPlaylist' => __( 'Insert audio playlist' ),
3017
- 'updatePlaylist' => __( 'Update audio playlist' ),
3018
- 'addToPlaylist' => __( 'Add to audio playlist' ),
3019
- 'addToPlaylistTitle' => __( 'Add to Audio Playlist' ),
3020
-
3021
- // Video Playlist
3022
- 'videoPlaylistDragInfo' => __( 'Drag and drop to reorder videos.' ),
3023
- 'createVideoPlaylistTitle' => __( 'Create Video Playlist' ),
3024
- 'editVideoPlaylistTitle' => __( 'Edit Video Playlist' ),
3025
- 'cancelVideoPlaylistTitle' => __( '&#8592; Cancel Video Playlist' ),
3026
- 'insertVideoPlaylist' => __( 'Insert video playlist' ),
3027
- 'updateVideoPlaylist' => __( 'Update video playlist' ),
3028
- 'addToVideoPlaylist' => __( 'Add to video playlist' ),
3029
- 'addToVideoPlaylistTitle' => __( 'Add to Video Playlist' ),
3030
-
3031
- // Media Library
3032
- 'editMetadata' => __( 'Edit Metadata' ),
3033
- 'noMedia' => __( 'No media attachments found.' ),
3034
- );
3035
-
3036
- /**
3037
- * Filter the media view settings.
3038
- *
3039
- * @since 3.5.0
3040
- *
3041
- * @param array $settings List of media view settings.
3042
- * @param WP_Post $post Post object.
3043
- */
3044
- $settings = apply_filters( 'media_view_settings', $settings, $post );
3045
-
3046
- /**
3047
- * Filter the media view strings.
3048
- *
3049
- * @since 3.5.0
3050
- *
3051
- * @param array $strings List of media view strings.
3052
- * @param WP_Post $post Post object.
3053
- */
3054
- $strings = apply_filters( 'media_view_strings', $strings, $post );
3055
-
3056
- $strings['settings'] = $settings;
3057
-
3058
- // Ensure we enqueue media-editor first, that way media-views is
3059
- // registered internally before we try to localize it. see #24724.
3060
- wp_enqueue_script( 'media-editor' );
3061
- wp_localize_script( 'media-views', '_wpMediaViewsL10n', $strings );
3062
-
3063
- wp_enqueue_script( 'media-audiovideo' );
3064
- wp_enqueue_style( 'media-views' );
3065
- if ( is_admin() ) {
3066
- wp_enqueue_script( 'mce-view' );
3067
- wp_enqueue_script( 'image-edit' );
3068
- }
3069
- wp_enqueue_style( 'imgareaselect' );
3070
- wp_plupload_default_settings();
3071
-
3072
- require_once ABSPATH . WPINC . '/media-template.php';
3073
- add_action( 'admin_footer', 'wp_print_media_templates' );
3074
- add_action( 'wp_footer', 'wp_print_media_templates' );
3075
- add_action( 'customize_controls_print_footer_scripts', 'wp_print_media_templates' );
3076
-
3077
- /**
3078
- * Fires at the conclusion of wp_enqueue_media().
3079
- *
3080
- * @since 3.5.0
3081
- */
3082
- do_action( 'wp_enqueue_media' );
3083
- }
3084
-
3085
- /**
3086
- * Retrieve media attached to the passed post.
3087
- *
3088
- * @since 3.6.0
3089
- *
3090
- * @param string $type Mime type.
3091
- * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
3092
- * @return array Found attachments.
3093
- */
3094
- function get_attached_media( $type, $post = 0 ) {
3095
- if ( ! $post = get_post( $post ) )
3096
- return array();
3097
-
3098
- $args = array(
3099
- 'post_parent' => $post->ID,
3100
- 'post_type' => 'attachment',
3101
- 'post_mime_type' => $type,
3102
- 'posts_per_page' => -1,
3103
- 'orderby' => 'menu_order',
3104
- 'order' => 'ASC',
3105
- );
3106
-
3107
- /**
3108
- * Filter arguments used to retrieve media attached to the given post.
3109
- *
3110
- * @since 3.6.0
3111
- *
3112
- * @param array $args Post query arguments.
3113
- * @param string $type Mime type of the desired media.
3114
- * @param mixed $post Post ID or object.
3115
- */
3116
- $args = apply_filters( 'get_attached_media_args', $args, $type, $post );
3117
-
3118
- $children = get_children( $args );
3119
-
3120
- /**
3121
- * Filter the list of media attached to the given post.
3122
- *
3123
- * @since 3.6.0
3124
- *
3125
- * @param array $children Associative array of media attached to the given post.
3126
- * @param string $type Mime type of the media desired.
3127
- * @param mixed $post Post ID or object.
3128
- */
3129
- return (array) apply_filters( 'get_attached_media', $children, $type, $post );
3130
- }
3131
-
3132
- /**
3133
- * Check the content blob for an <audio>, <video> <object>, <embed>, or <iframe>
3134
- *
3135
- * @since 3.6.0
3136
- *
3137
- * @param string $content A string which might contain media data.
3138
- * @param array $types array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'
3139
- * @return array A list of found HTML media embeds
3140
- */
3141
- function get_media_embedded_in_content( $content, $types = null ) {
3142
- $html = array();
3143
- $allowed_media_types = array( 'audio', 'video', 'object', 'embed', 'iframe' );
3144
- if ( ! empty( $types ) ) {
3145
- if ( ! is_array( $types ) )
3146
- $types = array( $types );
3147
- $allowed_media_types = array_intersect( $allowed_media_types, $types );
3148
- }
3149
-
3150
- foreach ( $allowed_media_types as $tag ) {
3151
- if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $content, $matches ) ) {
3152
- $html[] = $matches[0];
3153
- }
3154
- }
3155
-
3156
- return $html;
3157
- }
3158
-
3159
- /**
3160
- * Retrieve galleries from the passed post's content.
3161
- *
3162
- * @since 3.6.0
3163
- *
3164
- * @param int|WP_Post $post Optional. Post ID or object.
3165
- * @param bool $html Whether to return HTML or data in the array.
3166
- * @return array A list of arrays, each containing gallery data and srcs parsed
3167
- * from the expanded shortcode.
3168
- */
3169
- function get_post_galleries( $post, $html = true ) {
3170
- if ( ! $post = get_post( $post ) )
3171
- return array();
3172
-
3173
- if ( ! has_shortcode( $post->post_content, 'gallery' ) )
3174
- return array();
3175
-
3176
- $galleries = array();
3177
- if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $matches, PREG_SET_ORDER ) ) {
3178
- foreach ( $matches as $shortcode ) {
3179
- if ( 'gallery' === $shortcode[2] ) {
3180
- $srcs = array();
3181
-
3182
- $gallery = do_shortcode_tag( $shortcode );
3183
- if ( $html ) {
3184
- $galleries[] = $gallery;
3185
- } else {
3186
- preg_match_all( '#src=([\'"])(.+?)\1#is', $gallery, $src, PREG_SET_ORDER );
3187
- if ( ! empty( $src ) ) {
3188
- foreach ( $src as $s )
3189
- $srcs[] = $s[2];
3190
- }
3191
-
3192
- $data = shortcode_parse_atts( $shortcode[3] );
3193
- $data['src'] = array_values( array_unique( $srcs ) );
3194
- $galleries[] = $data;
3195
- }
3196
- }
3197
- }
3198
- }
3199
-
3200
- /**
3201
- * Filter the list of all found galleries in the given post.
3202
- *
3203
- * @since 3.6.0
3204
- *
3205
- * @param array $galleries Associative array of all found post galleries.
3206
- * @param WP_Post $post Post object.
3207
- */
3208
- return apply_filters( 'get_post_galleries', $galleries, $post );
3209
- }
3210
-
3211
- /**
3212
- * Check a specified post's content for gallery and, if present, return the first
3213
- *
3214
- * @since 3.6.0
3215
- *
3216
- * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
3217
- * @param bool $html Whether to return HTML or data.
3218
- * @return string|array Gallery data and srcs parsed from the expanded shortcode.
3219
- */
3220
- function get_post_gallery( $post = 0, $html = true ) {
3221
- $galleries = get_post_galleries( $post, $html );
3222
- $gallery = reset( $galleries );
3223
-
3224
- /**
3225
- * Filter the first-found post gallery.
3226
- *
3227
- * @since 3.6.0
3228
- *
3229
- * @param array $gallery The first-found post gallery.
3230
- * @param int|WP_Post $post Post ID or object.
3231
- * @param array $galleries Associative array of all found post galleries.
3232
- */
3233
- return apply_filters( 'get_post_gallery', $gallery, $post, $galleries );
3234
- }
3235
-
3236
- /**
3237
- * Retrieve the image srcs from galleries from a post's content, if present
3238
- *
3239
- * @since 3.6.0
3240
- *
3241
- * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
3242
- * @return array A list of lists, each containing image srcs parsed.
3243
- * from an expanded shortcode
3244
- */
3245
- function get_post_galleries_images( $post = 0 ) {
3246
- $galleries = get_post_galleries( $post, false );
3247
- return wp_list_pluck( $galleries, 'src' );
3248
- }
3249
-
3250
- /**
3251
- * Check a post's content for galleries and return the image srcs for the first found gallery
3252
- *
3253
- * @since 3.6.0
3254
- *
3255
- * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
3256
- * @return array A list of a gallery's image srcs in order.
3257
- */
3258
- function get_post_gallery_images( $post = 0 ) {
3259
- $gallery = get_post_gallery( $post, false );
3260
- return empty( $gallery['src'] ) ? array() : $gallery['src'];
3261
- }
3262
-
3263
- /**
3264
- * Maybe attempt to generate attachment metadata, if missing.
3265
- *
3266
- * @since 3.9.0
3267
- *
3268
- * @param WP_Post $attachment Attachment object.
3269
- */
3270
- function wp_maybe_generate_attachment_metadata( $attachment ) {
3271
- if ( empty( $attachment ) || ( empty( $attachment->ID ) || ! $attachment_id = (int) $attachment->ID ) ) {
3272
- return;
3273
- }
3274
-
3275
- $file = get_attached_file( $attachment_id );
3276
- $meta = wp_get_attachment_metadata( $attachment_id );
3277
- if ( empty( $meta ) && file_exists( $file ) ) {
3278
- $_meta = get_post_meta( $attachment_id );
3279
- $regeneration_lock = 'wp_generating_att_' . $attachment_id;
3280
- if ( ! array_key_exists( '_wp_attachment_metadata', $_meta ) && ! get_transient( $regeneration_lock ) ) {
3281
- set_transient( $regeneration_lock, $file );
3282
- wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );
3283
- delete_transient( $regeneration_lock );
3284
- }
3285
- }
3286
- }
3287
-
3288
- /**
3289
- * Try to convert an attachment URL into a post ID.
3290
- *
3291
- * @since 4.0.0
3292
- *
3293
- * @global wpdb $wpdb WordPress database access abstraction object.
3294
- *
3295
- * @param string $url The URL to resolve.
3296
- * @return int The found post ID.
3297
- */
3298
- function attachment_url_to_postid( $url ) {
3299
- global $wpdb;
3300
-
3301
- $dir = wp_upload_dir();
3302
- $path = ltrim( $url, $dir['baseurl'] . '/' );
3303
-
3304
- $sql = $wpdb->prepare(
3305
- "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value = %s",
3306
- $path
3307
- );
3308
- $post_id = $wpdb->get_var( $sql );
3309
- if ( ! empty( $post_id ) ) {
3310
- return (int) $post_id;
3311
- }
3312
- }
3313
-
3314
- /**
3315
- * Return the URls for CSS files used in an <iframe>-sandbox'd TinyMCE media view
3316
- *
3317
- * @since 4.0.0
3318
- *
3319
- * @global $wp_version
3320
- *
3321
- * @return array The relevant CSS file URLs.
3322
- */
3323
- function wpview_media_sandbox_styles() {
3324
- $version = 'ver=' . $GLOBALS['wp_version'];
3325
- $mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" );
3326
- $wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
3327
-
3328
- return array( $mediaelement, $wpmediaelement );
3329
- }