stump-cli 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1310) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +18 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +3 -16
  6. data/Rakefile +2 -0
  7. data/bin/stump-cli +58 -0
  8. data/lib/stump-cli/version.rb +3 -0
  9. data/lib/stump.rb +5 -0
  10. data/lib/wp/Movefile-example +62 -0
  11. data/lib/wp/README.md +25 -0
  12. data/lib/wp/index.php +17 -0
  13. data/lib/wp/license.txt +385 -0
  14. data/lib/wp/readme.html +96 -0
  15. data/lib/wp/wp-activate.php +131 -0
  16. data/lib/wp/wp-admin/about.php +193 -0
  17. data/lib/wp/wp-admin/admin-ajax.php +98 -0
  18. data/lib/wp/wp-admin/admin-footer.php +99 -0
  19. data/lib/wp/wp-admin/admin-functions.php +15 -0
  20. data/lib/wp/wp-admin/admin-header.php +243 -0
  21. data/lib/wp/wp-admin/admin-post.php +71 -0
  22. data/lib/wp/wp-admin/admin.php +347 -0
  23. data/lib/wp/wp-admin/async-upload.php +114 -0
  24. data/lib/wp/wp-admin/comment.php +299 -0
  25. data/lib/wp/wp-admin/credits.php +192 -0
  26. data/lib/wp/wp-admin/css/about-rtl.css +446 -0
  27. data/lib/wp/wp-admin/css/about.css +446 -0
  28. data/lib/wp/wp-admin/css/admin-menu-rtl.css +917 -0
  29. data/lib/wp/wp-admin/css/admin-menu.css +917 -0
  30. data/lib/wp/wp-admin/css/color-picker-rtl.css +127 -0
  31. data/lib/wp/wp-admin/css/color-picker-rtl.min.css +1 -0
  32. data/lib/wp/wp-admin/css/color-picker.css +127 -0
  33. data/lib/wp/wp-admin/css/color-picker.min.css +1 -0
  34. data/lib/wp/wp-admin/css/colors/_admin.scss +525 -0
  35. data/lib/wp/wp-admin/css/colors/_mixins.scss +43 -0
  36. data/lib/wp/wp-admin/css/colors/_variables.scss +58 -0
  37. data/lib/wp/wp-admin/css/colors/blue/colors-rtl.css +341 -0
  38. data/lib/wp/wp-admin/css/colors/blue/colors-rtl.min.css +1 -0
  39. data/lib/wp/wp-admin/css/colors/blue/colors.css +341 -0
  40. data/lib/wp/wp-admin/css/colors/blue/colors.min.css +1 -0
  41. data/lib/wp/wp-admin/css/colors/blue/colors.scss +11 -0
  42. data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.css +341 -0
  43. data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.min.css +1 -0
  44. data/lib/wp/wp-admin/css/colors/coffee/colors.css +341 -0
  45. data/lib/wp/wp-admin/css/colors/coffee/colors.min.css +1 -0
  46. data/lib/wp/wp-admin/css/colors/coffee/colors.scss +7 -0
  47. data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.css +341 -0
  48. data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.min.css +1 -0
  49. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.css +341 -0
  50. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.min.css +1 -0
  51. data/lib/wp/wp-admin/css/colors/ectoplasm/colors.scss +8 -0
  52. data/lib/wp/wp-admin/css/colors/light/colors-rtl.css +349 -0
  53. data/lib/wp/wp-admin/css/colors/light/colors-rtl.min.css +1 -0
  54. data/lib/wp/wp-admin/css/colors/light/colors.css +349 -0
  55. data/lib/wp/wp-admin/css/colors/light/colors.min.css +1 -0
  56. data/lib/wp/wp-admin/css/colors/light/colors.scss +38 -0
  57. data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.css +341 -0
  58. data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.min.css +1 -0
  59. data/lib/wp/wp-admin/css/colors/midnight/colors.css +341 -0
  60. data/lib/wp/wp-admin/css/colors/midnight/colors.min.css +1 -0
  61. data/lib/wp/wp-admin/css/colors/midnight/colors.scss +5 -0
  62. data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.css +341 -0
  63. data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.min.css +1 -0
  64. data/lib/wp/wp-admin/css/colors/ocean/colors.css +341 -0
  65. data/lib/wp/wp-admin/css/colors/ocean/colors.min.css +1 -0
  66. data/lib/wp/wp-admin/css/colors/ocean/colors.scss +8 -0
  67. data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.css +341 -0
  68. data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.min.css +1 -0
  69. data/lib/wp/wp-admin/css/colors/sunrise/colors.css +341 -0
  70. data/lib/wp/wp-admin/css/colors/sunrise/colors.min.css +1 -0
  71. data/lib/wp/wp-admin/css/colors/sunrise/colors.scss +6 -0
  72. data/lib/wp/wp-admin/css/common-rtl.css +3212 -0
  73. data/lib/wp/wp-admin/css/common.css +3212 -0
  74. data/lib/wp/wp-admin/css/customize-controls-rtl.css +889 -0
  75. data/lib/wp/wp-admin/css/customize-controls-rtl.min.css +1 -0
  76. data/lib/wp/wp-admin/css/customize-controls.css +889 -0
  77. data/lib/wp/wp-admin/css/customize-controls.min.css +1 -0
  78. data/lib/wp/wp-admin/css/customize-widgets-rtl.css +603 -0
  79. data/lib/wp/wp-admin/css/customize-widgets-rtl.min.css +1 -0
  80. data/lib/wp/wp-admin/css/customize-widgets.css +603 -0
  81. data/lib/wp/wp-admin/css/customize-widgets.min.css +1 -0
  82. data/lib/wp/wp-admin/css/dashboard-rtl.css +1116 -0
  83. data/lib/wp/wp-admin/css/dashboard.css +1116 -0
  84. data/lib/wp/wp-admin/css/deprecated-media-rtl.css +371 -0
  85. data/lib/wp/wp-admin/css/deprecated-media-rtl.min.css +1 -0
  86. data/lib/wp/wp-admin/css/deprecated-media.css +371 -0
  87. data/lib/wp/wp-admin/css/deprecated-media.min.css +1 -0
  88. data/lib/wp/wp-admin/css/edit-rtl.css +1501 -0
  89. data/lib/wp/wp-admin/css/edit.css +1501 -0
  90. data/lib/wp/wp-admin/css/farbtastic-rtl.css +41 -0
  91. data/lib/wp/wp-admin/css/farbtastic.css +41 -0
  92. data/lib/wp/wp-admin/css/forms-rtl.css +992 -0
  93. data/lib/wp/wp-admin/css/forms.css +992 -0
  94. data/lib/wp/wp-admin/css/ie-rtl.css +785 -0
  95. data/lib/wp/wp-admin/css/ie-rtl.min.css +1 -0
  96. data/lib/wp/wp-admin/css/ie.css +785 -0
  97. data/lib/wp/wp-admin/css/ie.min.css +1 -0
  98. data/lib/wp/wp-admin/css/install-rtl.css +389 -0
  99. data/lib/wp/wp-admin/css/install-rtl.min.css +1 -0
  100. data/lib/wp/wp-admin/css/install.css +389 -0
  101. data/lib/wp/wp-admin/css/install.min.css +1 -0
  102. data/lib/wp/wp-admin/css/l10n-rtl.css +101 -0
  103. data/lib/wp/wp-admin/css/l10n.css +101 -0
  104. data/lib/wp/wp-admin/css/list-tables-rtl.css +1875 -0
  105. data/lib/wp/wp-admin/css/list-tables.css +1875 -0
  106. data/lib/wp/wp-admin/css/login-rtl.css +269 -0
  107. data/lib/wp/wp-admin/css/login-rtl.min.css +1 -0
  108. data/lib/wp/wp-admin/css/login.css +269 -0
  109. data/lib/wp/wp-admin/css/login.min.css +1 -0
  110. data/lib/wp/wp-admin/css/media-rtl.css +1196 -0
  111. data/lib/wp/wp-admin/css/media.css +1196 -0
  112. data/lib/wp/wp-admin/css/nav-menus-rtl.css +857 -0
  113. data/lib/wp/wp-admin/css/nav-menus.css +857 -0
  114. data/lib/wp/wp-admin/css/press-this-rtl.css +458 -0
  115. data/lib/wp/wp-admin/css/press-this.css +458 -0
  116. data/lib/wp/wp-admin/css/revisions-rtl.css +574 -0
  117. data/lib/wp/wp-admin/css/revisions.css +574 -0
  118. data/lib/wp/wp-admin/css/themes-rtl.css +1732 -0
  119. data/lib/wp/wp-admin/css/themes.css +1732 -0
  120. data/lib/wp/wp-admin/css/widgets-rtl.css +577 -0
  121. data/lib/wp/wp-admin/css/widgets.css +577 -0
  122. data/lib/wp/wp-admin/css/wp-admin-rtl.css +14 -0
  123. data/lib/wp/wp-admin/css/wp-admin-rtl.min.css +1 -0
  124. data/lib/wp/wp-admin/css/wp-admin.css +14 -0
  125. data/lib/wp/wp-admin/css/wp-admin.min.css +1 -0
  126. data/lib/wp/wp-admin/custom-background.php +482 -0
  127. data/lib/wp/wp-admin/custom-header.php +1366 -0
  128. data/lib/wp/wp-admin/customize.php +278 -0
  129. data/lib/wp/wp-admin/edit-comments.php +254 -0
  130. data/lib/wp/wp-admin/edit-form-advanced.php +636 -0
  131. data/lib/wp/wp-admin/edit-form-comment.php +160 -0
  132. data/lib/wp/wp-admin/edit-link-form.php +150 -0
  133. data/lib/wp/wp-admin/edit-tag-form.php +204 -0
  134. data/lib/wp/wp-admin/edit-tags.php +591 -0
  135. data/lib/wp/wp-admin/edit.php +330 -0
  136. data/lib/wp/wp-admin/export.php +243 -0
  137. data/lib/wp/wp-admin/freedoms.php +57 -0
  138. data/lib/wp/wp-admin/images/align-center-2x.png +0 -0
  139. data/lib/wp/wp-admin/images/align-center.png +0 -0
  140. data/lib/wp/wp-admin/images/align-left-2x.png +0 -0
  141. data/lib/wp/wp-admin/images/align-left.png +0 -0
  142. data/lib/wp/wp-admin/images/align-none-2x.png +0 -0
  143. data/lib/wp/wp-admin/images/align-none.png +0 -0
  144. data/lib/wp/wp-admin/images/align-right-2x.png +0 -0
  145. data/lib/wp/wp-admin/images/align-right.png +0 -0
  146. data/lib/wp/wp-admin/images/arrows-2x.png +0 -0
  147. data/lib/wp/wp-admin/images/arrows.png +0 -0
  148. data/lib/wp/wp-admin/images/bubble_bg-2x.gif +0 -0
  149. data/lib/wp/wp-admin/images/bubble_bg.gif +0 -0
  150. data/lib/wp/wp-admin/images/comment-grey-bubble-2x.png +0 -0
  151. data/lib/wp/wp-admin/images/comment-grey-bubble.png +0 -0
  152. data/lib/wp/wp-admin/images/date-button-2x.gif +0 -0
  153. data/lib/wp/wp-admin/images/date-button.gif +0 -0
  154. data/lib/wp/wp-admin/images/generic.png +0 -0
  155. data/lib/wp/wp-admin/images/icons32-2x.png +0 -0
  156. data/lib/wp/wp-admin/images/icons32-vs-2x.png +0 -0
  157. data/lib/wp/wp-admin/images/icons32-vs.png +0 -0
  158. data/lib/wp/wp-admin/images/icons32.png +0 -0
  159. data/lib/wp/wp-admin/images/imgedit-icons-2x.png +0 -0
  160. data/lib/wp/wp-admin/images/imgedit-icons.png +0 -0
  161. data/lib/wp/wp-admin/images/list-2x.png +0 -0
  162. data/lib/wp/wp-admin/images/list.png +0 -0
  163. data/lib/wp/wp-admin/images/loading.gif +0 -0
  164. data/lib/wp/wp-admin/images/marker.png +0 -0
  165. data/lib/wp/wp-admin/images/mask.png +0 -0
  166. data/lib/wp/wp-admin/images/media-button-2x.png +0 -0
  167. data/lib/wp/wp-admin/images/media-button-image.gif +0 -0
  168. data/lib/wp/wp-admin/images/media-button-music.gif +0 -0
  169. data/lib/wp/wp-admin/images/media-button-other.gif +0 -0
  170. data/lib/wp/wp-admin/images/media-button-video.gif +0 -0
  171. data/lib/wp/wp-admin/images/media-button.png +0 -0
  172. data/lib/wp/wp-admin/images/menu-2x.png +0 -0
  173. data/lib/wp/wp-admin/images/menu-vs-2x.png +0 -0
  174. data/lib/wp/wp-admin/images/menu-vs.png +0 -0
  175. data/lib/wp/wp-admin/images/menu.png +0 -0
  176. data/lib/wp/wp-admin/images/no.png +0 -0
  177. data/lib/wp/wp-admin/images/post-formats-vs.png +0 -0
  178. data/lib/wp/wp-admin/images/post-formats.png +0 -0
  179. data/lib/wp/wp-admin/images/post-formats32-vs.png +0 -0
  180. data/lib/wp/wp-admin/images/post-formats32.png +0 -0
  181. data/lib/wp/wp-admin/images/resize-2x.gif +0 -0
  182. data/lib/wp/wp-admin/images/resize-rtl-2x.gif +0 -0
  183. data/lib/wp/wp-admin/images/resize-rtl.gif +0 -0
  184. data/lib/wp/wp-admin/images/resize.gif +0 -0
  185. data/lib/wp/wp-admin/images/se.png +0 -0
  186. data/lib/wp/wp-admin/images/sort-2x.gif +0 -0
  187. data/lib/wp/wp-admin/images/sort.gif +0 -0
  188. data/lib/wp/wp-admin/images/spinner-2x.gif +0 -0
  189. data/lib/wp/wp-admin/images/spinner.gif +0 -0
  190. data/lib/wp/wp-admin/images/stars-2x.png +0 -0
  191. data/lib/wp/wp-admin/images/stars.png +0 -0
  192. data/lib/wp/wp-admin/images/w-logo-blue.png +0 -0
  193. data/lib/wp/wp-admin/images/w-logo-white.png +0 -0
  194. data/lib/wp/wp-admin/images/wheel.png +0 -0
  195. data/lib/wp/wp-admin/images/wordpress-logo-white.svg +1 -0
  196. data/lib/wp/wp-admin/images/wordpress-logo.png +0 -0
  197. data/lib/wp/wp-admin/images/wordpress-logo.svg +1 -0
  198. data/lib/wp/wp-admin/images/wpspin_light-2x.gif +0 -0
  199. data/lib/wp/wp-admin/images/wpspin_light.gif +0 -0
  200. data/lib/wp/wp-admin/images/xit-2x.gif +0 -0
  201. data/lib/wp/wp-admin/images/xit.gif +0 -0
  202. data/lib/wp/wp-admin/images/yes.png +0 -0
  203. data/lib/wp/wp-admin/import.php +132 -0
  204. data/lib/wp/wp-admin/includes/admin.php +74 -0
  205. data/lib/wp/wp-admin/includes/ajax-actions.php +2762 -0
  206. data/lib/wp/wp-admin/includes/bookmark.php +305 -0
  207. data/lib/wp/wp-admin/includes/class-ftp-pure.php +190 -0
  208. data/lib/wp/wp-admin/includes/class-ftp-sockets.php +250 -0
  209. data/lib/wp/wp-admin/includes/class-ftp.php +907 -0
  210. data/lib/wp/wp-admin/includes/class-pclzip.php +5687 -0
  211. data/lib/wp/wp-admin/includes/class-wp-comments-list-table.php +637 -0
  212. data/lib/wp/wp-admin/includes/class-wp-filesystem-base.php +815 -0
  213. data/lib/wp/wp-admin/includes/class-wp-filesystem-direct.php +384 -0
  214. data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpext.php +415 -0
  215. data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php +352 -0
  216. data/lib/wp/wp-admin/includes/class-wp-filesystem-ssh2.php +392 -0
  217. data/lib/wp/wp-admin/includes/class-wp-importer.php +302 -0
  218. data/lib/wp/wp-admin/includes/class-wp-links-list-table.php +207 -0
  219. data/lib/wp/wp-admin/includes/class-wp-list-table.php +1080 -0
  220. data/lib/wp/wp-admin/includes/class-wp-media-list-table.php +574 -0
  221. data/lib/wp/wp-admin/includes/class-wp-ms-sites-list-table.php +402 -0
  222. data/lib/wp/wp-admin/includes/class-wp-ms-themes-list-table.php +459 -0
  223. data/lib/wp/wp-admin/includes/class-wp-ms-users-list-table.php +303 -0
  224. data/lib/wp/wp-admin/includes/class-wp-plugin-install-list-table.php +490 -0
  225. data/lib/wp/wp-admin/includes/class-wp-plugins-list-table.php +605 -0
  226. data/lib/wp/wp-admin/includes/class-wp-posts-list-table.php +1306 -0
  227. data/lib/wp/wp-admin/includes/class-wp-terms-list-table.php +466 -0
  228. data/lib/wp/wp-admin/includes/class-wp-theme-install-list-table.php +431 -0
  229. data/lib/wp/wp-admin/includes/class-wp-themes-list-table.php +279 -0
  230. data/lib/wp/wp-admin/includes/class-wp-upgrader-skins.php +767 -0
  231. data/lib/wp/wp-admin/includes/class-wp-upgrader.php +2676 -0
  232. data/lib/wp/wp-admin/includes/class-wp-users-list-table.php +459 -0
  233. data/lib/wp/wp-admin/includes/comment.php +171 -0
  234. data/lib/wp/wp-admin/includes/continents-cities.php +493 -0
  235. data/lib/wp/wp-admin/includes/dashboard.php +1333 -0
  236. data/lib/wp/wp-admin/includes/deprecated.php +1190 -0
  237. data/lib/wp/wp-admin/includes/export.php +508 -0
  238. data/lib/wp/wp-admin/includes/file.php +1152 -0
  239. data/lib/wp/wp-admin/includes/image-edit.php +828 -0
  240. data/lib/wp/wp-admin/includes/image.php +598 -0
  241. data/lib/wp/wp-admin/includes/import.php +206 -0
  242. data/lib/wp/wp-admin/includes/list-table.php +113 -0
  243. data/lib/wp/wp-admin/includes/media.php +3012 -0
  244. data/lib/wp/wp-admin/includes/menu.php +322 -0
  245. data/lib/wp/wp-admin/includes/meta-boxes.php +1119 -0
  246. data/lib/wp/wp-admin/includes/misc.php +845 -0
  247. data/lib/wp/wp-admin/includes/ms-deprecated.php +78 -0
  248. data/lib/wp/wp-admin/includes/ms.php +814 -0
  249. data/lib/wp/wp-admin/includes/nav-menu.php +1328 -0
  250. data/lib/wp/wp-admin/includes/plugin-install.php +550 -0
  251. data/lib/wp/wp-admin/includes/plugin.php +1899 -0
  252. data/lib/wp/wp-admin/includes/post.php +1661 -0
  253. data/lib/wp/wp-admin/includes/revision.php +228 -0
  254. data/lib/wp/wp-admin/includes/schema.php +1038 -0
  255. data/lib/wp/wp-admin/includes/screen.php +1179 -0
  256. data/lib/wp/wp-admin/includes/taxonomy.php +284 -0
  257. data/lib/wp/wp-admin/includes/template.php +2157 -0
  258. data/lib/wp/wp-admin/includes/theme-install.php +205 -0
  259. data/lib/wp/wp-admin/includes/theme.php +474 -0
  260. data/lib/wp/wp-admin/includes/translation-install.php +240 -0
  261. data/lib/wp/wp-admin/includes/update-core.php +1186 -0
  262. data/lib/wp/wp-admin/includes/update.php +432 -0
  263. data/lib/wp/wp-admin/includes/upgrade.php +2218 -0
  264. data/lib/wp/wp-admin/includes/user.php +442 -0
  265. data/lib/wp/wp-admin/includes/widgets.php +245 -0
  266. data/lib/wp/wp-admin/index.php +131 -0
  267. data/lib/wp/wp-admin/install-helper.php +199 -0
  268. data/lib/wp/wp-admin/install.php +305 -0
  269. data/lib/wp/wp-admin/js/accordion.js +143 -0
  270. data/lib/wp/wp-admin/js/accordion.min.js +1 -0
  271. data/lib/wp/wp-admin/js/color-picker.js +155 -0
  272. data/lib/wp/wp-admin/js/color-picker.min.js +1 -0
  273. data/lib/wp/wp-admin/js/comment.js +50 -0
  274. data/lib/wp/wp-admin/js/comment.min.js +1 -0
  275. data/lib/wp/wp-admin/js/common.js +804 -0
  276. data/lib/wp/wp-admin/js/common.min.js +1 -0
  277. data/lib/wp/wp-admin/js/custom-background.js +75 -0
  278. data/lib/wp/wp-admin/js/custom-background.min.js +1 -0
  279. data/lib/wp/wp-admin/js/custom-header.js +61 -0
  280. data/lib/wp/wp-admin/js/customize-controls.js +1305 -0
  281. data/lib/wp/wp-admin/js/customize-controls.min.js +1 -0
  282. data/lib/wp/wp-admin/js/customize-widgets.js +1882 -0
  283. data/lib/wp/wp-admin/js/customize-widgets.min.js +1 -0
  284. data/lib/wp/wp-admin/js/dashboard.js +190 -0
  285. data/lib/wp/wp-admin/js/dashboard.min.js +1 -0
  286. data/lib/wp/wp-admin/js/edit-comments.js +625 -0
  287. data/lib/wp/wp-admin/js/edit-comments.min.js +1 -0
  288. data/lib/wp/wp-admin/js/editor-expand.js +705 -0
  289. data/lib/wp/wp-admin/js/editor-expand.min.js +1 -0
  290. data/lib/wp/wp-admin/js/editor.js +324 -0
  291. data/lib/wp/wp-admin/js/editor.min.js +1 -0
  292. data/lib/wp/wp-admin/js/farbtastic.js +276 -0
  293. data/lib/wp/wp-admin/js/gallery.js +237 -0
  294. data/lib/wp/wp-admin/js/gallery.min.js +1 -0
  295. data/lib/wp/wp-admin/js/image-edit.js +633 -0
  296. data/lib/wp/wp-admin/js/image-edit.min.js +1 -0
  297. data/lib/wp/wp-admin/js/inline-edit-post.js +359 -0
  298. data/lib/wp/wp-admin/js/inline-edit-post.min.js +1 -0
  299. data/lib/wp/wp-admin/js/inline-edit-tax.js +142 -0
  300. data/lib/wp/wp-admin/js/inline-edit-tax.min.js +1 -0
  301. data/lib/wp/wp-admin/js/iris.min.js +4 -0
  302. data/lib/wp/wp-admin/js/language-chooser.js +26 -0
  303. data/lib/wp/wp-admin/js/language-chooser.min.js +1 -0
  304. data/lib/wp/wp-admin/js/link.js +69 -0
  305. data/lib/wp/wp-admin/js/link.min.js +1 -0
  306. data/lib/wp/wp-admin/js/media-gallery.js +26 -0
  307. data/lib/wp/wp-admin/js/media-gallery.min.js +1 -0
  308. data/lib/wp/wp-admin/js/media-upload.js +69 -0
  309. data/lib/wp/wp-admin/js/media-upload.min.js +1 -0
  310. data/lib/wp/wp-admin/js/media.js +111 -0
  311. data/lib/wp/wp-admin/js/media.min.js +1 -0
  312. data/lib/wp/wp-admin/js/nav-menu.js +1205 -0
  313. data/lib/wp/wp-admin/js/nav-menu.min.js +1 -0
  314. data/lib/wp/wp-admin/js/password-strength-meter.js +75 -0
  315. data/lib/wp/wp-admin/js/password-strength-meter.min.js +1 -0
  316. data/lib/wp/wp-admin/js/plugin-install.js +76 -0
  317. data/lib/wp/wp-admin/js/plugin-install.min.js +1 -0
  318. data/lib/wp/wp-admin/js/post.js +1094 -0
  319. data/lib/wp/wp-admin/js/post.min.js +1 -0
  320. data/lib/wp/wp-admin/js/postbox.js +199 -0
  321. data/lib/wp/wp-admin/js/postbox.min.js +1 -0
  322. data/lib/wp/wp-admin/js/revisions.js +1110 -0
  323. data/lib/wp/wp-admin/js/revisions.min.js +1 -0
  324. data/lib/wp/wp-admin/js/set-post-thumbnail.js +24 -0
  325. data/lib/wp/wp-admin/js/set-post-thumbnail.min.js +1 -0
  326. data/lib/wp/wp-admin/js/svg-painter.js +240 -0
  327. data/lib/wp/wp-admin/js/svg-painter.min.js +1 -0
  328. data/lib/wp/wp-admin/js/tags.js +72 -0
  329. data/lib/wp/wp-admin/js/tags.min.js +1 -0
  330. data/lib/wp/wp-admin/js/theme.js +1691 -0
  331. data/lib/wp/wp-admin/js/theme.min.js +1 -0
  332. data/lib/wp/wp-admin/js/updates.js +65 -0
  333. data/lib/wp/wp-admin/js/updates.min.js +1 -0
  334. data/lib/wp/wp-admin/js/user-profile.js +127 -0
  335. data/lib/wp/wp-admin/js/user-profile.min.js +1 -0
  336. data/lib/wp/wp-admin/js/user-suggest.js +30 -0
  337. data/lib/wp/wp-admin/js/user-suggest.min.js +1 -0
  338. data/lib/wp/wp-admin/js/widgets.js +494 -0
  339. data/lib/wp/wp-admin/js/widgets.min.js +1 -0
  340. data/lib/wp/wp-admin/js/word-count.js +44 -0
  341. data/lib/wp/wp-admin/js/word-count.min.js +1 -0
  342. data/lib/wp/wp-admin/js/wp-fullscreen.js +704 -0
  343. data/lib/wp/wp-admin/js/wp-fullscreen.min.js +1 -0
  344. data/lib/wp/wp-admin/js/xfn.js +17 -0
  345. data/lib/wp/wp-admin/js/xfn.min.js +1 -0
  346. data/lib/wp/wp-admin/link-add.php +29 -0
  347. data/lib/wp/wp-admin/link-manager.php +99 -0
  348. data/lib/wp/wp-admin/link-parse-opml.php +84 -0
  349. data/lib/wp/wp-admin/link.php +117 -0
  350. data/lib/wp/wp-admin/load-scripts.php +162 -0
  351. data/lib/wp/wp-admin/load-styles.php +153 -0
  352. data/lib/wp/wp-admin/maint/repair.php +124 -0
  353. data/lib/wp/wp-admin/media-new.php +84 -0
  354. data/lib/wp/wp-admin/media-upload.php +100 -0
  355. data/lib/wp/wp-admin/media.php +146 -0
  356. data/lib/wp/wp-admin/menu-header.php +227 -0
  357. data/lib/wp/wp-admin/menu.php +255 -0
  358. data/lib/wp/wp-admin/moderation.php +12 -0
  359. data/lib/wp/wp-admin/ms-admin.php +13 -0
  360. data/lib/wp/wp-admin/ms-delete-site.php +91 -0
  361. data/lib/wp/wp-admin/ms-edit.php +13 -0
  362. data/lib/wp/wp-admin/ms-options.php +12 -0
  363. data/lib/wp/wp-admin/ms-sites.php +13 -0
  364. data/lib/wp/wp-admin/ms-themes.php +13 -0
  365. data/lib/wp/wp-admin/ms-upgrade-network.php +13 -0
  366. data/lib/wp/wp-admin/ms-users.php +13 -0
  367. data/lib/wp/wp-admin/my-sites.php +145 -0
  368. data/lib/wp/wp-admin/nav-menus.php +798 -0
  369. data/lib/wp/wp-admin/network.php +561 -0
  370. data/lib/wp/wp-admin/network/about.php +16 -0
  371. data/lib/wp/wp-admin/network/admin.php +32 -0
  372. data/lib/wp/wp-admin/network/credits.php +16 -0
  373. data/lib/wp/wp-admin/network/edit.php +42 -0
  374. data/lib/wp/wp-admin/network/freedoms.php +16 -0
  375. data/lib/wp/wp-admin/network/index.php +79 -0
  376. data/lib/wp/wp-admin/network/menu.php +63 -0
  377. data/lib/wp/wp-admin/network/plugin-editor.php +16 -0
  378. data/lib/wp/wp-admin/network/plugin-install.php +19 -0
  379. data/lib/wp/wp-admin/network/plugins.php +16 -0
  380. data/lib/wp/wp-admin/network/profile.php +16 -0
  381. data/lib/wp/wp-admin/network/settings.php +347 -0
  382. data/lib/wp/wp-admin/network/setup.php +16 -0
  383. data/lib/wp/wp-admin/network/site-info.php +178 -0
  384. data/lib/wp/wp-admin/network/site-new.php +153 -0
  385. data/lib/wp/wp-admin/network/site-settings.php +173 -0
  386. data/lib/wp/wp-admin/network/site-themes.php +185 -0
  387. data/lib/wp/wp-admin/network/site-users.php +319 -0
  388. data/lib/wp/wp-admin/network/sites.php +275 -0
  389. data/lib/wp/wp-admin/network/theme-editor.php +16 -0
  390. data/lib/wp/wp-admin/network/theme-install.php +19 -0
  391. data/lib/wp/wp-admin/network/themes.php +291 -0
  392. data/lib/wp/wp-admin/network/update-core.php +16 -0
  393. data/lib/wp/wp-admin/network/update.php +19 -0
  394. data/lib/wp/wp-admin/network/upgrade.php +120 -0
  395. data/lib/wp/wp-admin/network/user-edit.php +16 -0
  396. data/lib/wp/wp-admin/network/user-new.php +106 -0
  397. data/lib/wp/wp-admin/network/users.php +296 -0
  398. data/lib/wp/wp-admin/options-discussion.php +273 -0
  399. data/lib/wp/wp-admin/options-general.php +355 -0
  400. data/lib/wp/wp-admin/options-head.php +18 -0
  401. data/lib/wp/wp-admin/options-media.php +136 -0
  402. data/lib/wp/wp-admin/options-permalink.php +289 -0
  403. data/lib/wp/wp-admin/options-reading.php +184 -0
  404. data/lib/wp/wp-admin/options-writing.php +194 -0
  405. data/lib/wp/wp-admin/options.php +265 -0
  406. data/lib/wp/wp-admin/plugin-editor.php +279 -0
  407. data/lib/wp/wp-admin/plugin-install.php +134 -0
  408. data/lib/wp/wp-admin/plugins.php +474 -0
  409. data/lib/wp/wp-admin/post-new.php +74 -0
  410. data/lib/wp/wp-admin/post.php +318 -0
  411. data/lib/wp/wp-admin/press-this.php +691 -0
  412. data/lib/wp/wp-admin/profile.php +18 -0
  413. data/lib/wp/wp-admin/revision.php +221 -0
  414. data/lib/wp/wp-admin/setup-config.php +345 -0
  415. data/lib/wp/wp-admin/theme-editor.php +243 -0
  416. data/lib/wp/wp-admin/theme-install.php +278 -0
  417. data/lib/wp/wp-admin/themes.php +374 -0
  418. data/lib/wp/wp-admin/tools.php +75 -0
  419. data/lib/wp/wp-admin/update-core.php +653 -0
  420. data/lib/wp/wp-admin/update.php +272 -0
  421. data/lib/wp/wp-admin/upgrade-functions.php +12 -0
  422. data/lib/wp/wp-admin/upgrade.php +116 -0
  423. data/lib/wp/wp-admin/upload.php +292 -0
  424. data/lib/wp/wp-admin/user-edit.php +557 -0
  425. data/lib/wp/wp-admin/user-new.php +439 -0
  426. data/lib/wp/wp-admin/user/about.php +13 -0
  427. data/lib/wp/wp-admin/user/admin.php +32 -0
  428. data/lib/wp/wp-admin/user/credits.php +13 -0
  429. data/lib/wp/wp-admin/user/freedoms.php +13 -0
  430. data/lib/wp/wp-admin/user/index.php +12 -0
  431. data/lib/wp/wp-admin/user/menu.php +22 -0
  432. data/lib/wp/wp-admin/user/profile.php +12 -0
  433. data/lib/wp/wp-admin/user/user-edit.php +12 -0
  434. data/lib/wp/wp-admin/users.php +460 -0
  435. data/lib/wp/wp-admin/widgets.php +442 -0
  436. data/lib/wp/wp-blog-header.php +18 -0
  437. data/lib/wp/wp-comments-post.php +164 -0
  438. data/lib/wp/wp-config-sample.php +80 -0
  439. data/lib/wp/wp-content/index.php +2 -0
  440. data/lib/wp/wp-content/plugins/hello.php +82 -0
  441. data/lib/wp/wp-content/plugins/index.php +2 -0
  442. data/lib/wp/wp-content/themes/index.php +2 -0
  443. data/lib/wp/wp-content/themes/stump/.editorconfig +11 -0
  444. data/lib/wp/wp-content/themes/stump/.jshintrc +16 -0
  445. data/lib/wp/wp-content/themes/stump/404.php +13 -0
  446. data/lib/wp/wp-content/themes/stump/CHANGELOG.md +333 -0
  447. data/lib/wp/wp-content/themes/stump/CONTRIBUTING.md +121 -0
  448. data/lib/wp/wp-content/themes/stump/Gruntfile.js +151 -0
  449. data/lib/wp/wp-content/themes/stump/LICENSE.md +19 -0
  450. data/lib/wp/wp-content/themes/stump/assets/coffee/build/.gitkeep +0 -0
  451. data/lib/wp/wp-content/themes/stump/assets/coffee/build/site.js +6 -0
  452. data/lib/wp/wp-content/themes/stump/assets/css/editor-style.css +548 -0
  453. data/lib/wp/wp-content/themes/stump/assets/css/main.min.css +4 -0
  454. data/lib/wp/wp-content/themes/stump/assets/css/main.min.css.map +7 -0
  455. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  456. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.svg +229 -0
  457. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  458. data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  459. data/lib/wp/wp-content/themes/stump/assets/img/.gitignore +0 -0
  460. data/lib/wp/wp-content/themes/stump/assets/js/_main.js +63 -0
  461. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/affix.js +137 -0
  462. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/alert.js +88 -0
  463. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/button.js +107 -0
  464. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/carousel.js +205 -0
  465. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/collapse.js +170 -0
  466. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/dropdown.js +147 -0
  467. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/modal.js +243 -0
  468. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/popover.js +110 -0
  469. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/scrollspy.js +153 -0
  470. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tab.js +125 -0
  471. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tooltip.js +399 -0
  472. data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/transition.js +48 -0
  473. data/lib/wp/wp-content/themes/stump/assets/js/scripts.min.js +1 -0
  474. data/lib/wp/wp-content/themes/stump/assets/js/vendor/jquery-1.11.0.min.js +4 -0
  475. data/lib/wp/wp-content/themes/stump/assets/js/vendor/modernizr-2.7.0.min.js +4 -0
  476. data/lib/wp/wp-content/themes/stump/assets/sass/app.scss +9 -0
  477. data/lib/wp/wp-content/themes/stump/assets/sass/core/_variables.scss +1 -0
  478. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_alerts.scss +67 -0
  479. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_badges.scss +55 -0
  480. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_bootstrap.scss +49 -0
  481. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_breadcrumbs.scss +26 -0
  482. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_button-groups.scss +226 -0
  483. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_buttons.scss +159 -0
  484. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_carousel.scss +232 -0
  485. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_close.scss +35 -0
  486. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_code.scss +63 -0
  487. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_component-animations.scss +29 -0
  488. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_dropdowns.scss +213 -0
  489. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_forms.scss +436 -0
  490. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_glyphicons.scss +233 -0
  491. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_grid.scss +84 -0
  492. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_input-groups.scss +162 -0
  493. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_jumbotron.scss +44 -0
  494. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_labels.scss +64 -0
  495. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_list-group.scss +110 -0
  496. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_media.scss +56 -0
  497. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_mixins.scss +947 -0
  498. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_modals.scss +139 -0
  499. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navbar.scss +620 -0
  500. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navs.scss +242 -0
  501. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_normalize.scss +423 -0
  502. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pager.scss +55 -0
  503. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pagination.scss +88 -0
  504. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_panels.scss +241 -0
  505. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_popovers.scss +133 -0
  506. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_print.scss +101 -0
  507. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_progress-bars.scss +80 -0
  508. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_responsive-utilities.scss +74 -0
  509. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_scaffolding.scss +134 -0
  510. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tables.scss +233 -0
  511. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_theme.scss +247 -0
  512. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_thumbnails.scss +38 -0
  513. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tooltip.scss +95 -0
  514. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_type.scss +284 -0
  515. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_utilities.scss +56 -0
  516. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_variables.scss +833 -0
  517. data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_wells.scss +29 -0
  518. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon-deprecated-upcoming.scss +13 -0
  519. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon.scss +59 -0
  520. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_button.scss +273 -0
  521. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_clearfix.scss +29 -0
  522. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_font-family.scss +5 -0
  523. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_hide-text.scss +5 -0
  524. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_html5-input-types.scss +56 -0
  525. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_position.scss +42 -0
  526. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_prefixer.scss +49 -0
  527. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_retina-image.scss +32 -0
  528. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_size.scss +44 -0
  529. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_timing-functions.scss +32 -0
  530. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_triangle.scss +45 -0
  531. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_animation.scss +52 -0
  532. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_appearance.scss +3 -0
  533. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_backface-visibility.scss +6 -0
  534. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background-image.scss +48 -0
  535. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background.scss +103 -0
  536. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-image.scss +55 -0
  537. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-radius.scss +22 -0
  538. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_box-sizing.scss +4 -0
  539. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_columns.scss +47 -0
  540. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_flex-box.scss +52 -0
  541. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_font-face.scss +23 -0
  542. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_hidpi-media-query.scss +10 -0
  543. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_image-rendering.scss +13 -0
  544. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_inline-block.scss +8 -0
  545. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_keyframes.scss +43 -0
  546. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_linear-gradient.scss +41 -0
  547. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_perspective.scss +8 -0
  548. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_placeholder.scss +29 -0
  549. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_radial-gradient.scss +44 -0
  550. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transform.scss +15 -0
  551. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transition.scss +34 -0
  552. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_user-select.scss +3 -0
  553. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_compact.scss +11 -0
  554. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_flex-grid.scss +39 -0
  555. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_grid-width.scss +13 -0
  556. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_linear-gradient.scss +13 -0
  557. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_modular-scale.scss +40 -0
  558. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_px-to-em.scss +8 -0
  559. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_radial-gradient.scss +23 -0
  560. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_tint-shade.scss +9 -0
  561. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_transition-property-name.scss +22 -0
  562. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_deprecated-webkit-gradient.scss +39 -0
  563. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_gradient-positions-parser.scss +13 -0
  564. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_linear-positions-parser.scss +61 -0
  565. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-arg-parser.scss +69 -0
  566. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-positions-parser.scss +18 -0
  567. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_render-gradients.scss +26 -0
  568. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_shape-size-stripper.scss +10 -0
  569. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan.sass +11 -0
  570. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_grid.sass +161 -0
  571. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_mixins.sass +63 -0
  572. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_utilities.sass +24 -0
  573. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_variables.sass +42 -0
  574. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat-helpers.scss +8 -0
  575. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat.scss +21 -0
  576. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_new-breakpoint.scss +16 -0
  577. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_private.scss +107 -0
  578. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_px-to-em.scss +3 -0
  579. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_fill-parent.scss +7 -0
  580. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_grid.scss +5 -0
  581. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_media.scss +51 -0
  582. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_omega.scss +79 -0
  583. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_outer-container.scss +8 -0
  584. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_pad.scss +8 -0
  585. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_private.scss +50 -0
  586. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_reset.scss +12 -0
  587. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_row.scss +17 -0
  588. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_shift.scss +9 -0
  589. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_span-columns.scss +38 -0
  590. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_to-deprecate.scss +57 -0
  591. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_visual-grid.scss +41 -0
  592. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_grid.scss +7 -0
  593. data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_visual-grid.scss +5 -0
  594. data/lib/wp/wp-content/themes/stump/base.php +36 -0
  595. data/lib/wp/wp-content/themes/stump/functions.php +19 -0
  596. data/lib/wp/wp-content/themes/stump/index.php +21 -0
  597. data/lib/wp/wp-content/themes/stump/lang/ar.mo +0 -0
  598. data/lib/wp/wp-content/themes/stump/lang/ar.po +270 -0
  599. data/lib/wp/wp-content/themes/stump/lang/bg_BG.mo +0 -0
  600. data/lib/wp/wp-content/themes/stump/lang/bg_BG.po +338 -0
  601. data/lib/wp/wp-content/themes/stump/lang/ca.mo +0 -0
  602. data/lib/wp/wp-content/themes/stump/lang/ca.po +517 -0
  603. data/lib/wp/wp-content/themes/stump/lang/da_DK.mo +0 -0
  604. data/lib/wp/wp-content/themes/stump/lang/da_DK.po +305 -0
  605. data/lib/wp/wp-content/themes/stump/lang/de_DE.mo +0 -0
  606. data/lib/wp/wp-content/themes/stump/lang/de_DE.po +271 -0
  607. data/lib/wp/wp-content/themes/stump/lang/el.mo +0 -0
  608. data/lib/wp/wp-content/themes/stump/lang/el.po +319 -0
  609. data/lib/wp/wp-content/themes/stump/lang/es_ES.mo +0 -0
  610. data/lib/wp/wp-content/themes/stump/lang/es_ES.po +270 -0
  611. data/lib/wp/wp-content/themes/stump/lang/et.mo +0 -0
  612. data/lib/wp/wp-content/themes/stump/lang/et.po +262 -0
  613. data/lib/wp/wp-content/themes/stump/lang/fa_IR.mo +0 -0
  614. data/lib/wp/wp-content/themes/stump/lang/fa_IR.po +273 -0
  615. data/lib/wp/wp-content/themes/stump/lang/fi_FI.mo +0 -0
  616. data/lib/wp/wp-content/themes/stump/lang/fi_FI.po +367 -0
  617. data/lib/wp/wp-content/themes/stump/lang/fr_FR.mo +0 -0
  618. data/lib/wp/wp-content/themes/stump/lang/fr_FR.po +336 -0
  619. data/lib/wp/wp-content/themes/stump/lang/he_IL.mo +0 -0
  620. data/lib/wp/wp-content/themes/stump/lang/he_IL.po +336 -0
  621. data/lib/wp/wp-content/themes/stump/lang/hu_HU.mo +0 -0
  622. data/lib/wp/wp-content/themes/stump/lang/hu_HU.po +271 -0
  623. data/lib/wp/wp-content/themes/stump/lang/id_ID.mo +0 -0
  624. data/lib/wp/wp-content/themes/stump/lang/id_ID.po +278 -0
  625. data/lib/wp/wp-content/themes/stump/lang/it_IT.mo +0 -0
  626. data/lib/wp/wp-content/themes/stump/lang/it_IT.po +269 -0
  627. data/lib/wp/wp-content/themes/stump/lang/ja.mo +0 -0
  628. data/lib/wp/wp-content/themes/stump/lang/ja.po +267 -0
  629. data/lib/wp/wp-content/themes/stump/lang/ko_KR.mo +0 -0
  630. data/lib/wp/wp-content/themes/stump/lang/ko_KR.po +282 -0
  631. data/lib/wp/wp-content/themes/stump/lang/mk_MK.mo +0 -0
  632. data/lib/wp/wp-content/themes/stump/lang/mk_MK.po +297 -0
  633. data/lib/wp/wp-content/themes/stump/lang/ms_MY.mo +0 -0
  634. data/lib/wp/wp-content/themes/stump/lang/ms_MY.po +342 -0
  635. data/lib/wp/wp-content/themes/stump/lang/nb_NO.mo +0 -0
  636. data/lib/wp/wp-content/themes/stump/lang/nb_NO.po +517 -0
  637. data/lib/wp/wp-content/themes/stump/lang/nl_NL.mo +0 -0
  638. data/lib/wp/wp-content/themes/stump/lang/nl_NL.po +261 -0
  639. data/lib/wp/wp-content/themes/stump/lang/nn_NO.mo +0 -0
  640. data/lib/wp/wp-content/themes/stump/lang/nn_NO.po +517 -0
  641. data/lib/wp/wp-content/themes/stump/lang/pl_PL.mo +0 -0
  642. data/lib/wp/wp-content/themes/stump/lang/pl_PL.po +283 -0
  643. data/lib/wp/wp-content/themes/stump/lang/pt_BR.mo +0 -0
  644. data/lib/wp/wp-content/themes/stump/lang/pt_BR.po +394 -0
  645. data/lib/wp/wp-content/themes/stump/lang/ro_RO.mo +0 -0
  646. data/lib/wp/wp-content/themes/stump/lang/ro_RO.po +271 -0
  647. data/lib/wp/wp-content/themes/stump/lang/roots.pot +244 -0
  648. data/lib/wp/wp-content/themes/stump/lang/ru_RU.mo +0 -0
  649. data/lib/wp/wp-content/themes/stump/lang/ru_RU.po +255 -0
  650. data/lib/wp/wp-content/themes/stump/lang/sk_SK.mo +0 -0
  651. data/lib/wp/wp-content/themes/stump/lang/sk_SK.po +267 -0
  652. data/lib/wp/wp-content/themes/stump/lang/sr_RS.mo +0 -0
  653. data/lib/wp/wp-content/themes/stump/lang/sr_RS.pot +261 -0
  654. data/lib/wp/wp-content/themes/stump/lang/sv_SE.mo +0 -0
  655. data/lib/wp/wp-content/themes/stump/lang/sv_SE.po +323 -0
  656. data/lib/wp/wp-content/themes/stump/lang/tr_TR.mo +0 -0
  657. data/lib/wp/wp-content/themes/stump/lang/tr_TR.po +405 -0
  658. data/lib/wp/wp-content/themes/stump/lang/vi_VN.mo +0 -0
  659. data/lib/wp/wp-content/themes/stump/lang/vi_VN.po +516 -0
  660. data/lib/wp/wp-content/themes/stump/lang/zh_CN.mo +0 -0
  661. data/lib/wp/wp-content/themes/stump/lang/zh_CN.po +329 -0
  662. data/lib/wp/wp-content/themes/stump/lang/zh_TW.mo +0 -0
  663. data/lib/wp/wp-content/themes/stump/lang/zh_TW.po +261 -0
  664. data/lib/wp/wp-content/themes/stump/lib/activation.php +215 -0
  665. data/lib/wp/wp-content/themes/stump/lib/cleanup.php +261 -0
  666. data/lib/wp/wp-content/themes/stump/lib/comments.php +52 -0
  667. data/lib/wp/wp-content/themes/stump/lib/config.php +79 -0
  668. data/lib/wp/wp-content/themes/stump/lib/custom.php +4 -0
  669. data/lib/wp/wp-content/themes/stump/lib/gallery.php +130 -0
  670. data/lib/wp/wp-content/themes/stump/lib/init.php +25 -0
  671. data/lib/wp/wp-content/themes/stump/lib/nav.php +93 -0
  672. data/lib/wp/wp-content/themes/stump/lib/relative-urls.php +50 -0
  673. data/lib/wp/wp-content/themes/stump/lib/scripts.php +67 -0
  674. data/lib/wp/wp-content/themes/stump/lib/sidebar.php +43 -0
  675. data/lib/wp/wp-content/themes/stump/lib/titles.php +37 -0
  676. data/lib/wp/wp-content/themes/stump/lib/utils.php +14 -0
  677. data/lib/wp/wp-content/themes/stump/lib/widgets.php +133 -0
  678. data/lib/wp/wp-content/themes/stump/lib/wrapper.php +49 -0
  679. data/lib/wp/wp-content/themes/stump/package.json +32 -0
  680. data/lib/wp/wp-content/themes/stump/page.php +2 -0
  681. data/lib/wp/wp-content/themes/stump/screenshot.png +0 -0
  682. data/lib/wp/wp-content/themes/stump/single.php +1 -0
  683. data/lib/wp/wp-content/themes/stump/style.css +11 -0
  684. data/lib/wp/wp-content/themes/stump/template-custom.php +8 -0
  685. data/lib/wp/wp-content/themes/stump/templates/comment.php +14 -0
  686. data/lib/wp/wp-content/themes/stump/templates/comments.php +80 -0
  687. data/lib/wp/wp-content/themes/stump/templates/content-page.php +4 -0
  688. data/lib/wp/wp-content/themes/stump/templates/content-single.php +15 -0
  689. data/lib/wp/wp-content/themes/stump/templates/content.php +9 -0
  690. data/lib/wp/wp-content/themes/stump/templates/entry-meta.php +2 -0
  691. data/lib/wp/wp-content/themes/stump/templates/footer.php +8 -0
  692. data/lib/wp/wp-content/themes/stump/templates/head.php +12 -0
  693. data/lib/wp/wp-content/themes/stump/templates/header-top-navbar.php +21 -0
  694. data/lib/wp/wp-content/themes/stump/templates/header.php +14 -0
  695. data/lib/wp/wp-content/themes/stump/templates/page-header.php +5 -0
  696. data/lib/wp/wp-content/themes/stump/templates/searchform.php +9 -0
  697. data/lib/wp/wp-content/themes/stump/templates/sidebar.php +1 -0
  698. data/lib/wp/wp-content/themes/twentyfourteen/404.php +32 -0
  699. data/lib/wp/wp-content/themes/twentyfourteen/archive.php +74 -0
  700. data/lib/wp/wp-content/themes/twentyfourteen/author.php +74 -0
  701. data/lib/wp/wp-content/themes/twentyfourteen/category.php +58 -0
  702. data/lib/wp/wp-content/themes/twentyfourteen/comments.php +66 -0
  703. data/lib/wp/wp-content/themes/twentyfourteen/content-aside.php +57 -0
  704. data/lib/wp/wp-content/themes/twentyfourteen/content-audio.php +57 -0
  705. data/lib/wp/wp-content/themes/twentyfourteen/content-featured-post.php +34 -0
  706. data/lib/wp/wp-content/themes/twentyfourteen/content-gallery.php +57 -0
  707. data/lib/wp/wp-content/themes/twentyfourteen/content-image.php +57 -0
  708. data/lib/wp/wp-content/themes/twentyfourteen/content-link.php +57 -0
  709. data/lib/wp/wp-content/themes/twentyfourteen/content-none.php +31 -0
  710. data/lib/wp/wp-content/themes/twentyfourteen/content-page.php +31 -0
  711. data/lib/wp/wp-content/themes/twentyfourteen/content-quote.php +57 -0
  712. data/lib/wp/wp-content/themes/twentyfourteen/content-video.php +57 -0
  713. data/lib/wp/wp-content/themes/twentyfourteen/content.php +66 -0
  714. data/lib/wp/wp-content/themes/twentyfourteen/css/editor-style.css +717 -0
  715. data/lib/wp/wp-content/themes/twentyfourteen/css/ie.css +1335 -0
  716. data/lib/wp/wp-content/themes/twentyfourteen/featured-content.php +39 -0
  717. data/lib/wp/wp-content/themes/twentyfourteen/footer.php +28 -0
  718. data/lib/wp/wp-content/themes/twentyfourteen/functions.php +519 -0
  719. data/lib/wp/wp-content/themes/twentyfourteen/genericons/COPYING.txt +9 -0
  720. data/lib/wp/wp-content/themes/twentyfourteen/genericons/Genericons-Regular.otf +0 -0
  721. data/lib/wp/wp-content/themes/twentyfourteen/genericons/LICENSE.txt +339 -0
  722. data/lib/wp/wp-content/themes/twentyfourteen/genericons/README.txt +123 -0
  723. data/lib/wp/wp-content/themes/twentyfourteen/genericons/example.html +464 -0
  724. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.eot +0 -0
  725. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.svg +135 -0
  726. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.ttf +0 -0
  727. data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.woff +0 -0
  728. data/lib/wp/wp-content/themes/twentyfourteen/genericons/genericons.css +197 -0
  729. data/lib/wp/wp-content/themes/twentyfourteen/header.php +65 -0
  730. data/lib/wp/wp-content/themes/twentyfourteen/image.php +79 -0
  731. data/lib/wp/wp-content/themes/twentyfourteen/images/pattern-dark.svg +16 -0
  732. data/lib/wp/wp-content/themes/twentyfourteen/images/pattern-light.svg +6 -0
  733. data/lib/wp/wp-content/themes/twentyfourteen/inc/back-compat.php +63 -0
  734. data/lib/wp/wp-content/themes/twentyfourteen/inc/custom-header.php +147 -0
  735. data/lib/wp/wp-content/themes/twentyfourteen/inc/customizer.php +114 -0
  736. data/lib/wp/wp-content/themes/twentyfourteen/inc/featured-content.php +531 -0
  737. data/lib/wp/wp-content/themes/twentyfourteen/inc/template-tags.php +203 -0
  738. data/lib/wp/wp-content/themes/twentyfourteen/inc/widgets.php +269 -0
  739. data/lib/wp/wp-content/themes/twentyfourteen/index.php +61 -0
  740. data/lib/wp/wp-content/themes/twentyfourteen/js/customizer.js +38 -0
  741. data/lib/wp/wp-content/themes/twentyfourteen/js/featured-content-admin.js +9 -0
  742. data/lib/wp/wp-content/themes/twentyfourteen/js/functions.js +134 -0
  743. data/lib/wp/wp-content/themes/twentyfourteen/js/html5.js +8 -0
  744. data/lib/wp/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js +21 -0
  745. data/lib/wp/wp-content/themes/twentyfourteen/js/slider.js +598 -0
  746. data/lib/wp/wp-content/themes/twentyfourteen/languages/twentyfourteen.pot +467 -0
  747. data/lib/wp/wp-content/themes/twentyfourteen/page-templates/contributors.php +52 -0
  748. data/lib/wp/wp-content/themes/twentyfourteen/page-templates/full-width.php +42 -0
  749. data/lib/wp/wp-content/themes/twentyfourteen/page.php +48 -0
  750. data/lib/wp/wp-content/themes/twentyfourteen/rtl.css +854 -0
  751. data/lib/wp/wp-content/themes/twentyfourteen/screenshot.png +0 -0
  752. data/lib/wp/wp-content/themes/twentyfourteen/search.php +49 -0
  753. data/lib/wp/wp-content/themes/twentyfourteen/sidebar-content.php +16 -0
  754. data/lib/wp/wp-content/themes/twentyfourteen/sidebar-footer.php +19 -0
  755. data/lib/wp/wp-content/themes/twentyfourteen/sidebar.php +29 -0
  756. data/lib/wp/wp-content/themes/twentyfourteen/single.php +40 -0
  757. data/lib/wp/wp-content/themes/twentyfourteen/style.css +4321 -0
  758. data/lib/wp/wp-content/themes/twentyfourteen/tag.php +60 -0
  759. data/lib/wp/wp-content/themes/twentyfourteen/taxonomy-post_format.php +85 -0
  760. data/lib/wp/wp-cron.php +115 -0
  761. data/lib/wp/wp-includes/ID3/getid3.lib.php +1376 -0
  762. data/lib/wp/wp-includes/ID3/getid3.php +1796 -0
  763. data/lib/wp/wp-includes/ID3/license.commercial.txt +27 -0
  764. data/lib/wp/wp-includes/ID3/license.txt +29 -0
  765. data/lib/wp/wp-includes/ID3/module.audio-video.asf.php +2013 -0
  766. data/lib/wp/wp-includes/ID3/module.audio-video.flv.php +745 -0
  767. data/lib/wp/wp-includes/ID3/module.audio-video.matroska.php +1751 -0
  768. data/lib/wp/wp-includes/ID3/module.audio-video.quicktime.php +2246 -0
  769. data/lib/wp/wp-includes/ID3/module.audio-video.riff.php +2586 -0
  770. data/lib/wp/wp-includes/ID3/module.audio.ac3.php +474 -0
  771. data/lib/wp/wp-includes/ID3/module.audio.dts.php +291 -0
  772. data/lib/wp/wp-includes/ID3/module.audio.flac.php +443 -0
  773. data/lib/wp/wp-includes/ID3/module.audio.mp3.php +2012 -0
  774. data/lib/wp/wp-includes/ID3/module.audio.ogg.php +756 -0
  775. data/lib/wp/wp-includes/ID3/module.tag.apetag.php +371 -0
  776. data/lib/wp/wp-includes/ID3/module.tag.id3v1.php +360 -0
  777. data/lib/wp/wp-includes/ID3/module.tag.id3v2.php +3424 -0
  778. data/lib/wp/wp-includes/ID3/module.tag.lyrics3.php +294 -0
  779. data/lib/wp/wp-includes/ID3/readme.txt +604 -0
  780. data/lib/wp/wp-includes/SimplePie/Author.php +157 -0
  781. data/lib/wp/wp-includes/SimplePie/Cache.php +133 -0
  782. data/lib/wp/wp-includes/SimplePie/Cache/Base.php +114 -0
  783. data/lib/wp/wp-includes/SimplePie/Cache/DB.php +137 -0
  784. data/lib/wp/wp-includes/SimplePie/Cache/File.php +173 -0
  785. data/lib/wp/wp-includes/SimplePie/Cache/Memcache.php +183 -0
  786. data/lib/wp/wp-includes/SimplePie/Cache/MySQL.php +438 -0
  787. data/lib/wp/wp-includes/SimplePie/Caption.php +210 -0
  788. data/lib/wp/wp-includes/SimplePie/Category.php +157 -0
  789. data/lib/wp/wp-includes/SimplePie/Content/Type/Sniffer.php +332 -0
  790. data/lib/wp/wp-includes/SimplePie/Copyright.php +130 -0
  791. data/lib/wp/wp-includes/SimplePie/Core.php +57 -0
  792. data/lib/wp/wp-includes/SimplePie/Credit.php +156 -0
  793. data/lib/wp/wp-includes/SimplePie/Decode/HTML/Entities.php +617 -0
  794. data/lib/wp/wp-includes/SimplePie/Enclosure.php +1380 -0
  795. data/lib/wp/wp-includes/SimplePie/Exception.php +52 -0
  796. data/lib/wp/wp-includes/SimplePie/File.php +292 -0
  797. data/lib/wp/wp-includes/SimplePie/HTTP/Parser.php +500 -0
  798. data/lib/wp/wp-includes/SimplePie/IRI.php +1238 -0
  799. data/lib/wp/wp-includes/SimplePie/Item.php +2964 -0
  800. data/lib/wp/wp-includes/SimplePie/Locator.php +372 -0
  801. data/lib/wp/wp-includes/SimplePie/Misc.php +2247 -0
  802. data/lib/wp/wp-includes/SimplePie/Net/IPv6.php +276 -0
  803. data/lib/wp/wp-includes/SimplePie/Parse/Date.php +983 -0
  804. data/lib/wp/wp-includes/SimplePie/Parser.php +407 -0
  805. data/lib/wp/wp-includes/SimplePie/Rating.php +129 -0
  806. data/lib/wp/wp-includes/SimplePie/Registry.php +225 -0
  807. data/lib/wp/wp-includes/SimplePie/Restriction.php +155 -0
  808. data/lib/wp/wp-includes/SimplePie/Sanitize.php +554 -0
  809. data/lib/wp/wp-includes/SimplePie/Source.php +611 -0
  810. data/lib/wp/wp-includes/SimplePie/XML/Declaration/Parser.php +362 -0
  811. data/lib/wp/wp-includes/SimplePie/gzdecode.php +371 -0
  812. data/lib/wp/wp-includes/Text/Diff.php +450 -0
  813. data/lib/wp/wp-includes/Text/Diff/Engine/native.php +436 -0
  814. data/lib/wp/wp-includes/Text/Diff/Engine/shell.php +162 -0
  815. data/lib/wp/wp-includes/Text/Diff/Engine/string.php +248 -0
  816. data/lib/wp/wp-includes/Text/Diff/Engine/xdiff.php +64 -0
  817. data/lib/wp/wp-includes/Text/Diff/Renderer.php +235 -0
  818. data/lib/wp/wp-includes/Text/Diff/Renderer/inline.php +206 -0
  819. data/lib/wp/wp-includes/admin-bar.php +870 -0
  820. data/lib/wp/wp-includes/atomlib.php +352 -0
  821. data/lib/wp/wp-includes/author-template.php +471 -0
  822. data/lib/wp/wp-includes/bookmark-template.php +298 -0
  823. data/lib/wp/wp-includes/bookmark.php +416 -0
  824. data/lib/wp/wp-includes/cache.php +704 -0
  825. data/lib/wp/wp-includes/canonical.php +586 -0
  826. data/lib/wp/wp-includes/capabilities.php +1539 -0
  827. data/lib/wp/wp-includes/category-template.php +1407 -0
  828. data/lib/wp/wp-includes/category.php +343 -0
  829. data/lib/wp/wp-includes/certificates/ca-bundle.crt +3785 -0
  830. data/lib/wp/wp-includes/class-IXR.php +1100 -0
  831. data/lib/wp/wp-includes/class-feed.php +140 -0
  832. data/lib/wp/wp-includes/class-http.php +2245 -0
  833. data/lib/wp/wp-includes/class-json.php +936 -0
  834. data/lib/wp/wp-includes/class-oembed.php +579 -0
  835. data/lib/wp/wp-includes/class-phpass.php +260 -0
  836. data/lib/wp/wp-includes/class-phpmailer.php +3265 -0
  837. data/lib/wp/wp-includes/class-pop3.php +652 -0
  838. data/lib/wp/wp-includes/class-simplepie.php +3119 -0
  839. data/lib/wp/wp-includes/class-smtp.php +943 -0
  840. data/lib/wp/wp-includes/class-snoopy.php +1256 -0
  841. data/lib/wp/wp-includes/class-wp-admin-bar.php +517 -0
  842. data/lib/wp/wp-includes/class-wp-ajax-response.php +199 -0
  843. data/lib/wp/wp-includes/class-wp-customize-control.php +1124 -0
  844. data/lib/wp/wp-includes/class-wp-customize-manager.php +1272 -0
  845. data/lib/wp/wp-includes/class-wp-customize-panel.php +200 -0
  846. data/lib/wp/wp-includes/class-wp-customize-section.php +196 -0
  847. data/lib/wp/wp-includes/class-wp-customize-setting.php +554 -0
  848. data/lib/wp/wp-includes/class-wp-customize-widgets.php +1556 -0
  849. data/lib/wp/wp-includes/class-wp-editor.php +1435 -0
  850. data/lib/wp/wp-includes/class-wp-embed.php +373 -0
  851. data/lib/wp/wp-includes/class-wp-error.php +276 -0
  852. data/lib/wp/wp-includes/class-wp-http-ixr-client.php +97 -0
  853. data/lib/wp/wp-includes/class-wp-image-editor-gd.php +459 -0
  854. data/lib/wp/wp-includes/class-wp-image-editor-imagick.php +512 -0
  855. data/lib/wp/wp-includes/class-wp-image-editor.php +475 -0
  856. data/lib/wp/wp-includes/class-wp-theme.php +1235 -0
  857. data/lib/wp/wp-includes/class-wp-walker.php +471 -0
  858. data/lib/wp/wp-includes/class-wp-xmlrpc-server.php +5984 -0
  859. data/lib/wp/wp-includes/class-wp.php +782 -0
  860. data/lib/wp/wp-includes/class.wp-dependencies.php +509 -0
  861. data/lib/wp/wp-includes/class.wp-scripts.php +247 -0
  862. data/lib/wp/wp-includes/class.wp-styles.php +210 -0
  863. data/lib/wp/wp-includes/comment-template.php +2286 -0
  864. data/lib/wp/wp-includes/comment.php +2606 -0
  865. data/lib/wp/wp-includes/compat.php +125 -0
  866. data/lib/wp/wp-includes/cron.php +469 -0
  867. data/lib/wp/wp-includes/css/admin-bar-rtl.css +1099 -0
  868. data/lib/wp/wp-includes/css/admin-bar-rtl.min.css +1 -0
  869. data/lib/wp/wp-includes/css/admin-bar.css +1099 -0
  870. data/lib/wp/wp-includes/css/admin-bar.min.css +1 -0
  871. data/lib/wp/wp-includes/css/buttons-rtl.css +364 -0
  872. data/lib/wp/wp-includes/css/buttons-rtl.min.css +1 -0
  873. data/lib/wp/wp-includes/css/buttons.css +364 -0
  874. data/lib/wp/wp-includes/css/buttons.min.css +1 -0
  875. data/lib/wp/wp-includes/css/dashicons.css +893 -0
  876. data/lib/wp/wp-includes/css/dashicons.min.css +1 -0
  877. data/lib/wp/wp-includes/css/editor-rtl.css +1993 -0
  878. data/lib/wp/wp-includes/css/editor-rtl.min.css +1 -0
  879. data/lib/wp/wp-includes/css/editor.css +1993 -0
  880. data/lib/wp/wp-includes/css/editor.min.css +1 -0
  881. data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.css +343 -0
  882. data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.min.css +19 -0
  883. data/lib/wp/wp-includes/css/jquery-ui-dialog.css +343 -0
  884. data/lib/wp/wp-includes/css/jquery-ui-dialog.min.css +19 -0
  885. data/lib/wp/wp-includes/css/media-views-rtl.css +2568 -0
  886. data/lib/wp/wp-includes/css/media-views-rtl.min.css +1 -0
  887. data/lib/wp/wp-includes/css/media-views.css +2568 -0
  888. data/lib/wp/wp-includes/css/media-views.min.css +1 -0
  889. data/lib/wp/wp-includes/css/wp-auth-check-rtl.css +100 -0
  890. data/lib/wp/wp-includes/css/wp-auth-check-rtl.min.css +1 -0
  891. data/lib/wp/wp-includes/css/wp-auth-check.css +100 -0
  892. data/lib/wp/wp-includes/css/wp-auth-check.min.css +1 -0
  893. data/lib/wp/wp-includes/css/wp-pointer-rtl.css +212 -0
  894. data/lib/wp/wp-includes/css/wp-pointer-rtl.min.css +1 -0
  895. data/lib/wp/wp-includes/css/wp-pointer.css +212 -0
  896. data/lib/wp/wp-includes/css/wp-pointer.min.css +1 -0
  897. data/lib/wp/wp-includes/date.php +475 -0
  898. data/lib/wp/wp-includes/default-constants.php +323 -0
  899. data/lib/wp/wp-includes/default-filters.php +307 -0
  900. data/lib/wp/wp-includes/default-widgets.php +1423 -0
  901. data/lib/wp/wp-includes/deprecated.php +3501 -0
  902. data/lib/wp/wp-includes/feed-atom-comments.php +115 -0
  903. data/lib/wp/wp-includes/feed-atom.php +87 -0
  904. data/lib/wp/wp-includes/feed-rdf.php +81 -0
  905. data/lib/wp/wp-includes/feed-rss.php +46 -0
  906. data/lib/wp/wp-includes/feed-rss2-comments.php +97 -0
  907. data/lib/wp/wp-includes/feed-rss2.php +115 -0
  908. data/lib/wp/wp-includes/feed.php +659 -0
  909. data/lib/wp/wp-includes/fonts/dashicons.eot +0 -0
  910. data/lib/wp/wp-includes/fonts/dashicons.svg +250 -0
  911. data/lib/wp/wp-includes/fonts/dashicons.ttf +0 -0
  912. data/lib/wp/wp-includes/fonts/dashicons.woff +0 -0
  913. data/lib/wp/wp-includes/formatting.php +4006 -0
  914. data/lib/wp/wp-includes/functions.php +4631 -0
  915. data/lib/wp/wp-includes/functions.wp-scripts.php +258 -0
  916. data/lib/wp/wp-includes/functions.wp-styles.php +245 -0
  917. data/lib/wp/wp-includes/general-template.php +2982 -0
  918. data/lib/wp/wp-includes/http.php +551 -0
  919. data/lib/wp/wp-includes/images/admin-bar-sprite-2x.png +0 -0
  920. data/lib/wp/wp-includes/images/admin-bar-sprite.png +0 -0
  921. data/lib/wp/wp-includes/images/arrow-pointer-blue-2x.png +0 -0
  922. data/lib/wp/wp-includes/images/arrow-pointer-blue.png +0 -0
  923. data/lib/wp/wp-includes/images/blank.gif +0 -0
  924. data/lib/wp/wp-includes/images/crystal/archive.png +0 -0
  925. data/lib/wp/wp-includes/images/crystal/audio.png +0 -0
  926. data/lib/wp/wp-includes/images/crystal/code.png +0 -0
  927. data/lib/wp/wp-includes/images/crystal/default.png +0 -0
  928. data/lib/wp/wp-includes/images/crystal/document.png +0 -0
  929. data/lib/wp/wp-includes/images/crystal/interactive.png +0 -0
  930. data/lib/wp/wp-includes/images/crystal/license.txt +9 -0
  931. data/lib/wp/wp-includes/images/crystal/spreadsheet.png +0 -0
  932. data/lib/wp/wp-includes/images/crystal/text.png +0 -0
  933. data/lib/wp/wp-includes/images/crystal/video.png +0 -0
  934. data/lib/wp/wp-includes/images/down_arrow-2x.gif +0 -0
  935. data/lib/wp/wp-includes/images/down_arrow.gif +0 -0
  936. data/lib/wp/wp-includes/images/icon-pointer-flag-2x.png +0 -0
  937. data/lib/wp/wp-includes/images/icon-pointer-flag.png +0 -0
  938. data/lib/wp/wp-includes/images/media/archive.png +0 -0
  939. data/lib/wp/wp-includes/images/media/audio.png +0 -0
  940. data/lib/wp/wp-includes/images/media/code.png +0 -0
  941. data/lib/wp/wp-includes/images/media/default.png +0 -0
  942. data/lib/wp/wp-includes/images/media/document.png +0 -0
  943. data/lib/wp/wp-includes/images/media/interactive.png +0 -0
  944. data/lib/wp/wp-includes/images/media/spreadsheet.png +0 -0
  945. data/lib/wp/wp-includes/images/media/text.png +0 -0
  946. data/lib/wp/wp-includes/images/media/video.png +0 -0
  947. data/lib/wp/wp-includes/images/rss-2x.png +0 -0
  948. data/lib/wp/wp-includes/images/rss.png +0 -0
  949. data/lib/wp/wp-includes/images/smilies/icon_arrow.gif +0 -0
  950. data/lib/wp/wp-includes/images/smilies/icon_biggrin.gif +0 -0
  951. data/lib/wp/wp-includes/images/smilies/icon_confused.gif +0 -0
  952. data/lib/wp/wp-includes/images/smilies/icon_cool.gif +0 -0
  953. data/lib/wp/wp-includes/images/smilies/icon_cry.gif +0 -0
  954. data/lib/wp/wp-includes/images/smilies/icon_eek.gif +0 -0
  955. data/lib/wp/wp-includes/images/smilies/icon_evil.gif +0 -0
  956. data/lib/wp/wp-includes/images/smilies/icon_exclaim.gif +0 -0
  957. data/lib/wp/wp-includes/images/smilies/icon_idea.gif +0 -0
  958. data/lib/wp/wp-includes/images/smilies/icon_lol.gif +0 -0
  959. data/lib/wp/wp-includes/images/smilies/icon_mad.gif +0 -0
  960. data/lib/wp/wp-includes/images/smilies/icon_mrgreen.gif +0 -0
  961. data/lib/wp/wp-includes/images/smilies/icon_neutral.gif +0 -0
  962. data/lib/wp/wp-includes/images/smilies/icon_question.gif +0 -0
  963. data/lib/wp/wp-includes/images/smilies/icon_razz.gif +0 -0
  964. data/lib/wp/wp-includes/images/smilies/icon_redface.gif +0 -0
  965. data/lib/wp/wp-includes/images/smilies/icon_rolleyes.gif +0 -0
  966. data/lib/wp/wp-includes/images/smilies/icon_sad.gif +0 -0
  967. data/lib/wp/wp-includes/images/smilies/icon_smile.gif +0 -0
  968. data/lib/wp/wp-includes/images/smilies/icon_surprised.gif +0 -0
  969. data/lib/wp/wp-includes/images/smilies/icon_twisted.gif +0 -0
  970. data/lib/wp/wp-includes/images/smilies/icon_wink.gif +0 -0
  971. data/lib/wp/wp-includes/images/spinner-2x.gif +0 -0
  972. data/lib/wp/wp-includes/images/spinner.gif +0 -0
  973. data/lib/wp/wp-includes/images/toggle-arrow-2x.png +0 -0
  974. data/lib/wp/wp-includes/images/toggle-arrow.png +0 -0
  975. data/lib/wp/wp-includes/images/uploader-icons-2x.png +0 -0
  976. data/lib/wp/wp-includes/images/uploader-icons.png +0 -0
  977. data/lib/wp/wp-includes/images/wlw/wp-comments.png +0 -0
  978. data/lib/wp/wp-includes/images/wlw/wp-icon.png +0 -0
  979. data/lib/wp/wp-includes/images/wlw/wp-watermark.png +0 -0
  980. data/lib/wp/wp-includes/images/wpicons-2x.png +0 -0
  981. data/lib/wp/wp-includes/images/wpicons.png +0 -0
  982. data/lib/wp/wp-includes/images/wpspin-2x.gif +0 -0
  983. data/lib/wp/wp-includes/images/wpspin.gif +0 -0
  984. data/lib/wp/wp-includes/images/xit-2x.gif +0 -0
  985. data/lib/wp/wp-includes/images/xit.gif +0 -0
  986. data/lib/wp/wp-includes/js/admin-bar.js +365 -0
  987. data/lib/wp/wp-includes/js/admin-bar.min.js +1 -0
  988. data/lib/wp/wp-includes/js/autosave.js +589 -0
  989. data/lib/wp/wp-includes/js/autosave.min.js +1 -0
  990. data/lib/wp/wp-includes/js/backbone.min.js +1 -0
  991. data/lib/wp/wp-includes/js/colorpicker.js +707 -0
  992. data/lib/wp/wp-includes/js/colorpicker.min.js +1 -0
  993. data/lib/wp/wp-includes/js/comment-reply.js +47 -0
  994. data/lib/wp/wp-includes/js/comment-reply.min.js +1 -0
  995. data/lib/wp/wp-includes/js/crop/cropper.css +165 -0
  996. data/lib/wp/wp-includes/js/crop/cropper.js +516 -0
  997. data/lib/wp/wp-includes/js/crop/marqueeHoriz.gif +0 -0
  998. data/lib/wp/wp-includes/js/crop/marqueeVert.gif +0 -0
  999. data/lib/wp/wp-includes/js/customize-base.js +617 -0
  1000. data/lib/wp/wp-includes/js/customize-base.min.js +1 -0
  1001. data/lib/wp/wp-includes/js/customize-loader.js +246 -0
  1002. data/lib/wp/wp-includes/js/customize-loader.min.js +1 -0
  1003. data/lib/wp/wp-includes/js/customize-models.js +247 -0
  1004. data/lib/wp/wp-includes/js/customize-models.min.js +1 -0
  1005. data/lib/wp/wp-includes/js/customize-preview-widgets.js +129 -0
  1006. data/lib/wp/wp-includes/js/customize-preview-widgets.min.js +1 -0
  1007. data/lib/wp/wp-includes/js/customize-preview.js +154 -0
  1008. data/lib/wp/wp-includes/js/customize-preview.min.js +1 -0
  1009. data/lib/wp/wp-includes/js/customize-views.js +231 -0
  1010. data/lib/wp/wp-includes/js/customize-views.min.js +1 -0
  1011. data/lib/wp/wp-includes/js/heartbeat.js +738 -0
  1012. data/lib/wp/wp-includes/js/heartbeat.min.js +1 -0
  1013. data/lib/wp/wp-includes/js/hoverIntent.js +115 -0
  1014. data/lib/wp/wp-includes/js/hoverIntent.min.js +1 -0
  1015. data/lib/wp/wp-includes/js/imgareaselect/border-anim-h.gif +0 -0
  1016. data/lib/wp/wp-includes/js/imgareaselect/border-anim-v.gif +0 -0
  1017. data/lib/wp/wp-includes/js/imgareaselect/imgareaselect.css +41 -0
  1018. data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.js +1205 -0
  1019. data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.min.js +1 -0
  1020. data/lib/wp/wp-includes/js/jcrop/Jcrop.gif +0 -0
  1021. data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.css +29 -0
  1022. data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.js +22 -0
  1023. data/lib/wp/wp-includes/js/jquery/jquery-migrate.js +521 -0
  1024. data/lib/wp/wp-includes/js/jquery/jquery-migrate.min.js +2 -0
  1025. data/lib/wp/wp-includes/js/jquery/jquery.color.min.js +2 -0
  1026. data/lib/wp/wp-includes/js/jquery/jquery.form.js +1193 -0
  1027. data/lib/wp/wp-includes/js/jquery/jquery.form.min.js +11 -0
  1028. data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.js +134 -0
  1029. data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.min.js +1 -0
  1030. data/lib/wp/wp-includes/js/jquery/jquery.js +5 -0
  1031. data/lib/wp/wp-includes/js/jquery/jquery.masonry.min.js +11 -0
  1032. data/lib/wp/wp-includes/js/jquery/jquery.query.js +11 -0
  1033. data/lib/wp/wp-includes/js/jquery/jquery.schedule.js +36 -0
  1034. data/lib/wp/wp-includes/js/jquery/jquery.serialize-object.js +31 -0
  1035. data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.js +99 -0
  1036. data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.min.js +1 -0
  1037. data/lib/wp/wp-includes/js/jquery/jquery.ui.touch-punch.js +11 -0
  1038. data/lib/wp/wp-includes/js/jquery/suggest.js +316 -0
  1039. data/lib/wp/wp-includes/js/jquery/suggest.min.js +1 -0
  1040. data/lib/wp/wp-includes/js/jquery/ui/accordion.min.js +11 -0
  1041. data/lib/wp/wp-includes/js/jquery/ui/autocomplete.min.js +11 -0
  1042. data/lib/wp/wp-includes/js/jquery/ui/button.min.js +11 -0
  1043. data/lib/wp/wp-includes/js/jquery/ui/core.min.js +11 -0
  1044. data/lib/wp/wp-includes/js/jquery/ui/datepicker.min.js +12 -0
  1045. data/lib/wp/wp-includes/js/jquery/ui/dialog.min.js +11 -0
  1046. data/lib/wp/wp-includes/js/jquery/ui/draggable.min.js +11 -0
  1047. data/lib/wp/wp-includes/js/jquery/ui/droppable.min.js +11 -0
  1048. data/lib/wp/wp-includes/js/jquery/ui/effect-blind.min.js +11 -0
  1049. data/lib/wp/wp-includes/js/jquery/ui/effect-bounce.min.js +11 -0
  1050. data/lib/wp/wp-includes/js/jquery/ui/effect-clip.min.js +11 -0
  1051. data/lib/wp/wp-includes/js/jquery/ui/effect-drop.min.js +11 -0
  1052. data/lib/wp/wp-includes/js/jquery/ui/effect-explode.min.js +11 -0
  1053. data/lib/wp/wp-includes/js/jquery/ui/effect-fade.min.js +11 -0
  1054. data/lib/wp/wp-includes/js/jquery/ui/effect-fold.min.js +11 -0
  1055. data/lib/wp/wp-includes/js/jquery/ui/effect-highlight.min.js +11 -0
  1056. data/lib/wp/wp-includes/js/jquery/ui/effect-puff.min.js +11 -0
  1057. data/lib/wp/wp-includes/js/jquery/ui/effect-pulsate.min.js +11 -0
  1058. data/lib/wp/wp-includes/js/jquery/ui/effect-scale.min.js +11 -0
  1059. data/lib/wp/wp-includes/js/jquery/ui/effect-shake.min.js +11 -0
  1060. data/lib/wp/wp-includes/js/jquery/ui/effect-size.min.js +11 -0
  1061. data/lib/wp/wp-includes/js/jquery/ui/effect-slide.min.js +11 -0
  1062. data/lib/wp/wp-includes/js/jquery/ui/effect-transfer.min.js +11 -0
  1063. data/lib/wp/wp-includes/js/jquery/ui/effect.min.js +21 -0
  1064. data/lib/wp/wp-includes/js/jquery/ui/menu.min.js +11 -0
  1065. data/lib/wp/wp-includes/js/jquery/ui/mouse.min.js +11 -0
  1066. data/lib/wp/wp-includes/js/jquery/ui/position.min.js +11 -0
  1067. data/lib/wp/wp-includes/js/jquery/ui/progressbar.min.js +11 -0
  1068. data/lib/wp/wp-includes/js/jquery/ui/resizable.min.js +11 -0
  1069. data/lib/wp/wp-includes/js/jquery/ui/selectable.min.js +11 -0
  1070. data/lib/wp/wp-includes/js/jquery/ui/selectmenu.min.js +11 -0
  1071. data/lib/wp/wp-includes/js/jquery/ui/slider.min.js +11 -0
  1072. data/lib/wp/wp-includes/js/jquery/ui/sortable.min.js +11 -0
  1073. data/lib/wp/wp-includes/js/jquery/ui/spinner.min.js +11 -0
  1074. data/lib/wp/wp-includes/js/jquery/ui/tabs.min.js +11 -0
  1075. data/lib/wp/wp-includes/js/jquery/ui/tooltip.min.js +11 -0
  1076. data/lib/wp/wp-includes/js/jquery/ui/widget.min.js +11 -0
  1077. data/lib/wp/wp-includes/js/json2.js +480 -0
  1078. data/lib/wp/wp-includes/js/json2.min.js +1 -0
  1079. data/lib/wp/wp-includes/js/masonry.min.js +1 -0
  1080. data/lib/wp/wp-includes/js/mce-view.js +829 -0
  1081. data/lib/wp/wp-includes/js/mce-view.min.js +1 -0
  1082. data/lib/wp/wp-includes/js/media-audiovideo.js +831 -0
  1083. data/lib/wp/wp-includes/js/media-audiovideo.min.js +1 -0
  1084. data/lib/wp/wp-includes/js/media-editor.js +1114 -0
  1085. data/lib/wp/wp-includes/js/media-editor.min.js +1 -0
  1086. data/lib/wp/wp-includes/js/media-grid.js +732 -0
  1087. data/lib/wp/wp-includes/js/media-grid.min.js +1 -0
  1088. data/lib/wp/wp-includes/js/media-models.js +1362 -0
  1089. data/lib/wp/wp-includes/js/media-models.min.js +1 -0
  1090. data/lib/wp/wp-includes/js/media-views.js +7484 -0
  1091. data/lib/wp/wp-includes/js/media-views.min.js +3 -0
  1092. data/lib/wp/wp-includes/js/mediaelement/background.png +0 -0
  1093. data/lib/wp/wp-includes/js/mediaelement/bigplay.png +0 -0
  1094. data/lib/wp/wp-includes/js/mediaelement/bigplay.svg +1 -0
  1095. data/lib/wp/wp-includes/js/mediaelement/controls.png +0 -0
  1096. data/lib/wp/wp-includes/js/mediaelement/controls.svg +1 -0
  1097. data/lib/wp/wp-includes/js/mediaelement/flashmediaelement.swf +0 -0
  1098. data/lib/wp/wp-includes/js/mediaelement/loading.gif +0 -0
  1099. data/lib/wp/wp-includes/js/mediaelement/mediaelement-and-player.min.js +181 -0
  1100. data/lib/wp/wp-includes/js/mediaelement/mediaelementplayer.min.css +1 -0
  1101. data/lib/wp/wp-includes/js/mediaelement/silverlightmediaelement.xap +0 -0
  1102. data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.css +274 -0
  1103. data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.js +34 -0
  1104. data/lib/wp/wp-includes/js/mediaelement/wp-playlist.js +175 -0
  1105. data/lib/wp/wp-includes/js/plupload/handlers.js +488 -0
  1106. data/lib/wp/wp-includes/js/plupload/handlers.min.js +1 -0
  1107. data/lib/wp/wp-includes/js/plupload/license.txt +339 -0
  1108. data/lib/wp/wp-includes/js/plupload/plupload.flash.swf +0 -0
  1109. data/lib/wp/wp-includes/js/plupload/plupload.full.min.js +28 -0
  1110. data/lib/wp/wp-includes/js/plupload/plupload.silverlight.xap +0 -0
  1111. data/lib/wp/wp-includes/js/plupload/wp-plupload.js +376 -0
  1112. data/lib/wp/wp-includes/js/plupload/wp-plupload.min.js +1 -0
  1113. data/lib/wp/wp-includes/js/quicktags.js +652 -0
  1114. data/lib/wp/wp-includes/js/quicktags.min.js +1 -0
  1115. data/lib/wp/wp-includes/js/shortcode.js +356 -0
  1116. data/lib/wp/wp-includes/js/shortcode.min.js +1 -0
  1117. data/lib/wp/wp-includes/js/swfobject.js +4 -0
  1118. data/lib/wp/wp-includes/js/swfupload/handlers.js +376 -0
  1119. data/lib/wp/wp-includes/js/swfupload/handlers.min.js +1 -0
  1120. data/lib/wp/wp-includes/js/swfupload/license.txt +32 -0
  1121. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js +53 -0
  1122. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.queue.js +98 -0
  1123. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.speed.js +342 -0
  1124. data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.swfobject.js +105 -0
  1125. data/lib/wp/wp-includes/js/swfupload/swfupload.js +980 -0
  1126. data/lib/wp/wp-includes/js/swfupload/swfupload.swf +0 -0
  1127. data/lib/wp/wp-includes/js/thickbox/loadingAnimation.gif +0 -0
  1128. data/lib/wp/wp-includes/js/thickbox/macFFBgHack.png +0 -0
  1129. data/lib/wp/wp-includes/js/thickbox/thickbox.css +138 -0
  1130. data/lib/wp/wp-includes/js/thickbox/thickbox.js +314 -0
  1131. data/lib/wp/wp-includes/js/tinymce/langs/wp-langs-en.js +519 -0
  1132. data/lib/wp/wp-includes/js/tinymce/license.txt +504 -0
  1133. data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.js +370 -0
  1134. data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.min.js +1 -0
  1135. data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.js +112 -0
  1136. data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
  1137. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css +212 -0
  1138. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.js +304 -0
  1139. data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
  1140. data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.js +64 -0
  1141. data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.min.js +1 -0
  1142. data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.js +136 -0
  1143. data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
  1144. data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.js +30 -0
  1145. data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.min.js +1 -0
  1146. data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.js +450 -0
  1147. data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.min.js +1 -0
  1148. data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.js +786 -0
  1149. data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.min.js +1 -0
  1150. data/lib/wp/wp-includes/js/tinymce/plugins/media/moxieplayer.swf +0 -0
  1151. data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.js +774 -0
  1152. data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.min.js +1 -0
  1153. data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.js +1553 -0
  1154. data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.min.js +1 -0
  1155. data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.js +125 -0
  1156. data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
  1157. data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.js +272 -0
  1158. data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
  1159. data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.js +513 -0
  1160. data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +1 -0
  1161. data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +207 -0
  1162. data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js +1 -0
  1163. data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js +92 -0
  1164. data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.min.js +1 -0
  1165. data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +1035 -0
  1166. data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +1 -0
  1167. data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js +78 -0
  1168. data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.min.js +1 -0
  1169. data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.js +130 -0
  1170. data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.min.js +1 -0
  1171. data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.js +63 -0
  1172. data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.min.js +1 -0
  1173. data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.js +694 -0
  1174. data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.min.js +1 -0
  1175. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
  1176. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.min.css +1 -0
  1177. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
  1178. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
  1179. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +62 -0
  1180. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  1181. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
  1182. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  1183. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg +63 -0
  1184. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  1185. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  1186. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
  1187. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/loader.gif +0 -0
  1188. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/object.gif +0 -0
  1189. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/trans.gif +0 -0
  1190. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
  1191. data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.min.css +1 -0
  1192. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/audio.png +0 -0
  1193. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png +0 -0
  1194. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png +0 -0
  1195. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/embedded.png +0 -0
  1196. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png +0 -0
  1197. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery.png +0 -0
  1198. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more-2x.png +0 -0
  1199. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more.png +0 -0
  1200. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak-2x.png +0 -0
  1201. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak.png +0 -0
  1202. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-audio.png +0 -0
  1203. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-video.png +0 -0
  1204. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/video.png +0 -0
  1205. data/lib/wp/wp-includes/js/tinymce/skins/wordpress/wp-content.css +618 -0
  1206. data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.js +617 -0
  1207. data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.min.js +1 -0
  1208. data/lib/wp/wp-includes/js/tinymce/tiny_mce_popup.js +539 -0
  1209. data/lib/wp/wp-includes/js/tinymce/tinymce.min.js +11 -0
  1210. data/lib/wp/wp-includes/js/tinymce/utils/editable_selects.js +70 -0
  1211. data/lib/wp/wp-includes/js/tinymce/utils/form_utils.js +210 -0
  1212. data/lib/wp/wp-includes/js/tinymce/utils/mctabs.js +164 -0
  1213. data/lib/wp/wp-includes/js/tinymce/utils/validate.js +252 -0
  1214. data/lib/wp/wp-includes/js/tinymce/wp-mce-help.php +145 -0
  1215. data/lib/wp/wp-includes/js/tinymce/wp-tinymce.js.gz +0 -0
  1216. data/lib/wp/wp-includes/js/tinymce/wp-tinymce.php +39 -0
  1217. data/lib/wp/wp-includes/js/tw-sack.js +193 -0
  1218. data/lib/wp/wp-includes/js/tw-sack.min.js +1 -0
  1219. data/lib/wp/wp-includes/js/underscore.min.js +1 -0
  1220. data/lib/wp/wp-includes/js/utils.js +197 -0
  1221. data/lib/wp/wp-includes/js/utils.min.js +1 -0
  1222. data/lib/wp/wp-includes/js/wp-ajax-response.js +64 -0
  1223. data/lib/wp/wp-includes/js/wp-ajax-response.min.js +1 -0
  1224. data/lib/wp/wp-includes/js/wp-auth-check.js +112 -0
  1225. data/lib/wp/wp-includes/js/wp-auth-check.min.js +1 -0
  1226. data/lib/wp/wp-includes/js/wp-backbone.js +386 -0
  1227. data/lib/wp/wp-includes/js/wp-backbone.min.js +1 -0
  1228. data/lib/wp/wp-includes/js/wp-list-revisions.js +24 -0
  1229. data/lib/wp/wp-includes/js/wp-list-revisions.min.js +1 -0
  1230. data/lib/wp/wp-includes/js/wp-lists.js +469 -0
  1231. data/lib/wp/wp-includes/js/wp-lists.min.js +1 -0
  1232. data/lib/wp/wp-includes/js/wp-pointer.js +282 -0
  1233. data/lib/wp/wp-includes/js/wp-pointer.min.js +1 -0
  1234. data/lib/wp/wp-includes/js/wp-util.js +106 -0
  1235. data/lib/wp/wp-includes/js/wp-util.min.js +1 -0
  1236. data/lib/wp/wp-includes/js/wpdialog.js +19 -0
  1237. data/lib/wp/wp-includes/js/wpdialog.min.js +1 -0
  1238. data/lib/wp/wp-includes/js/wplink.js +615 -0
  1239. data/lib/wp/wp-includes/js/wplink.min.js +1 -0
  1240. data/lib/wp/wp-includes/js/zxcvbn-async.js +18 -0
  1241. data/lib/wp/wp-includes/js/zxcvbn-async.min.js +1 -0
  1242. data/lib/wp/wp-includes/js/zxcvbn.min.js +47 -0
  1243. data/lib/wp/wp-includes/kses.php +1526 -0
  1244. data/lib/wp/wp-includes/l10n.php +908 -0
  1245. data/lib/wp/wp-includes/link-template.php +3141 -0
  1246. data/lib/wp/wp-includes/load.php +828 -0
  1247. data/lib/wp/wp-includes/locale.php +368 -0
  1248. data/lib/wp/wp-includes/media-template.php +1235 -0
  1249. data/lib/wp/wp-includes/media.php +3329 -0
  1250. data/lib/wp/wp-includes/meta.php +1221 -0
  1251. data/lib/wp/wp-includes/ms-blogs.php +939 -0
  1252. data/lib/wp/wp-includes/ms-default-constants.php +153 -0
  1253. data/lib/wp/wp-includes/ms-default-filters.php +82 -0
  1254. data/lib/wp/wp-includes/ms-deprecated.php +347 -0
  1255. data/lib/wp/wp-includes/ms-files.php +82 -0
  1256. data/lib/wp/wp-includes/ms-functions.php +2476 -0
  1257. data/lib/wp/wp-includes/ms-load.php +458 -0
  1258. data/lib/wp/wp-includes/ms-settings.php +213 -0
  1259. data/lib/wp/wp-includes/nav-menu-template.php +678 -0
  1260. data/lib/wp/wp-includes/nav-menu.php +895 -0
  1261. data/lib/wp/wp-includes/option.php +1440 -0
  1262. data/lib/wp/wp-includes/pluggable-deprecated.php +192 -0
  1263. data/lib/wp/wp-includes/pluggable.php +2283 -0
  1264. data/lib/wp/wp-includes/plugin.php +920 -0
  1265. data/lib/wp/wp-includes/pomo/entry.php +78 -0
  1266. data/lib/wp/wp-includes/pomo/mo.php +262 -0
  1267. data/lib/wp/wp-includes/pomo/po.php +384 -0
  1268. data/lib/wp/wp-includes/pomo/streams.php +209 -0
  1269. data/lib/wp/wp-includes/pomo/translations.php +275 -0
  1270. data/lib/wp/wp-includes/post-formats.php +243 -0
  1271. data/lib/wp/wp-includes/post-template.php +1766 -0
  1272. data/lib/wp/wp-includes/post-thumbnail-template.php +142 -0
  1273. data/lib/wp/wp-includes/post.php +5842 -0
  1274. data/lib/wp/wp-includes/query.php +4666 -0
  1275. data/lib/wp/wp-includes/registration-functions.php +7 -0
  1276. data/lib/wp/wp-includes/registration.php +7 -0
  1277. data/lib/wp/wp-includes/revision.php +657 -0
  1278. data/lib/wp/wp-includes/rewrite.php +2180 -0
  1279. data/lib/wp/wp-includes/rss-functions.php +9 -0
  1280. data/lib/wp/wp-includes/rss.php +936 -0
  1281. data/lib/wp/wp-includes/script-loader.php +1045 -0
  1282. data/lib/wp/wp-includes/session.php +430 -0
  1283. data/lib/wp/wp-includes/shortcodes.php +410 -0
  1284. data/lib/wp/wp-includes/taxonomy.php +4006 -0
  1285. data/lib/wp/wp-includes/template-loader.php +76 -0
  1286. data/lib/wp/wp-includes/template.php +505 -0
  1287. data/lib/wp/wp-includes/theme-compat/comments-popup.php +128 -0
  1288. data/lib/wp/wp-includes/theme-compat/comments.php +101 -0
  1289. data/lib/wp/wp-includes/theme-compat/footer.php +30 -0
  1290. data/lib/wp/wp-includes/theme-compat/header.php +49 -0
  1291. data/lib/wp/wp-includes/theme-compat/sidebar.php +83 -0
  1292. data/lib/wp/wp-includes/theme.php +2014 -0
  1293. data/lib/wp/wp-includes/update.php +674 -0
  1294. data/lib/wp/wp-includes/user.php +2292 -0
  1295. data/lib/wp/wp-includes/vars.php +144 -0
  1296. data/lib/wp/wp-includes/version.php +35 -0
  1297. data/lib/wp/wp-includes/widgets.php +1514 -0
  1298. data/lib/wp/wp-includes/wlwmanifest.xml +43 -0
  1299. data/lib/wp/wp-includes/wp-db.php +2190 -0
  1300. data/lib/wp/wp-includes/wp-diff.php +523 -0
  1301. data/lib/wp/wp-links-opml.php +80 -0
  1302. data/lib/wp/wp-load.php +73 -0
  1303. data/lib/wp/wp-login.php +952 -0
  1304. data/lib/wp/wp-mail.php +260 -0
  1305. data/lib/wp/wp-settings.php +374 -0
  1306. data/lib/wp/wp-signup.php +749 -0
  1307. data/lib/wp/wp-trackback.php +127 -0
  1308. data/lib/wp/xmlrpc.php +101 -0
  1309. data/stump-cli.gemspec +26 -0
  1310. metadata +1332 -4
@@ -0,0 +1,4666 @@
1
+ <?php
2
+ /**
3
+ * WordPress Query API
4
+ *
5
+ * The query API attempts to get which part of WordPress the user is on. It
6
+ * also provides functionality for getting URL query information.
7
+ *
8
+ * @link http://codex.wordpress.org/The_Loop More information on The Loop.
9
+ *
10
+ * @package WordPress
11
+ * @subpackage Query
12
+ */
13
+
14
+ /**
15
+ * Retrieve variable in the WP_Query class.
16
+ *
17
+ * @see WP_Query::get()
18
+ * @since 1.5.0
19
+ * @uses $wp_query
20
+ *
21
+ * @param string $var The variable key to retrieve.
22
+ * @param mixed $default Value to return if the query variable is not set. Default ''.
23
+ * @return mixed
24
+ */
25
+ function get_query_var( $var, $default = '' ) {
26
+ global $wp_query;
27
+
28
+ return $wp_query->get( $var, $default );
29
+ }
30
+
31
+ /**
32
+ * Retrieve the currently-queried object. Wrapper for $wp_query->get_queried_object()
33
+ *
34
+ * @uses WP_Query::get_queried_object
35
+ *
36
+ * @since 3.1.0
37
+ * @access public
38
+ *
39
+ * @return object
40
+ */
41
+ function get_queried_object() {
42
+ global $wp_query;
43
+ return $wp_query->get_queried_object();
44
+ }
45
+
46
+ /**
47
+ * Retrieve ID of the current queried object. Wrapper for $wp_query->get_queried_object_id()
48
+ *
49
+ * @uses WP_Query::get_queried_object_id()
50
+ *
51
+ * @since 3.1.0
52
+ * @access public
53
+ *
54
+ * @return int
55
+ */
56
+ function get_queried_object_id() {
57
+ global $wp_query;
58
+ return $wp_query->get_queried_object_id();
59
+ }
60
+
61
+ /**
62
+ * Set query variable.
63
+ *
64
+ * @see WP_Query::set()
65
+ * @since 2.2.0
66
+ * @uses $wp_query
67
+ *
68
+ * @param string $var Query variable key.
69
+ * @param mixed $value
70
+ * @return null
71
+ */
72
+ function set_query_var($var, $value) {
73
+ global $wp_query;
74
+
75
+ return $wp_query->set($var, $value);
76
+ }
77
+
78
+ /**
79
+ * Set up The Loop with query parameters.
80
+ *
81
+ * This will override the current WordPress Loop and shouldn't be used more than
82
+ * once. This must not be used within the WordPress Loop.
83
+ *
84
+ * @since 1.5.0
85
+ * @uses $wp_query
86
+ *
87
+ * @param string $query
88
+ * @return array List of posts
89
+ */
90
+ function query_posts($query) {
91
+ $GLOBALS['wp_query'] = new WP_Query();
92
+ return $GLOBALS['wp_query']->query($query);
93
+ }
94
+
95
+ /**
96
+ * Destroy the previous query and set up a new query.
97
+ *
98
+ * This should be used after {@link query_posts()} and before another {@link
99
+ * query_posts()}. This will remove obscure bugs that occur when the previous
100
+ * wp_query object is not destroyed properly before another is set up.
101
+ *
102
+ * @since 2.3.0
103
+ * @uses $wp_query
104
+ */
105
+ function wp_reset_query() {
106
+ $GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
107
+ wp_reset_postdata();
108
+ }
109
+
110
+ /**
111
+ * After looping through a separate query, this function restores
112
+ * the $post global to the current post in the main query.
113
+ *
114
+ * @since 3.0.0
115
+ * @uses $wp_query
116
+ */
117
+ function wp_reset_postdata() {
118
+ global $wp_query;
119
+
120
+ if ( isset( $wp_query ) ) {
121
+ $wp_query->reset_postdata();
122
+ }
123
+ }
124
+
125
+ /*
126
+ * Query type checks.
127
+ */
128
+
129
+ /**
130
+ * Is the query for an existing archive page?
131
+ *
132
+ * Month, Year, Category, Author, Post Type archive...
133
+ *
134
+ * @see WP_Query::is_archive()
135
+ * @since 1.5.0
136
+ * @uses $wp_query
137
+ *
138
+ * @return bool
139
+ */
140
+ function is_archive() {
141
+ global $wp_query;
142
+
143
+ if ( ! isset( $wp_query ) ) {
144
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
145
+ return false;
146
+ }
147
+
148
+ return $wp_query->is_archive();
149
+ }
150
+
151
+ /**
152
+ * Is the query for an existing post type archive page?
153
+ *
154
+ * @see WP_Query::is_post_type_archive()
155
+ * @since 3.1.0
156
+ * @uses $wp_query
157
+ *
158
+ * @param mixed $post_types Optional. Post type or array of posts types to check against.
159
+ * @return bool
160
+ */
161
+ function is_post_type_archive( $post_types = '' ) {
162
+ global $wp_query;
163
+
164
+ if ( ! isset( $wp_query ) ) {
165
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
166
+ return false;
167
+ }
168
+
169
+ return $wp_query->is_post_type_archive( $post_types );
170
+ }
171
+
172
+ /**
173
+ * Is the query for an existing attachment page?
174
+ *
175
+ * @see WP_Query::is_attachment()
176
+ * @since 2.0.0
177
+ * @uses $wp_query
178
+ *
179
+ * @param mixed $attachment Attachment ID, title, slug, or array of such.
180
+ * @return bool
181
+ */
182
+ function is_attachment( $attachment = '' ) {
183
+ global $wp_query;
184
+
185
+ if ( ! isset( $wp_query ) ) {
186
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
187
+ return false;
188
+ }
189
+
190
+ return $wp_query->is_attachment( $attachment );
191
+ }
192
+
193
+ /**
194
+ * Is the query for an existing author archive page?
195
+ *
196
+ * If the $author parameter is specified, this function will additionally
197
+ * check if the query is for one of the authors specified.
198
+ *
199
+ * @see WP_Query::is_author()
200
+ * @since 1.5.0
201
+ * @uses $wp_query
202
+ *
203
+ * @param mixed $author Optional. User ID, nickname, nicename, or array of User IDs, nicknames, and nicenames
204
+ * @return bool
205
+ */
206
+ function is_author( $author = '' ) {
207
+ global $wp_query;
208
+
209
+ if ( ! isset( $wp_query ) ) {
210
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
211
+ return false;
212
+ }
213
+
214
+ return $wp_query->is_author( $author );
215
+ }
216
+
217
+ /**
218
+ * Is the query for an existing category archive page?
219
+ *
220
+ * If the $category parameter is specified, this function will additionally
221
+ * check if the query is for one of the categories specified.
222
+ *
223
+ * @see WP_Query::is_category()
224
+ * @since 1.5.0
225
+ * @uses $wp_query
226
+ *
227
+ * @param mixed $category Optional. Category ID, name, slug, or array of Category IDs, names, and slugs.
228
+ * @return bool
229
+ */
230
+ function is_category( $category = '' ) {
231
+ global $wp_query;
232
+
233
+ if ( ! isset( $wp_query ) ) {
234
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
235
+ return false;
236
+ }
237
+
238
+ return $wp_query->is_category( $category );
239
+ }
240
+
241
+ /**
242
+ * Is the query for an existing tag archive page?
243
+ *
244
+ * If the $tag parameter is specified, this function will additionally
245
+ * check if the query is for one of the tags specified.
246
+ *
247
+ * @see WP_Query::is_tag()
248
+ * @since 2.3.0
249
+ * @uses $wp_query
250
+ *
251
+ * @param mixed $tag Optional. Tag ID, name, slug, or array of Tag IDs, names, and slugs.
252
+ * @return bool
253
+ */
254
+ function is_tag( $tag = '' ) {
255
+ global $wp_query;
256
+
257
+ if ( ! isset( $wp_query ) ) {
258
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
259
+ return false;
260
+ }
261
+
262
+ return $wp_query->is_tag( $tag );
263
+ }
264
+
265
+ /**
266
+ * Is the query for an existing taxonomy archive page?
267
+ *
268
+ * If the $taxonomy parameter is specified, this function will additionally
269
+ * check if the query is for that specific $taxonomy.
270
+ *
271
+ * If the $term parameter is specified in addition to the $taxonomy parameter,
272
+ * this function will additionally check if the query is for one of the terms
273
+ * specified.
274
+ *
275
+ * @see WP_Query::is_tax()
276
+ * @since 2.5.0
277
+ * @uses $wp_query
278
+ *
279
+ * @param mixed $taxonomy Optional. Taxonomy slug or slugs.
280
+ * @param mixed $term Optional. Term ID, name, slug or array of Term IDs, names, and slugs.
281
+ * @return bool
282
+ */
283
+ function is_tax( $taxonomy = '', $term = '' ) {
284
+ global $wp_query;
285
+
286
+ if ( ! isset( $wp_query ) ) {
287
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
288
+ return false;
289
+ }
290
+
291
+ return $wp_query->is_tax( $taxonomy, $term );
292
+ }
293
+
294
+ /**
295
+ * Whether the current URL is within the comments popup window.
296
+ *
297
+ * @see WP_Query::is_comments_popup()
298
+ * @since 1.5.0
299
+ * @uses $wp_query
300
+ *
301
+ * @return bool
302
+ */
303
+ function is_comments_popup() {
304
+ global $wp_query;
305
+
306
+ if ( ! isset( $wp_query ) ) {
307
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
308
+ return false;
309
+ }
310
+
311
+ return $wp_query->is_comments_popup();
312
+ }
313
+
314
+ /**
315
+ * Is the query for an existing date archive?
316
+ *
317
+ * @see WP_Query::is_date()
318
+ * @since 1.5.0
319
+ * @uses $wp_query
320
+ *
321
+ * @return bool
322
+ */
323
+ function is_date() {
324
+ global $wp_query;
325
+
326
+ if ( ! isset( $wp_query ) ) {
327
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
328
+ return false;
329
+ }
330
+
331
+ return $wp_query->is_date();
332
+ }
333
+
334
+ /**
335
+ * Is the query for an existing day archive?
336
+ *
337
+ * @see WP_Query::is_day()
338
+ * @since 1.5.0
339
+ * @uses $wp_query
340
+ *
341
+ * @return bool
342
+ */
343
+ function is_day() {
344
+ global $wp_query;
345
+
346
+ if ( ! isset( $wp_query ) ) {
347
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
348
+ return false;
349
+ }
350
+
351
+ return $wp_query->is_day();
352
+ }
353
+
354
+ /**
355
+ * Is the query for a feed?
356
+ *
357
+ * @see WP_Query::is_feed()
358
+ * @since 1.5.0
359
+ * @uses $wp_query
360
+ *
361
+ * @param string|array $feeds Optional feed types to check.
362
+ * @return bool
363
+ */
364
+ function is_feed( $feeds = '' ) {
365
+ global $wp_query;
366
+
367
+ if ( ! isset( $wp_query ) ) {
368
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
369
+ return false;
370
+ }
371
+
372
+ return $wp_query->is_feed( $feeds );
373
+ }
374
+
375
+ /**
376
+ * Is the query for a comments feed?
377
+ *
378
+ * @see WP_Query::is_comments_feed()
379
+ * @since 3.0.0
380
+ * @uses $wp_query
381
+ *
382
+ * @return bool
383
+ */
384
+ function is_comment_feed() {
385
+ global $wp_query;
386
+
387
+ if ( ! isset( $wp_query ) ) {
388
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
389
+ return false;
390
+ }
391
+
392
+ return $wp_query->is_comment_feed();
393
+ }
394
+
395
+ /**
396
+ * Is the query for the front page of the site?
397
+ *
398
+ * This is for what is displayed at your site's main URL.
399
+ *
400
+ * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_on_front'.
401
+ *
402
+ * If you set a static page for the front page of your site, this function will return
403
+ * true when viewing that page.
404
+ *
405
+ * Otherwise the same as @see is_home()
406
+ *
407
+ * @see WP_Query::is_front_page()
408
+ * @since 2.5.0
409
+ * @uses is_home()
410
+ * @uses get_option()
411
+ *
412
+ * @return bool True, if front of site.
413
+ */
414
+ function is_front_page() {
415
+ global $wp_query;
416
+
417
+ if ( ! isset( $wp_query ) ) {
418
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
419
+ return false;
420
+ }
421
+
422
+ return $wp_query->is_front_page();
423
+ }
424
+
425
+ /**
426
+ * Is the query for the blog homepage?
427
+ *
428
+ * This is the page which shows the time based blog content of your site.
429
+ *
430
+ * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_for_posts'.
431
+ *
432
+ * If you set a static page for the front page of your site, this function will return
433
+ * true only on the page you set as the "Posts page".
434
+ *
435
+ * @see is_front_page()
436
+ *
437
+ * @see WP_Query::is_home()
438
+ * @since 1.5.0
439
+ * @uses $wp_query
440
+ *
441
+ * @return bool True if blog view homepage.
442
+ */
443
+ function is_home() {
444
+ global $wp_query;
445
+
446
+ if ( ! isset( $wp_query ) ) {
447
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
448
+ return false;
449
+ }
450
+
451
+ return $wp_query->is_home();
452
+ }
453
+
454
+ /**
455
+ * Is the query for an existing month archive?
456
+ *
457
+ * @see WP_Query::is_month()
458
+ * @since 1.5.0
459
+ * @uses $wp_query
460
+ *
461
+ * @return bool
462
+ */
463
+ function is_month() {
464
+ global $wp_query;
465
+
466
+ if ( ! isset( $wp_query ) ) {
467
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
468
+ return false;
469
+ }
470
+
471
+ return $wp_query->is_month();
472
+ }
473
+
474
+ /**
475
+ * Is the query for an existing single page?
476
+ *
477
+ * If the $page parameter is specified, this function will additionally
478
+ * check if the query is for one of the pages specified.
479
+ *
480
+ * @see is_single()
481
+ * @see is_singular()
482
+ *
483
+ * @see WP_Query::is_page()
484
+ * @since 1.5.0
485
+ * @uses $wp_query
486
+ *
487
+ * @param mixed $page Page ID, title, slug, or array of such.
488
+ * @return bool
489
+ */
490
+ function is_page( $page = '' ) {
491
+ global $wp_query;
492
+
493
+ if ( ! isset( $wp_query ) ) {
494
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
495
+ return false;
496
+ }
497
+
498
+ return $wp_query->is_page( $page );
499
+ }
500
+
501
+ /**
502
+ * Is the query for paged result and not for the first page?
503
+ *
504
+ * @see WP_Query::is_paged()
505
+ * @since 1.5.0
506
+ * @uses $wp_query
507
+ *
508
+ * @return bool
509
+ */
510
+ function is_paged() {
511
+ global $wp_query;
512
+
513
+ if ( ! isset( $wp_query ) ) {
514
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
515
+ return false;
516
+ }
517
+
518
+ return $wp_query->is_paged();
519
+ }
520
+
521
+ /**
522
+ * Is the query for a post or page preview?
523
+ *
524
+ * @see WP_Query::is_preview()
525
+ * @since 2.0.0
526
+ * @uses $wp_query
527
+ *
528
+ * @return bool
529
+ */
530
+ function is_preview() {
531
+ global $wp_query;
532
+
533
+ if ( ! isset( $wp_query ) ) {
534
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
535
+ return false;
536
+ }
537
+
538
+ return $wp_query->is_preview();
539
+ }
540
+
541
+ /**
542
+ * Is the query for the robots file?
543
+ *
544
+ * @see WP_Query::is_robots()
545
+ * @since 2.1.0
546
+ * @uses $wp_query
547
+ *
548
+ * @return bool
549
+ */
550
+ function is_robots() {
551
+ global $wp_query;
552
+
553
+ if ( ! isset( $wp_query ) ) {
554
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
555
+ return false;
556
+ }
557
+
558
+ return $wp_query->is_robots();
559
+ }
560
+
561
+ /**
562
+ * Is the query for a search?
563
+ *
564
+ * @see WP_Query::is_search()
565
+ * @since 1.5.0
566
+ * @uses $wp_query
567
+ *
568
+ * @return bool
569
+ */
570
+ function is_search() {
571
+ global $wp_query;
572
+
573
+ if ( ! isset( $wp_query ) ) {
574
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
575
+ return false;
576
+ }
577
+
578
+ return $wp_query->is_search();
579
+ }
580
+
581
+ /**
582
+ * Is the query for an existing single post?
583
+ *
584
+ * Works for any post type, except attachments and pages
585
+ *
586
+ * If the $post parameter is specified, this function will additionally
587
+ * check if the query is for one of the Posts specified.
588
+ *
589
+ * @see is_page()
590
+ * @see is_singular()
591
+ *
592
+ * @see WP_Query::is_single()
593
+ * @since 1.5.0
594
+ * @uses $wp_query
595
+ *
596
+ * @param mixed $post Post ID, title, slug, or array of such.
597
+ * @return bool
598
+ */
599
+ function is_single( $post = '' ) {
600
+ global $wp_query;
601
+
602
+ if ( ! isset( $wp_query ) ) {
603
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
604
+ return false;
605
+ }
606
+
607
+ return $wp_query->is_single( $post );
608
+ }
609
+
610
+ /**
611
+ * Is the query for an existing single post of any post type (post, attachment, page, ... )?
612
+ *
613
+ * If the $post_types parameter is specified, this function will additionally
614
+ * check if the query is for one of the Posts Types specified.
615
+ *
616
+ * @see is_page()
617
+ * @see is_single()
618
+ *
619
+ * @see WP_Query::is_singular()
620
+ * @since 1.5.0
621
+ * @uses $wp_query
622
+ *
623
+ * @param mixed $post_types Optional. Post Type or array of Post Types
624
+ * @return bool
625
+ */
626
+ function is_singular( $post_types = '' ) {
627
+ global $wp_query;
628
+
629
+ if ( ! isset( $wp_query ) ) {
630
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
631
+ return false;
632
+ }
633
+
634
+ return $wp_query->is_singular( $post_types );
635
+ }
636
+
637
+ /**
638
+ * Is the query for a specific time?
639
+ *
640
+ * @see WP_Query::is_time()
641
+ * @since 1.5.0
642
+ * @uses $wp_query
643
+ *
644
+ * @return bool
645
+ */
646
+ function is_time() {
647
+ global $wp_query;
648
+
649
+ if ( ! isset( $wp_query ) ) {
650
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
651
+ return false;
652
+ }
653
+
654
+ return $wp_query->is_time();
655
+ }
656
+
657
+ /**
658
+ * Is the query for a trackback endpoint call?
659
+ *
660
+ * @see WP_Query::is_trackback()
661
+ * @since 1.5.0
662
+ * @uses $wp_query
663
+ *
664
+ * @return bool
665
+ */
666
+ function is_trackback() {
667
+ global $wp_query;
668
+
669
+ if ( ! isset( $wp_query ) ) {
670
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
671
+ return false;
672
+ }
673
+
674
+ return $wp_query->is_trackback();
675
+ }
676
+
677
+ /**
678
+ * Is the query for an existing year archive?
679
+ *
680
+ * @see WP_Query::is_year()
681
+ * @since 1.5.0
682
+ * @uses $wp_query
683
+ *
684
+ * @return bool
685
+ */
686
+ function is_year() {
687
+ global $wp_query;
688
+
689
+ if ( ! isset( $wp_query ) ) {
690
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
691
+ return false;
692
+ }
693
+
694
+ return $wp_query->is_year();
695
+ }
696
+
697
+ /**
698
+ * Is the query a 404 (returns no results)?
699
+ *
700
+ * @see WP_Query::is_404()
701
+ * @since 1.5.0
702
+ * @uses $wp_query
703
+ *
704
+ * @return bool
705
+ */
706
+ function is_404() {
707
+ global $wp_query;
708
+
709
+ if ( ! isset( $wp_query ) ) {
710
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
711
+ return false;
712
+ }
713
+
714
+ return $wp_query->is_404();
715
+ }
716
+
717
+ /**
718
+ * Is the query the main query?
719
+ *
720
+ * @since 3.3.0
721
+ *
722
+ * @return bool
723
+ */
724
+ function is_main_query() {
725
+ if ( 'pre_get_posts' === current_filter() ) {
726
+ $message = sprintf( __( 'In <code>%1$s</code>, use the <code>%2$s</code> method, not the <code>%3$s</code> function. See %4$s.' ),
727
+ 'pre_get_posts', 'WP_Query::is_main_query()', 'is_main_query()', __( 'http://codex.wordpress.org/Function_Reference/is_main_query' ) );
728
+ _doing_it_wrong( __FUNCTION__, $message, '3.7' );
729
+ }
730
+
731
+ global $wp_query;
732
+ return $wp_query->is_main_query();
733
+ }
734
+
735
+ /*
736
+ * The Loop. Post loop control.
737
+ */
738
+
739
+ /**
740
+ * Whether current WordPress query has results to loop over.
741
+ *
742
+ * @see WP_Query::have_posts()
743
+ * @since 1.5.0
744
+ * @uses $wp_query
745
+ *
746
+ * @return bool
747
+ */
748
+ function have_posts() {
749
+ global $wp_query;
750
+
751
+ return $wp_query->have_posts();
752
+ }
753
+
754
+ /**
755
+ * Whether the caller is in the Loop.
756
+ *
757
+ * @since 2.0.0
758
+ * @uses $wp_query
759
+ *
760
+ * @return bool True if caller is within loop, false if loop hasn't started or ended.
761
+ */
762
+ function in_the_loop() {
763
+ global $wp_query;
764
+
765
+ return $wp_query->in_the_loop;
766
+ }
767
+
768
+ /**
769
+ * Rewind the loop posts.
770
+ *
771
+ * @see WP_Query::rewind_posts()
772
+ * @since 1.5.0
773
+ * @uses $wp_query
774
+ *
775
+ * @return null
776
+ */
777
+ function rewind_posts() {
778
+ global $wp_query;
779
+
780
+ return $wp_query->rewind_posts();
781
+ }
782
+
783
+ /**
784
+ * Iterate the post index in the loop.
785
+ *
786
+ * @see WP_Query::the_post()
787
+ * @since 1.5.0
788
+ * @uses $wp_query
789
+ */
790
+ function the_post() {
791
+ global $wp_query;
792
+
793
+ $wp_query->the_post();
794
+ }
795
+
796
+ /*
797
+ * Comments loop.
798
+ */
799
+
800
+ /**
801
+ * Whether there are comments to loop over.
802
+ *
803
+ * @see WP_Query::have_comments()
804
+ * @since 2.2.0
805
+ * @uses $wp_query
806
+ *
807
+ * @return bool
808
+ */
809
+ function have_comments() {
810
+ global $wp_query;
811
+ return $wp_query->have_comments();
812
+ }
813
+
814
+ /**
815
+ * Iterate comment index in the comment loop.
816
+ *
817
+ * @see WP_Query::the_comment()
818
+ * @since 2.2.0
819
+ * @uses $wp_query
820
+ *
821
+ * @return object
822
+ */
823
+ function the_comment() {
824
+ global $wp_query;
825
+ return $wp_query->the_comment();
826
+ }
827
+
828
+ /*
829
+ * WP_Query
830
+ */
831
+
832
+ /**
833
+ * The WordPress Query class.
834
+ *
835
+ * @link http://codex.wordpress.org/Function_Reference/WP_Query Codex page.
836
+ *
837
+ * @since 1.5.0
838
+ */
839
+ class WP_Query {
840
+
841
+ /**
842
+ * Query vars set by the user
843
+ *
844
+ * @since 1.5.0
845
+ * @access public
846
+ * @var array
847
+ */
848
+ public $query;
849
+
850
+ /**
851
+ * Query vars, after parsing
852
+ *
853
+ * @since 1.5.0
854
+ * @access public
855
+ * @var array
856
+ */
857
+ public $query_vars = array();
858
+
859
+ /**
860
+ * Taxonomy query, as passed to get_tax_sql()
861
+ *
862
+ * @since 3.1.0
863
+ * @access public
864
+ * @var object WP_Tax_Query
865
+ */
866
+ public $tax_query;
867
+
868
+ /**
869
+ * Metadata query container
870
+ *
871
+ * @since 3.2.0
872
+ * @access public
873
+ * @var object WP_Meta_Query
874
+ */
875
+ public $meta_query = false;
876
+
877
+ /**
878
+ * Date query container
879
+ *
880
+ * @since 3.7.0
881
+ * @access public
882
+ * @var object WP_Date_Query
883
+ */
884
+ public $date_query = false;
885
+
886
+ /**
887
+ * Holds the data for a single object that is queried.
888
+ *
889
+ * Holds the contents of a post, page, category, attachment.
890
+ *
891
+ * @since 1.5.0
892
+ * @access public
893
+ * @var object|array
894
+ */
895
+ public $queried_object;
896
+
897
+ /**
898
+ * The ID of the queried object.
899
+ *
900
+ * @since 1.5.0
901
+ * @access public
902
+ * @var int
903
+ */
904
+ public $queried_object_id;
905
+
906
+ /**
907
+ * Get post database query.
908
+ *
909
+ * @since 2.0.1
910
+ * @access public
911
+ * @var string
912
+ */
913
+ public $request;
914
+
915
+ /**
916
+ * List of posts.
917
+ *
918
+ * @since 1.5.0
919
+ * @access public
920
+ * @var array
921
+ */
922
+ public $posts;
923
+
924
+ /**
925
+ * The amount of posts for the current query.
926
+ *
927
+ * @since 1.5.0
928
+ * @access public
929
+ * @var int
930
+ */
931
+ public $post_count = 0;
932
+
933
+ /**
934
+ * Index of the current item in the loop.
935
+ *
936
+ * @since 1.5.0
937
+ * @access public
938
+ * @var int
939
+ */
940
+ public $current_post = -1;
941
+
942
+ /**
943
+ * Whether the loop has started and the caller is in the loop.
944
+ *
945
+ * @since 2.0.0
946
+ * @access public
947
+ * @var bool
948
+ */
949
+ public $in_the_loop = false;
950
+
951
+ /**
952
+ * The current post.
953
+ *
954
+ * @since 1.5.0
955
+ * @access public
956
+ * @var WP_Post
957
+ */
958
+ public $post;
959
+
960
+ /**
961
+ * The list of comments for current post.
962
+ *
963
+ * @since 2.2.0
964
+ * @access public
965
+ * @var array
966
+ */
967
+ public $comments;
968
+
969
+ /**
970
+ * The amount of comments for the posts.
971
+ *
972
+ * @since 2.2.0
973
+ * @access public
974
+ * @var int
975
+ */
976
+ public $comment_count = 0;
977
+
978
+ /**
979
+ * The index of the comment in the comment loop.
980
+ *
981
+ * @since 2.2.0
982
+ * @access public
983
+ * @var int
984
+ */
985
+ public $current_comment = -1;
986
+
987
+ /**
988
+ * Current comment ID.
989
+ *
990
+ * @since 2.2.0
991
+ * @access public
992
+ * @var int
993
+ */
994
+ public $comment;
995
+
996
+ /**
997
+ * The amount of found posts for the current query.
998
+ *
999
+ * If limit clause was not used, equals $post_count.
1000
+ *
1001
+ * @since 2.1.0
1002
+ * @access public
1003
+ * @var int
1004
+ */
1005
+ public $found_posts = 0;
1006
+
1007
+ /**
1008
+ * The amount of pages.
1009
+ *
1010
+ * @since 2.1.0
1011
+ * @access public
1012
+ * @var int
1013
+ */
1014
+ public $max_num_pages = 0;
1015
+
1016
+ /**
1017
+ * The amount of comment pages.
1018
+ *
1019
+ * @since 2.7.0
1020
+ * @access public
1021
+ * @var int
1022
+ */
1023
+ public $max_num_comment_pages = 0;
1024
+
1025
+ /**
1026
+ * Set if query is single post.
1027
+ *
1028
+ * @since 1.5.0
1029
+ * @access public
1030
+ * @var bool
1031
+ */
1032
+ public $is_single = false;
1033
+
1034
+ /**
1035
+ * Set if query is preview of blog.
1036
+ *
1037
+ * @since 2.0.0
1038
+ * @access public
1039
+ * @var bool
1040
+ */
1041
+ public $is_preview = false;
1042
+
1043
+ /**
1044
+ * Set if query returns a page.
1045
+ *
1046
+ * @since 1.5.0
1047
+ * @access public
1048
+ * @var bool
1049
+ */
1050
+ public $is_page = false;
1051
+
1052
+ /**
1053
+ * Set if query is an archive list.
1054
+ *
1055
+ * @since 1.5.0
1056
+ * @access public
1057
+ * @var bool
1058
+ */
1059
+ public $is_archive = false;
1060
+
1061
+ /**
1062
+ * Set if query is part of a date.
1063
+ *
1064
+ * @since 1.5.0
1065
+ * @access public
1066
+ * @var bool
1067
+ */
1068
+ public $is_date = false;
1069
+
1070
+ /**
1071
+ * Set if query contains a year.
1072
+ *
1073
+ * @since 1.5.0
1074
+ * @access public
1075
+ * @var bool
1076
+ */
1077
+ public $is_year = false;
1078
+
1079
+ /**
1080
+ * Set if query contains a month.
1081
+ *
1082
+ * @since 1.5.0
1083
+ * @access public
1084
+ * @var bool
1085
+ */
1086
+ public $is_month = false;
1087
+
1088
+ /**
1089
+ * Set if query contains a day.
1090
+ *
1091
+ * @since 1.5.0
1092
+ * @access public
1093
+ * @var bool
1094
+ */
1095
+ public $is_day = false;
1096
+
1097
+ /**
1098
+ * Set if query contains time.
1099
+ *
1100
+ * @since 1.5.0
1101
+ * @access public
1102
+ * @var bool
1103
+ */
1104
+ public $is_time = false;
1105
+
1106
+ /**
1107
+ * Set if query contains an author.
1108
+ *
1109
+ * @since 1.5.0
1110
+ * @access public
1111
+ * @var bool
1112
+ */
1113
+ public $is_author = false;
1114
+
1115
+ /**
1116
+ * Set if query contains category.
1117
+ *
1118
+ * @since 1.5.0
1119
+ * @access public
1120
+ * @var bool
1121
+ */
1122
+ public $is_category = false;
1123
+
1124
+ /**
1125
+ * Set if query contains tag.
1126
+ *
1127
+ * @since 2.3.0
1128
+ * @access public
1129
+ * @var bool
1130
+ */
1131
+ public $is_tag = false;
1132
+
1133
+ /**
1134
+ * Set if query contains taxonomy.
1135
+ *
1136
+ * @since 2.5.0
1137
+ * @access public
1138
+ * @var bool
1139
+ */
1140
+ public $is_tax = false;
1141
+
1142
+ /**
1143
+ * Set if query was part of a search result.
1144
+ *
1145
+ * @since 1.5.0
1146
+ * @access public
1147
+ * @var bool
1148
+ */
1149
+ public $is_search = false;
1150
+
1151
+ /**
1152
+ * Set if query is feed display.
1153
+ *
1154
+ * @since 1.5.0
1155
+ * @access public
1156
+ * @var bool
1157
+ */
1158
+ public $is_feed = false;
1159
+
1160
+ /**
1161
+ * Set if query is comment feed display.
1162
+ *
1163
+ * @since 2.2.0
1164
+ * @access public
1165
+ * @var bool
1166
+ */
1167
+ public $is_comment_feed = false;
1168
+
1169
+ /**
1170
+ * Set if query is trackback.
1171
+ *
1172
+ * @since 1.5.0
1173
+ * @access public
1174
+ * @var bool
1175
+ */
1176
+ public $is_trackback = false;
1177
+
1178
+ /**
1179
+ * Set if query is blog homepage.
1180
+ *
1181
+ * @since 1.5.0
1182
+ * @access public
1183
+ * @var bool
1184
+ */
1185
+ public $is_home = false;
1186
+
1187
+ /**
1188
+ * Set if query couldn't found anything.
1189
+ *
1190
+ * @since 1.5.0
1191
+ * @access public
1192
+ * @var bool
1193
+ */
1194
+ public $is_404 = false;
1195
+
1196
+ /**
1197
+ * Set if query is within comments popup window.
1198
+ *
1199
+ * @since 1.5.0
1200
+ * @access public
1201
+ * @var bool
1202
+ */
1203
+ public $is_comments_popup = false;
1204
+
1205
+ /**
1206
+ * Set if query is paged
1207
+ *
1208
+ * @since 1.5.0
1209
+ * @access public
1210
+ * @var bool
1211
+ */
1212
+ public $is_paged = false;
1213
+
1214
+ /**
1215
+ * Set if query is part of administration page.
1216
+ *
1217
+ * @since 1.5.0
1218
+ * @access public
1219
+ * @var bool
1220
+ */
1221
+ public $is_admin = false;
1222
+
1223
+ /**
1224
+ * Set if query is an attachment.
1225
+ *
1226
+ * @since 2.0.0
1227
+ * @access public
1228
+ * @var bool
1229
+ */
1230
+ public $is_attachment = false;
1231
+
1232
+ /**
1233
+ * Set if is single, is a page, or is an attachment.
1234
+ *
1235
+ * @since 2.1.0
1236
+ * @access public
1237
+ * @var bool
1238
+ */
1239
+ public $is_singular = false;
1240
+
1241
+ /**
1242
+ * Set if query is for robots.
1243
+ *
1244
+ * @since 2.1.0
1245
+ * @access public
1246
+ * @var bool
1247
+ */
1248
+ public $is_robots = false;
1249
+
1250
+ /**
1251
+ * Set if query contains posts.
1252
+ *
1253
+ * Basically, the homepage if the option isn't set for the static homepage.
1254
+ *
1255
+ * @since 2.1.0
1256
+ * @access public
1257
+ * @var bool
1258
+ */
1259
+ public $is_posts_page = false;
1260
+
1261
+ /**
1262
+ * Set if query is for a post type archive.
1263
+ *
1264
+ * @since 3.1.0
1265
+ * @access public
1266
+ * @var bool
1267
+ */
1268
+ public $is_post_type_archive = false;
1269
+
1270
+ /**
1271
+ * Stores the ->query_vars state like md5(serialize( $this->query_vars ) ) so we know
1272
+ * whether we have to re-parse because something has changed
1273
+ *
1274
+ * @since 3.1.0
1275
+ * @access private
1276
+ */
1277
+ private $query_vars_hash = false;
1278
+
1279
+ /**
1280
+ * Whether query vars have changed since the initial parse_query() call. Used to catch modifications to query vars made
1281
+ * via pre_get_posts hooks.
1282
+ *
1283
+ * @since 3.1.1
1284
+ * @access private
1285
+ */
1286
+ private $query_vars_changed = true;
1287
+
1288
+ /**
1289
+ * Set if post thumbnails are cached
1290
+ *
1291
+ * @since 3.2.0
1292
+ * @access public
1293
+ * @var bool
1294
+ */
1295
+ public $thumbnails_cached = false;
1296
+
1297
+ /**
1298
+ * Cached list of search stopwords.
1299
+ *
1300
+ * @since 3.7.0
1301
+ * @var array
1302
+ */
1303
+ private $stopwords;
1304
+
1305
+ /**
1306
+ * Resets query flags to false.
1307
+ *
1308
+ * The query flags are what page info WordPress was able to figure out.
1309
+ *
1310
+ * @since 2.0.0
1311
+ * @access private
1312
+ */
1313
+ private function init_query_flags() {
1314
+ $this->is_single = false;
1315
+ $this->is_preview = false;
1316
+ $this->is_page = false;
1317
+ $this->is_archive = false;
1318
+ $this->is_date = false;
1319
+ $this->is_year = false;
1320
+ $this->is_month = false;
1321
+ $this->is_day = false;
1322
+ $this->is_time = false;
1323
+ $this->is_author = false;
1324
+ $this->is_category = false;
1325
+ $this->is_tag = false;
1326
+ $this->is_tax = false;
1327
+ $this->is_search = false;
1328
+ $this->is_feed = false;
1329
+ $this->is_comment_feed = false;
1330
+ $this->is_trackback = false;
1331
+ $this->is_home = false;
1332
+ $this->is_404 = false;
1333
+ $this->is_comments_popup = false;
1334
+ $this->is_paged = false;
1335
+ $this->is_admin = false;
1336
+ $this->is_attachment = false;
1337
+ $this->is_singular = false;
1338
+ $this->is_robots = false;
1339
+ $this->is_posts_page = false;
1340
+ $this->is_post_type_archive = false;
1341
+ }
1342
+
1343
+ /**
1344
+ * Initiates object properties and sets default values.
1345
+ *
1346
+ * @since 1.5.0
1347
+ * @access public
1348
+ */
1349
+ public function init() {
1350
+ unset($this->posts);
1351
+ unset($this->query);
1352
+ $this->query_vars = array();
1353
+ unset($this->queried_object);
1354
+ unset($this->queried_object_id);
1355
+ $this->post_count = 0;
1356
+ $this->current_post = -1;
1357
+ $this->in_the_loop = false;
1358
+ unset( $this->request );
1359
+ unset( $this->post );
1360
+ unset( $this->comments );
1361
+ unset( $this->comment );
1362
+ $this->comment_count = 0;
1363
+ $this->current_comment = -1;
1364
+ $this->found_posts = 0;
1365
+ $this->max_num_pages = 0;
1366
+ $this->max_num_comment_pages = 0;
1367
+
1368
+ $this->init_query_flags();
1369
+ }
1370
+
1371
+ /**
1372
+ * Reparse the query vars.
1373
+ *
1374
+ * @since 1.5.0
1375
+ * @access public
1376
+ */
1377
+ public function parse_query_vars() {
1378
+ $this->parse_query();
1379
+ }
1380
+
1381
+ /**
1382
+ * Fills in the query variables, which do not exist within the parameter.
1383
+ *
1384
+ * @since 2.1.0
1385
+ * @access public
1386
+ *
1387
+ * @param array $array Defined query variables.
1388
+ * @return array Complete query variables with undefined ones filled in empty.
1389
+ */
1390
+ public function fill_query_vars($array) {
1391
+ $keys = array(
1392
+ 'error'
1393
+ , 'm'
1394
+ , 'p'
1395
+ , 'post_parent'
1396
+ , 'subpost'
1397
+ , 'subpost_id'
1398
+ , 'attachment'
1399
+ , 'attachment_id'
1400
+ , 'name'
1401
+ , 'static'
1402
+ , 'pagename'
1403
+ , 'page_id'
1404
+ , 'second'
1405
+ , 'minute'
1406
+ , 'hour'
1407
+ , 'day'
1408
+ , 'monthnum'
1409
+ , 'year'
1410
+ , 'w'
1411
+ , 'category_name'
1412
+ , 'tag'
1413
+ , 'cat'
1414
+ , 'tag_id'
1415
+ , 'author'
1416
+ , 'author_name'
1417
+ , 'feed'
1418
+ , 'tb'
1419
+ , 'paged'
1420
+ , 'comments_popup'
1421
+ , 'meta_key'
1422
+ , 'meta_value'
1423
+ , 'preview'
1424
+ , 's'
1425
+ , 'sentence'
1426
+ , 'fields'
1427
+ , 'menu_order'
1428
+ );
1429
+
1430
+ foreach ( $keys as $key ) {
1431
+ if ( !isset($array[$key]) )
1432
+ $array[$key] = '';
1433
+ }
1434
+
1435
+ $array_keys = array( 'category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in',
1436
+ 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'post_parent__in', 'post_parent__not_in',
1437
+ 'author__in', 'author__not_in' );
1438
+
1439
+ foreach ( $array_keys as $key ) {
1440
+ if ( !isset($array[$key]) )
1441
+ $array[$key] = array();
1442
+ }
1443
+ return $array;
1444
+ }
1445
+
1446
+ /**
1447
+ * Parse a query string and set query type booleans.
1448
+ *
1449
+ * @since 1.5.0
1450
+ * @access public
1451
+ *
1452
+ * @param string|array $query {
1453
+ * Optional. Array or string of Query parameters.
1454
+ *
1455
+ * @type int $attachment_id Attachment post ID. Used for 'attachment' post_type.
1456
+ * @type int|string $author Author ID, or comma-separated list of IDs.
1457
+ * @type string $author_name User 'user_nicename'.
1458
+ * @type array $author__in An array of author IDs to query from.
1459
+ * @type array $author__not_in An array of author IDs not to query from.
1460
+ * @type bool $cache_results Whether to cache post information. Default true.
1461
+ * @type int|string $cat Category ID or comma-separated list of IDs (this or any children).
1462
+ * @type array $category__and An array of category IDs (AND in).
1463
+ * @type array $category__in An array of category IDs (OR in, no children).
1464
+ * @type array $category__not_in An array of category IDs (NOT in).
1465
+ * @type string $category_name Use category slug (not name, this or any children).
1466
+ * @type int $comments_per_page The number of comments to return per page.
1467
+ * Default 'comments_per_page' option.
1468
+ * @type int|string $comments_popup Whether the query is within the comments popup. Default empty.
1469
+ * @type array $date_query An associative array of WP_Date_Query arguments.
1470
+ * {@see WP_Date_Query::__construct()}
1471
+ * @type int $day Day of the month. Default empty. Accepts numbers 1-31.
1472
+ * @type bool $exact Whether to search by exact keyword. Default false.
1473
+ * @type string|array $fields Which fields to return. Single field or all fields (string),
1474
+ * or array of fields. 'id=>parent' uses 'id' and 'post_parent'.
1475
+ * Default all fields. Accepts 'ids', 'id=>parent'.
1476
+ * @type int $hour Hour of the day. Default empty. Accepts numbers 0-23.
1477
+ * @type bool $ignore_sticky_posts Whether to ignore sticky posts or not. Setting this to false
1478
+ * excludes stickies from 'post__in'. Accepts 1|true, 0|false.
1479
+ * Default 0|false.
1480
+ * @type int $m Combination YearMonth. Accepts any four-digit year and month
1481
+ * numbers 1-12. Default empty.
1482
+ * @type string $meta_compare Comparison operator to test the 'meta_value'.
1483
+ * @type string $meta_key Custom field key.
1484
+ * @type array $meta_query An associative array of WP_Meta_Query arguments.
1485
+ * {@see WP_Meta_Query->queries}
1486
+ * @type string $meta_value Custom field value.
1487
+ * @type int $meta_value_num Custom field value number.
1488
+ * @type int $menu_order The menu order of the posts.
1489
+ * @type int $monthnum The two-digit month. Default empty. Accepts numbers 1-12.
1490
+ * @type string $name Post slug.
1491
+ * @type bool $nopaging Show all posts (true) or paginate (false). Default false.
1492
+ * @type bool $no_found_rows Whether to skip counting the total rows found. Enabling can improve
1493
+ * performance. Default false.
1494
+ * @type int $offset The number of posts to offset before retrieval.
1495
+ * @type string $order Designates ascending or descending order of posts. Default 'DESC'.
1496
+ * Accepts 'ASC', 'DESC'.
1497
+ * @type string $orderby Sort retrieved posts by parameter. One or more options can be
1498
+ * passed. To use 'meta_value', or 'meta_value_num',
1499
+ * 'meta_key=keyname' must be also be defined. Default 'date'.
1500
+ * Accepts 'none', 'name', 'author', 'date', 'title', 'modified',
1501
+ * 'menu_order', 'parent', 'ID', 'rand', 'comment_count'.
1502
+ * @type int $p Post ID.
1503
+ * @type int $page Show the number of posts that would show up on page X of a
1504
+ * static front page.
1505
+ * @type int $paged The number of the current page.
1506
+ * @type int $page_id Page ID.
1507
+ * @type string $pagename Page slug.
1508
+ * @type string $perm Show posts if user has the appropriate capability.
1509
+ * @type array $post__in An array of post IDs to retrieve, sticky posts will be included
1510
+ * @type string $post_mime_type The mime type of the post. Used for 'attachment' post_type.
1511
+ * @type array $post__not_in An array of post IDs not to retrieve. Note: a string of comma-
1512
+ * separated IDs will NOT work.
1513
+ * @type int $post_parent Page ID to retrieve child pages for. Use 0 to only retrieve
1514
+ * top-level pages.
1515
+ * @type array $post_parent__in An array containing parent page IDs to query child pages from.
1516
+ * @type array $post_parent__not_in An array containing parent page IDs not to query child pages from.
1517
+ * @type string|array $post_type A post type slug (string) or array of post type slugs.
1518
+ * Default 'any' if using 'tax_query'.
1519
+ * @type string|array $post_status A post status (string) or array of post statuses.
1520
+ * @type int $posts_per_page The number of posts to query for. Use -1 to request all posts.
1521
+ * @type int $posts_per_archive_page The number of posts to query for by archive page. Overrides
1522
+ * 'posts_per_page' when is_archive(), or is_search() are true.
1523
+ * @type string $s Search keyword.
1524
+ * @type int $second Second of the minute. Default empty. Accepts numbers 0-60.
1525
+ * @type array $search_terms Array of search terms.
1526
+ * @type bool $sentence Whether to search by phrase. Default false.
1527
+ * @type bool $suppress_filters Whether to suppress filters. Default false.
1528
+ * @type string $tag Tag slug. Comma-separated (either), Plus-separated (all).
1529
+ * @type array $tag__and An array of tag ids (AND in).
1530
+ * @type array $tag__in An array of tag ids (OR in).
1531
+ * @type array $tag__not_in An array of tag ids (NOT in).
1532
+ * @type int $tag_id Tag id or comma-separated list of IDs.
1533
+ * @type array $tag_slug__and An array of tag slugs (AND in).
1534
+ * @type array $tag_slug__in An array of tag slugs (OR in). unless 'ignore_sticky_posts' is
1535
+ * true. Note: a string of comma-separated IDs will NOT work.
1536
+ * @type array $tax_query An associative array of WP_Tax_Query arguments.
1537
+ * {@see WP_Tax_Query->queries}
1538
+ * @type bool $update_post_meta_cache Whether to update the post meta cache. Default true.
1539
+ * @type bool $update_post_term_cache Whether to update the post term cache. Default true.
1540
+ * @type int $w The week number of the year. Default empty. Accepts numbers 0-53.
1541
+ * @type int $year The four-digit year. Default empty. Accepts any four-digit year.
1542
+ * }
1543
+ */
1544
+ public function parse_query( $query = '' ) {
1545
+ if ( ! empty( $query ) ) {
1546
+ $this->init();
1547
+ $this->query = $this->query_vars = wp_parse_args( $query );
1548
+ } elseif ( ! isset( $this->query ) ) {
1549
+ $this->query = $this->query_vars;
1550
+ }
1551
+
1552
+ $this->query_vars = $this->fill_query_vars($this->query_vars);
1553
+ $qv = &$this->query_vars;
1554
+ $this->query_vars_changed = true;
1555
+
1556
+ if ( ! empty($qv['robots']) )
1557
+ $this->is_robots = true;
1558
+
1559
+ $qv['p'] = absint($qv['p']);
1560
+ $qv['page_id'] = absint($qv['page_id']);
1561
+ $qv['year'] = absint($qv['year']);
1562
+ $qv['monthnum'] = absint($qv['monthnum']);
1563
+ $qv['day'] = absint($qv['day']);
1564
+ $qv['w'] = absint($qv['w']);
1565
+ $qv['m'] = preg_replace( '|[^0-9]|', '', $qv['m'] );
1566
+ $qv['paged'] = absint($qv['paged']);
1567
+ $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers
1568
+ $qv['author'] = preg_replace( '|[^0-9,-]|', '', $qv['author'] ); // comma separated list of positive or negative integers
1569
+ $qv['pagename'] = trim( $qv['pagename'] );
1570
+ $qv['name'] = trim( $qv['name'] );
1571
+ if ( '' !== $qv['hour'] ) $qv['hour'] = absint($qv['hour']);
1572
+ if ( '' !== $qv['minute'] ) $qv['minute'] = absint($qv['minute']);
1573
+ if ( '' !== $qv['second'] ) $qv['second'] = absint($qv['second']);
1574
+ if ( '' !== $qv['menu_order'] ) $qv['menu_order'] = absint($qv['menu_order']);
1575
+
1576
+ // Fairly insane upper bound for search string lengths.
1577
+ if ( ! empty( $qv['s'] ) && strlen( $qv['s'] ) > 1600 )
1578
+ $qv['s'] = '';
1579
+
1580
+ // Compat. Map subpost to attachment.
1581
+ if ( '' != $qv['subpost'] )
1582
+ $qv['attachment'] = $qv['subpost'];
1583
+ if ( '' != $qv['subpost_id'] )
1584
+ $qv['attachment_id'] = $qv['subpost_id'];
1585
+
1586
+ $qv['attachment_id'] = absint($qv['attachment_id']);
1587
+
1588
+ if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) {
1589
+ $this->is_single = true;
1590
+ $this->is_attachment = true;
1591
+ } elseif ( '' != $qv['name'] ) {
1592
+ $this->is_single = true;
1593
+ } elseif ( $qv['p'] ) {
1594
+ $this->is_single = true;
1595
+ } elseif ( ('' !== $qv['hour']) && ('' !== $qv['minute']) &&('' !== $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day']) ) {
1596
+ // If year, month, day, hour, minute, and second are set, a single
1597
+ // post is being queried.
1598
+ $this->is_single = true;
1599
+ } elseif ( '' != $qv['static'] || '' != $qv['pagename'] || !empty($qv['page_id']) ) {
1600
+ $this->is_page = true;
1601
+ $this->is_single = false;
1602
+ } else {
1603
+ // Look for archive queries. Dates, categories, authors, search, post type archives.
1604
+
1605
+ if ( isset( $this->query['s'] ) ) {
1606
+ $this->is_search = true;
1607
+ }
1608
+
1609
+ if ( '' !== $qv['second'] ) {
1610
+ $this->is_time = true;
1611
+ $this->is_date = true;
1612
+ }
1613
+
1614
+ if ( '' !== $qv['minute'] ) {
1615
+ $this->is_time = true;
1616
+ $this->is_date = true;
1617
+ }
1618
+
1619
+ if ( '' !== $qv['hour'] ) {
1620
+ $this->is_time = true;
1621
+ $this->is_date = true;
1622
+ }
1623
+
1624
+ if ( $qv['day'] ) {
1625
+ if ( ! $this->is_date ) {
1626
+ $date = sprintf( '%04d-%02d-%02d', $qv['year'], $qv['monthnum'], $qv['day'] );
1627
+ if ( $qv['monthnum'] && $qv['year'] && ! wp_checkdate( $qv['monthnum'], $qv['day'], $qv['year'], $date ) ) {
1628
+ $qv['error'] = '404';
1629
+ } else {
1630
+ $this->is_day = true;
1631
+ $this->is_date = true;
1632
+ }
1633
+ }
1634
+ }
1635
+
1636
+ if ( $qv['monthnum'] ) {
1637
+ if ( ! $this->is_date ) {
1638
+ if ( 12 < $qv['monthnum'] ) {
1639
+ $qv['error'] = '404';
1640
+ } else {
1641
+ $this->is_month = true;
1642
+ $this->is_date = true;
1643
+ }
1644
+ }
1645
+ }
1646
+
1647
+ if ( $qv['year'] ) {
1648
+ if ( ! $this->is_date ) {
1649
+ $this->is_year = true;
1650
+ $this->is_date = true;
1651
+ }
1652
+ }
1653
+
1654
+ if ( $qv['m'] ) {
1655
+ $this->is_date = true;
1656
+ if ( strlen($qv['m']) > 9 ) {
1657
+ $this->is_time = true;
1658
+ } else if ( strlen($qv['m']) > 7 ) {
1659
+ $this->is_day = true;
1660
+ } else if ( strlen($qv['m']) > 5 ) {
1661
+ $this->is_month = true;
1662
+ } else {
1663
+ $this->is_year = true;
1664
+ }
1665
+ }
1666
+
1667
+ if ( '' != $qv['w'] ) {
1668
+ $this->is_date = true;
1669
+ }
1670
+
1671
+ $this->query_vars_hash = false;
1672
+ $this->parse_tax_query( $qv );
1673
+
1674
+ foreach ( $this->tax_query->queries as $tax_query ) {
1675
+ if ( 'NOT IN' != $tax_query['operator'] ) {
1676
+ switch ( $tax_query['taxonomy'] ) {
1677
+ case 'category':
1678
+ $this->is_category = true;
1679
+ break;
1680
+ case 'post_tag':
1681
+ $this->is_tag = true;
1682
+ break;
1683
+ default:
1684
+ $this->is_tax = true;
1685
+ }
1686
+ }
1687
+ }
1688
+ unset( $tax_query );
1689
+
1690
+ if ( empty($qv['author']) || ($qv['author'] == '0') ) {
1691
+ $this->is_author = false;
1692
+ } else {
1693
+ $this->is_author = true;
1694
+ }
1695
+
1696
+ if ( '' != $qv['author_name'] )
1697
+ $this->is_author = true;
1698
+
1699
+ if ( !empty( $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {
1700
+ $post_type_obj = get_post_type_object( $qv['post_type'] );
1701
+ if ( ! empty( $post_type_obj->has_archive ) )
1702
+ $this->is_post_type_archive = true;
1703
+ }
1704
+
1705
+ if ( $this->is_post_type_archive || $this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax )
1706
+ $this->is_archive = true;
1707
+ }
1708
+
1709
+ if ( '' != $qv['feed'] )
1710
+ $this->is_feed = true;
1711
+
1712
+ if ( '' != $qv['tb'] )
1713
+ $this->is_trackback = true;
1714
+
1715
+ if ( '' != $qv['paged'] && ( intval($qv['paged']) > 1 ) )
1716
+ $this->is_paged = true;
1717
+
1718
+ if ( '' != $qv['comments_popup'] )
1719
+ $this->is_comments_popup = true;
1720
+
1721
+ // if we're previewing inside the write screen
1722
+ if ( '' != $qv['preview'] )
1723
+ $this->is_preview = true;
1724
+
1725
+ if ( is_admin() )
1726
+ $this->is_admin = true;
1727
+
1728
+ if ( false !== strpos($qv['feed'], 'comments-') ) {
1729
+ $qv['feed'] = str_replace('comments-', '', $qv['feed']);
1730
+ $qv['withcomments'] = 1;
1731
+ }
1732
+
1733
+ $this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;
1734
+
1735
+ if ( $this->is_feed && ( !empty($qv['withcomments']) || ( empty($qv['withoutcomments']) && $this->is_singular ) ) )
1736
+ $this->is_comment_feed = true;
1737
+
1738
+ if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup || $this->is_robots ) )
1739
+ $this->is_home = true;
1740
+
1741
+ // Correct is_* for page_on_front and page_for_posts
1742
+ if ( $this->is_home && 'page' == get_option('show_on_front') && get_option('page_on_front') ) {
1743
+ $_query = wp_parse_args($this->query);
1744
+ // pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename.
1745
+ if ( isset($_query['pagename']) && '' == $_query['pagename'] )
1746
+ unset($_query['pagename']);
1747
+ if ( empty($_query) || !array_diff( array_keys($_query), array('preview', 'page', 'paged', 'cpage') ) ) {
1748
+ $this->is_page = true;
1749
+ $this->is_home = false;
1750
+ $qv['page_id'] = get_option('page_on_front');
1751
+ // Correct <!--nextpage--> for page_on_front
1752
+ if ( !empty($qv['paged']) ) {
1753
+ $qv['page'] = $qv['paged'];
1754
+ unset($qv['paged']);
1755
+ }
1756
+ }
1757
+ }
1758
+
1759
+ if ( '' != $qv['pagename'] ) {
1760
+ $this->queried_object = get_page_by_path($qv['pagename']);
1761
+ if ( !empty($this->queried_object) )
1762
+ $this->queried_object_id = (int) $this->queried_object->ID;
1763
+ else
1764
+ unset($this->queried_object);
1765
+
1766
+ if ( 'page' == get_option('show_on_front') && isset($this->queried_object_id) && $this->queried_object_id == get_option('page_for_posts') ) {
1767
+ $this->is_page = false;
1768
+ $this->is_home = true;
1769
+ $this->is_posts_page = true;
1770
+ }
1771
+ }
1772
+
1773
+ if ( $qv['page_id'] ) {
1774
+ if ( 'page' == get_option('show_on_front') && $qv['page_id'] == get_option('page_for_posts') ) {
1775
+ $this->is_page = false;
1776
+ $this->is_home = true;
1777
+ $this->is_posts_page = true;
1778
+ }
1779
+ }
1780
+
1781
+ if ( !empty($qv['post_type']) ) {
1782
+ if ( is_array($qv['post_type']) )
1783
+ $qv['post_type'] = array_map('sanitize_key', $qv['post_type']);
1784
+ else
1785
+ $qv['post_type'] = sanitize_key($qv['post_type']);
1786
+ }
1787
+
1788
+ if ( ! empty( $qv['post_status'] ) ) {
1789
+ if ( is_array( $qv['post_status'] ) )
1790
+ $qv['post_status'] = array_map('sanitize_key', $qv['post_status']);
1791
+ else
1792
+ $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']);
1793
+ }
1794
+
1795
+ if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) )
1796
+ $this->is_comment_feed = false;
1797
+
1798
+ $this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;
1799
+ // Done correcting is_* for page_on_front and page_for_posts
1800
+
1801
+ if ( '404' == $qv['error'] )
1802
+ $this->set_404();
1803
+
1804
+ $this->query_vars_hash = md5( serialize( $this->query_vars ) );
1805
+ $this->query_vars_changed = false;
1806
+
1807
+ /**
1808
+ * Fires after the main query vars have been parsed.
1809
+ *
1810
+ * @since 1.5.0
1811
+ *
1812
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
1813
+ */
1814
+ do_action_ref_array( 'parse_query', array( &$this ) );
1815
+ }
1816
+
1817
+ /**
1818
+ * Parses various taxonomy related query vars.
1819
+ *
1820
+ * For BC, this method is not marked as protected. See [28987].
1821
+ *
1822
+ * @access protected
1823
+ * @since 3.1.0
1824
+ *
1825
+ * @param array &$q The query variables
1826
+ */
1827
+ function parse_tax_query( &$q ) {
1828
+ if ( ! empty( $q['tax_query'] ) && is_array( $q['tax_query'] ) ) {
1829
+ $tax_query = $q['tax_query'];
1830
+ } else {
1831
+ $tax_query = array();
1832
+ }
1833
+
1834
+ if ( !empty($q['taxonomy']) && !empty($q['term']) ) {
1835
+ $tax_query[] = array(
1836
+ 'taxonomy' => $q['taxonomy'],
1837
+ 'terms' => array( $q['term'] ),
1838
+ 'field' => 'slug',
1839
+ );
1840
+ }
1841
+
1842
+ foreach ( get_taxonomies( array() , 'objects' ) as $taxonomy => $t ) {
1843
+ if ( 'post_tag' == $taxonomy )
1844
+ continue; // Handled further down in the $q['tag'] block
1845
+
1846
+ if ( $t->query_var && !empty( $q[$t->query_var] ) ) {
1847
+ $tax_query_defaults = array(
1848
+ 'taxonomy' => $taxonomy,
1849
+ 'field' => 'slug',
1850
+ );
1851
+
1852
+ if ( isset( $t->rewrite['hierarchical'] ) && $t->rewrite['hierarchical'] ) {
1853
+ $q[$t->query_var] = wp_basename( $q[$t->query_var] );
1854
+ }
1855
+
1856
+ $term = $q[$t->query_var];
1857
+
1858
+ if ( strpos($term, '+') !== false ) {
1859
+ $terms = preg_split( '/[+]+/', $term );
1860
+ foreach ( $terms as $term ) {
1861
+ $tax_query[] = array_merge( $tax_query_defaults, array(
1862
+ 'terms' => array( $term )
1863
+ ) );
1864
+ }
1865
+ } else {
1866
+ $tax_query[] = array_merge( $tax_query_defaults, array(
1867
+ 'terms' => preg_split( '/[,]+/', $term )
1868
+ ) );
1869
+ }
1870
+ }
1871
+ }
1872
+
1873
+ // Category stuff
1874
+ if ( ! empty( $q['cat'] ) && ! $this->is_singular ) {
1875
+ $cat_in = $cat_not_in = array();
1876
+
1877
+ $cat_array = preg_split( '/[,\s]+/', urldecode( $q['cat'] ) );
1878
+ $cat_array = array_map( 'intval', $cat_array );
1879
+ $q['cat'] = implode( ',', $cat_array );
1880
+
1881
+ foreach ( $cat_array as $cat ) {
1882
+ if ( $cat > 0 )
1883
+ $cat_in[] = $cat;
1884
+ elseif ( $cat < 0 )
1885
+ $cat_not_in[] = abs( $cat );
1886
+ }
1887
+
1888
+ if ( ! empty( $cat_in ) ) {
1889
+ $tax_query[] = array(
1890
+ 'taxonomy' => 'category',
1891
+ 'terms' => $cat_in,
1892
+ 'field' => 'term_id',
1893
+ 'include_children' => true
1894
+ );
1895
+ }
1896
+
1897
+ if ( ! empty( $cat_not_in ) ) {
1898
+ $tax_query[] = array(
1899
+ 'taxonomy' => 'category',
1900
+ 'terms' => $cat_not_in,
1901
+ 'field' => 'term_id',
1902
+ 'operator' => 'NOT IN',
1903
+ 'include_children' => true
1904
+ );
1905
+ }
1906
+ unset( $cat_array, $cat_in, $cat_not_in );
1907
+ }
1908
+
1909
+ if ( ! empty( $q['category__and'] ) && 1 === count( (array) $q['category__and'] ) ) {
1910
+ $q['category__and'] = (array) $q['category__and'];
1911
+ if ( ! isset( $q['category__in'] ) )
1912
+ $q['category__in'] = array();
1913
+ $q['category__in'][] = absint( reset( $q['category__and'] ) );
1914
+ unset( $q['category__and'] );
1915
+ }
1916
+
1917
+ if ( ! empty( $q['category__in'] ) ) {
1918
+ $q['category__in'] = array_map( 'absint', array_unique( (array) $q['category__in'] ) );
1919
+ $tax_query[] = array(
1920
+ 'taxonomy' => 'category',
1921
+ 'terms' => $q['category__in'],
1922
+ 'field' => 'term_id',
1923
+ 'include_children' => false
1924
+ );
1925
+ }
1926
+
1927
+ if ( ! empty($q['category__not_in']) ) {
1928
+ $q['category__not_in'] = array_map( 'absint', array_unique( (array) $q['category__not_in'] ) );
1929
+ $tax_query[] = array(
1930
+ 'taxonomy' => 'category',
1931
+ 'terms' => $q['category__not_in'],
1932
+ 'operator' => 'NOT IN',
1933
+ 'include_children' => false
1934
+ );
1935
+ }
1936
+
1937
+ if ( ! empty($q['category__and']) ) {
1938
+ $q['category__and'] = array_map( 'absint', array_unique( (array) $q['category__and'] ) );
1939
+ $tax_query[] = array(
1940
+ 'taxonomy' => 'category',
1941
+ 'terms' => $q['category__and'],
1942
+ 'field' => 'term_id',
1943
+ 'operator' => 'AND',
1944
+ 'include_children' => false
1945
+ );
1946
+ }
1947
+
1948
+ // Tag stuff
1949
+ if ( '' != $q['tag'] && !$this->is_singular && $this->query_vars_changed ) {
1950
+ if ( strpos($q['tag'], ',') !== false ) {
1951
+ $tags = preg_split('/[,\r\n\t ]+/', $q['tag']);
1952
+ foreach ( (array) $tags as $tag ) {
1953
+ $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
1954
+ $q['tag_slug__in'][] = $tag;
1955
+ }
1956
+ } else if ( preg_match('/[+\r\n\t ]+/', $q['tag']) || !empty($q['cat']) ) {
1957
+ $tags = preg_split('/[+\r\n\t ]+/', $q['tag']);
1958
+ foreach ( (array) $tags as $tag ) {
1959
+ $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
1960
+ $q['tag_slug__and'][] = $tag;
1961
+ }
1962
+ } else {
1963
+ $q['tag'] = sanitize_term_field('slug', $q['tag'], 0, 'post_tag', 'db');
1964
+ $q['tag_slug__in'][] = $q['tag'];
1965
+ }
1966
+ }
1967
+
1968
+ if ( !empty($q['tag_id']) ) {
1969
+ $q['tag_id'] = absint( $q['tag_id'] );
1970
+ $tax_query[] = array(
1971
+ 'taxonomy' => 'post_tag',
1972
+ 'terms' => $q['tag_id']
1973
+ );
1974
+ }
1975
+
1976
+ if ( !empty($q['tag__in']) ) {
1977
+ $q['tag__in'] = array_map('absint', array_unique( (array) $q['tag__in'] ) );
1978
+ $tax_query[] = array(
1979
+ 'taxonomy' => 'post_tag',
1980
+ 'terms' => $q['tag__in']
1981
+ );
1982
+ }
1983
+
1984
+ if ( !empty($q['tag__not_in']) ) {
1985
+ $q['tag__not_in'] = array_map('absint', array_unique( (array) $q['tag__not_in'] ) );
1986
+ $tax_query[] = array(
1987
+ 'taxonomy' => 'post_tag',
1988
+ 'terms' => $q['tag__not_in'],
1989
+ 'operator' => 'NOT IN'
1990
+ );
1991
+ }
1992
+
1993
+ if ( !empty($q['tag__and']) ) {
1994
+ $q['tag__and'] = array_map('absint', array_unique( (array) $q['tag__and'] ) );
1995
+ $tax_query[] = array(
1996
+ 'taxonomy' => 'post_tag',
1997
+ 'terms' => $q['tag__and'],
1998
+ 'operator' => 'AND'
1999
+ );
2000
+ }
2001
+
2002
+ if ( !empty($q['tag_slug__in']) ) {
2003
+ $q['tag_slug__in'] = array_map('sanitize_title_for_query', array_unique( (array) $q['tag_slug__in'] ) );
2004
+ $tax_query[] = array(
2005
+ 'taxonomy' => 'post_tag',
2006
+ 'terms' => $q['tag_slug__in'],
2007
+ 'field' => 'slug'
2008
+ );
2009
+ }
2010
+
2011
+ if ( !empty($q['tag_slug__and']) ) {
2012
+ $q['tag_slug__and'] = array_map('sanitize_title_for_query', array_unique( (array) $q['tag_slug__and'] ) );
2013
+ $tax_query[] = array(
2014
+ 'taxonomy' => 'post_tag',
2015
+ 'terms' => $q['tag_slug__and'],
2016
+ 'field' => 'slug',
2017
+ 'operator' => 'AND'
2018
+ );
2019
+ }
2020
+
2021
+ $this->tax_query = new WP_Tax_Query( $tax_query );
2022
+
2023
+ /**
2024
+ * Fires after taxonomy-related query vars have been parsed.
2025
+ *
2026
+ * @since 3.7.0
2027
+ *
2028
+ * @param WP_Query $this The WP_Query instance.
2029
+ */
2030
+ do_action( 'parse_tax_query', $this );
2031
+ }
2032
+
2033
+ /**
2034
+ * Generate SQL for the WHERE clause based on passed search terms.
2035
+ *
2036
+ * @since 3.7.0
2037
+ *
2038
+ * @global wpdb $wpdb
2039
+ * @param array $q Query variables.
2040
+ * @return string WHERE clause.
2041
+ */
2042
+ protected function parse_search( &$q ) {
2043
+ global $wpdb;
2044
+
2045
+ $search = '';
2046
+
2047
+ // added slashes screw with quote grouping when done early, so done later
2048
+ $q['s'] = stripslashes( $q['s'] );
2049
+ if ( empty( $_GET['s'] ) && $this->is_main_query() )
2050
+ $q['s'] = urldecode( $q['s'] );
2051
+ // there are no line breaks in <input /> fields
2052
+ $q['s'] = str_replace( array( "\r", "\n" ), '', $q['s'] );
2053
+ $q['search_terms_count'] = 1;
2054
+ if ( ! empty( $q['sentence'] ) ) {
2055
+ $q['search_terms'] = array( $q['s'] );
2056
+ } else {
2057
+ if ( preg_match_all( '/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $q['s'], $matches ) ) {
2058
+ $q['search_terms_count'] = count( $matches[0] );
2059
+ $q['search_terms'] = $this->parse_search_terms( $matches[0] );
2060
+ // if the search string has only short terms or stopwords, or is 10+ terms long, match it as sentence
2061
+ if ( empty( $q['search_terms'] ) || count( $q['search_terms'] ) > 9 )
2062
+ $q['search_terms'] = array( $q['s'] );
2063
+ } else {
2064
+ $q['search_terms'] = array( $q['s'] );
2065
+ }
2066
+ }
2067
+
2068
+ $n = ! empty( $q['exact'] ) ? '' : '%';
2069
+ $searchand = '';
2070
+ $q['search_orderby_title'] = array();
2071
+ foreach ( $q['search_terms'] as $term ) {
2072
+ if ( $n ) {
2073
+ $like = '%' . $wpdb->esc_like( $term ) . '%';
2074
+ $q['search_orderby_title'][] = $wpdb->prepare( "$wpdb->posts.post_title LIKE %s", $like );
2075
+ }
2076
+
2077
+ $like = $n . $wpdb->esc_like( $term ) . $n;
2078
+ $search .= $wpdb->prepare( "{$searchand}(($wpdb->posts.post_title LIKE %s) OR ($wpdb->posts.post_content LIKE %s))", $like, $like );
2079
+ $searchand = ' AND ';
2080
+ }
2081
+
2082
+ if ( ! empty( $search ) ) {
2083
+ $search = " AND ({$search}) ";
2084
+ if ( ! is_user_logged_in() )
2085
+ $search .= " AND ($wpdb->posts.post_password = '') ";
2086
+ }
2087
+
2088
+ return $search;
2089
+ }
2090
+
2091
+ /**
2092
+ * Check if the terms are suitable for searching.
2093
+ *
2094
+ * Uses an array of stopwords (terms) that are excluded from the separate
2095
+ * term matching when searching for posts. The list of English stopwords is
2096
+ * the approximate search engines list, and is translatable.
2097
+ *
2098
+ * @since 3.7.0
2099
+ *
2100
+ * @param array Terms to check.
2101
+ * @return array Terms that are not stopwords.
2102
+ */
2103
+ protected function parse_search_terms( $terms ) {
2104
+ $strtolower = function_exists( 'mb_strtolower' ) ? 'mb_strtolower' : 'strtolower';
2105
+ $checked = array();
2106
+
2107
+ $stopwords = $this->get_search_stopwords();
2108
+
2109
+ foreach ( $terms as $term ) {
2110
+ // keep before/after spaces when term is for exact match
2111
+ if ( preg_match( '/^".+"$/', $term ) )
2112
+ $term = trim( $term, "\"'" );
2113
+ else
2114
+ $term = trim( $term, "\"' " );
2115
+
2116
+ // Avoid single A-Z.
2117
+ if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z]$/i', $term ) ) )
2118
+ continue;
2119
+
2120
+ if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) )
2121
+ continue;
2122
+
2123
+ $checked[] = $term;
2124
+ }
2125
+
2126
+ return $checked;
2127
+ }
2128
+
2129
+ /**
2130
+ * Retrieve stopwords used when parsing search terms.
2131
+ *
2132
+ * @since 3.7.0
2133
+ *
2134
+ * @return array Stopwords.
2135
+ */
2136
+ protected function get_search_stopwords() {
2137
+ if ( isset( $this->stopwords ) )
2138
+ return $this->stopwords;
2139
+
2140
+ /* translators: This is a comma-separated list of very common words that should be excluded from a search,
2141
+ * like a, an, and the. These are usually called "stopwords". You should not simply translate these individual
2142
+ * words into your language. Instead, look for and provide commonly accepted stopwords in your language.
2143
+ */
2144
+ $words = explode( ',', _x( 'about,an,are,as,at,be,by,com,for,from,how,in,is,it,of,on,or,that,the,this,to,was,what,when,where,who,will,with,www',
2145
+ 'Comma-separated list of search stopwords in your language' ) );
2146
+
2147
+ $stopwords = array();
2148
+ foreach( $words as $word ) {
2149
+ $word = trim( $word, "\r\n\t " );
2150
+ if ( $word )
2151
+ $stopwords[] = $word;
2152
+ }
2153
+
2154
+ /**
2155
+ * Filter stopwords used when parsing search terms.
2156
+ *
2157
+ * @since 3.7.0
2158
+ *
2159
+ * @param array $stopwords Stopwords.
2160
+ */
2161
+ $this->stopwords = apply_filters( 'wp_search_stopwords', $stopwords );
2162
+ return $this->stopwords;
2163
+ }
2164
+
2165
+ /**
2166
+ * Generate SQL for the ORDER BY condition based on passed search terms.
2167
+ *
2168
+ * @global wpdb $wpdb
2169
+ * @param array $q Query variables.
2170
+ * @return string ORDER BY clause.
2171
+ */
2172
+ protected function parse_search_order( &$q ) {
2173
+ global $wpdb;
2174
+
2175
+ if ( $q['search_terms_count'] > 1 ) {
2176
+ $num_terms = count( $q['search_orderby_title'] );
2177
+ $like = '%' . $wpdb->esc_like( $q['s'] ) . '%';
2178
+
2179
+ $search_orderby = '(CASE ';
2180
+ // sentence match in 'post_title'
2181
+ $search_orderby .= $wpdb->prepare( "WHEN $wpdb->posts.post_title LIKE %s THEN 1 ", $like );
2182
+
2183
+ // sanity limit, sort as sentence when more than 6 terms
2184
+ // (few searches are longer than 6 terms and most titles are not)
2185
+ if ( $num_terms < 7 ) {
2186
+ // all words in title
2187
+ $search_orderby .= 'WHEN ' . implode( ' AND ', $q['search_orderby_title'] ) . ' THEN 2 ';
2188
+ // any word in title, not needed when $num_terms == 1
2189
+ if ( $num_terms > 1 )
2190
+ $search_orderby .= 'WHEN ' . implode( ' OR ', $q['search_orderby_title'] ) . ' THEN 3 ';
2191
+ }
2192
+
2193
+ // sentence match in 'post_content'
2194
+ $search_orderby .= $wpdb->prepare( "WHEN $wpdb->posts.post_content LIKE %s THEN 4 ", $like );
2195
+ $search_orderby .= 'ELSE 5 END)';
2196
+ } else {
2197
+ // single word or sentence search
2198
+ $search_orderby = reset( $q['search_orderby_title'] ) . ' DESC';
2199
+ }
2200
+
2201
+ return $search_orderby;
2202
+ }
2203
+
2204
+ /**
2205
+ * If the passed orderby value is allowed, convert the alias to a
2206
+ * properly-prefixed orderby value.
2207
+ *
2208
+ * @since 4.0.0
2209
+ * @access protected
2210
+ *
2211
+ * @global wpdb $wpdb WordPress database access abstraction object.
2212
+ *
2213
+ * @param string $orderby Alias for the field to order by.
2214
+ * @return string|bool Table-prefixed value to used in the ORDER clause. False otherwise.
2215
+ */
2216
+ protected function parse_orderby( $orderby ) {
2217
+ global $wpdb;
2218
+
2219
+ // Used to filter values.
2220
+ $allowed_keys = array(
2221
+ 'post_name', 'post_author', 'post_date', 'post_title', 'post_modified',
2222
+ 'post_parent', 'post_type', 'name', 'author', 'date', 'title', 'modified',
2223
+ 'parent', 'type', 'ID', 'menu_order', 'comment_count', 'rand',
2224
+ );
2225
+
2226
+ $primary_meta_key = '';
2227
+ $primary_meta_query = false;
2228
+ if ( ! empty( $this->meta_query->queries ) ) {
2229
+ $primary_meta_query = reset( $this->meta_query->queries );
2230
+
2231
+ if ( ! empty( $primary_meta_query['key'] ) ) {
2232
+ $primary_meta_key = $primary_meta_query['key'];
2233
+ $allowed_keys[] = $primary_meta_key;
2234
+ }
2235
+
2236
+ $allowed_keys[] = 'meta_value';
2237
+ $allowed_keys[] = 'meta_value_num';
2238
+ }
2239
+
2240
+ if ( ! in_array( $orderby, $allowed_keys ) ) {
2241
+ return false;
2242
+ }
2243
+
2244
+ switch ( $orderby ) {
2245
+ case 'post_name':
2246
+ case 'post_author':
2247
+ case 'post_date':
2248
+ case 'post_title':
2249
+ case 'post_modified':
2250
+ case 'post_parent':
2251
+ case 'post_type':
2252
+ case 'ID':
2253
+ case 'menu_order':
2254
+ case 'comment_count':
2255
+ $orderby = "$wpdb->posts.{$orderby}";
2256
+ break;
2257
+ case 'rand':
2258
+ $orderby = 'RAND()';
2259
+ break;
2260
+ case $primary_meta_key:
2261
+ case 'meta_value':
2262
+ if ( ! empty( $primary_meta_query['type'] ) ) {
2263
+ $sql_type = $this->meta_query->get_cast_for_type( $primary_meta_query['type'] );
2264
+ $orderby = "CAST($wpdb->postmeta.meta_value AS {$sql_type})";
2265
+ } else {
2266
+ $orderby = "$wpdb->postmeta.meta_value";
2267
+ }
2268
+ break;
2269
+ case 'meta_value_num':
2270
+ $orderby = "$wpdb->postmeta.meta_value+0";
2271
+ break;
2272
+ default:
2273
+ $orderby = "$wpdb->posts.post_" . $orderby;
2274
+ break;
2275
+ }
2276
+
2277
+ return $orderby;
2278
+ }
2279
+
2280
+ /**
2281
+ * Parse an 'order' query variable and cast it to ASC or DESC as necessary.
2282
+ *
2283
+ * @since 4.0.0
2284
+ * @access protected
2285
+ *
2286
+ * @param string $order The 'order' query variable.
2287
+ * @return string The sanitized 'order' query variable.
2288
+ */
2289
+ protected function parse_order( $order ) {
2290
+ if ( ! is_string( $order ) || empty( $order ) ) {
2291
+ return 'DESC';
2292
+ }
2293
+
2294
+ if ( 'ASC' === strtoupper( $order ) ) {
2295
+ return 'ASC';
2296
+ } else {
2297
+ return 'DESC';
2298
+ }
2299
+ }
2300
+
2301
+ /**
2302
+ * Sets the 404 property and saves whether query is feed.
2303
+ *
2304
+ * @since 2.0.0
2305
+ * @access public
2306
+ */
2307
+ public function set_404() {
2308
+ $is_feed = $this->is_feed;
2309
+
2310
+ $this->init_query_flags();
2311
+ $this->is_404 = true;
2312
+
2313
+ $this->is_feed = $is_feed;
2314
+ }
2315
+
2316
+ /**
2317
+ * Retrieve query variable.
2318
+ *
2319
+ * @since 1.5.0
2320
+ * @access public
2321
+ *
2322
+ * @param string $query_var Query variable key.
2323
+ * @param mixed $default Value to return if the query variable is not set. Default ''.
2324
+ * @return mixed
2325
+ */
2326
+ public function get( $query_var, $default = '' ) {
2327
+ if ( isset( $this->query_vars[ $query_var ] ) ) {
2328
+ return $this->query_vars[ $query_var ];
2329
+ }
2330
+
2331
+ return $default;
2332
+ }
2333
+
2334
+ /**
2335
+ * Set query variable.
2336
+ *
2337
+ * @since 1.5.0
2338
+ * @access public
2339
+ *
2340
+ * @param string $query_var Query variable key.
2341
+ * @param mixed $value Query variable value.
2342
+ */
2343
+ public function set($query_var, $value) {
2344
+ $this->query_vars[$query_var] = $value;
2345
+ }
2346
+
2347
+ /**
2348
+ * Retrieve the posts based on query variables.
2349
+ *
2350
+ * There are a few filters and actions that can be used to modify the post
2351
+ * database query.
2352
+ *
2353
+ * @since 1.5.0
2354
+ * @access public
2355
+ * @uses do_action_ref_array() Calls 'pre_get_posts' hook before retrieving posts.
2356
+ *
2357
+ * @return array List of posts.
2358
+ */
2359
+ public function get_posts() {
2360
+ global $wpdb;
2361
+
2362
+ $this->parse_query();
2363
+
2364
+ /**
2365
+ * Fires after the query variable object is created, but before the actual query is run.
2366
+ *
2367
+ * Note: If using conditional tags, use the method versions within the passed instance
2368
+ * (e.g. $this->is_main_query() instead of is_main_query()). This is because the functions
2369
+ * like is_main_query() test against the global $wp_query instance, not the passed one.
2370
+ *
2371
+ * @since 2.0.0
2372
+ *
2373
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
2374
+ */
2375
+ do_action_ref_array( 'pre_get_posts', array( &$this ) );
2376
+
2377
+ // Shorthand.
2378
+ $q = &$this->query_vars;
2379
+
2380
+ // Fill again in case pre_get_posts unset some vars.
2381
+ $q = $this->fill_query_vars($q);
2382
+
2383
+ // Parse meta query
2384
+ $this->meta_query = new WP_Meta_Query();
2385
+ $this->meta_query->parse_query_vars( $q );
2386
+
2387
+ // Set a flag if a pre_get_posts hook changed the query vars.
2388
+ $hash = md5( serialize( $this->query_vars ) );
2389
+ if ( $hash != $this->query_vars_hash ) {
2390
+ $this->query_vars_changed = true;
2391
+ $this->query_vars_hash = $hash;
2392
+ }
2393
+ unset($hash);
2394
+
2395
+ // First let's clear some variables
2396
+ $distinct = '';
2397
+ $whichauthor = '';
2398
+ $whichmimetype = '';
2399
+ $where = '';
2400
+ $limits = '';
2401
+ $join = '';
2402
+ $search = '';
2403
+ $groupby = '';
2404
+ $post_status_join = false;
2405
+ $page = 1;
2406
+
2407
+ if ( isset( $q['caller_get_posts'] ) ) {
2408
+ _deprecated_argument( 'WP_Query', '3.1', __( '"caller_get_posts" is deprecated. Use "ignore_sticky_posts" instead.' ) );
2409
+ if ( !isset( $q['ignore_sticky_posts'] ) )
2410
+ $q['ignore_sticky_posts'] = $q['caller_get_posts'];
2411
+ }
2412
+
2413
+ if ( !isset( $q['ignore_sticky_posts'] ) )
2414
+ $q['ignore_sticky_posts'] = false;
2415
+
2416
+ if ( !isset($q['suppress_filters']) )
2417
+ $q['suppress_filters'] = false;
2418
+
2419
+ if ( !isset($q['cache_results']) ) {
2420
+ if ( wp_using_ext_object_cache() )
2421
+ $q['cache_results'] = false;
2422
+ else
2423
+ $q['cache_results'] = true;
2424
+ }
2425
+
2426
+ if ( !isset($q['update_post_term_cache']) )
2427
+ $q['update_post_term_cache'] = true;
2428
+
2429
+ if ( !isset($q['update_post_meta_cache']) )
2430
+ $q['update_post_meta_cache'] = true;
2431
+
2432
+ if ( !isset($q['post_type']) ) {
2433
+ if ( $this->is_search )
2434
+ $q['post_type'] = 'any';
2435
+ else
2436
+ $q['post_type'] = '';
2437
+ }
2438
+ $post_type = $q['post_type'];
2439
+ if ( empty( $q['posts_per_page'] ) ) {
2440
+ $q['posts_per_page'] = get_option( 'posts_per_page' );
2441
+ }
2442
+ if ( isset($q['showposts']) && $q['showposts'] ) {
2443
+ $q['showposts'] = (int) $q['showposts'];
2444
+ $q['posts_per_page'] = $q['showposts'];
2445
+ }
2446
+ if ( (isset($q['posts_per_archive_page']) && $q['posts_per_archive_page'] != 0) && ($this->is_archive || $this->is_search) )
2447
+ $q['posts_per_page'] = $q['posts_per_archive_page'];
2448
+ if ( !isset($q['nopaging']) ) {
2449
+ if ( $q['posts_per_page'] == -1 ) {
2450
+ $q['nopaging'] = true;
2451
+ } else {
2452
+ $q['nopaging'] = false;
2453
+ }
2454
+ }
2455
+
2456
+ if ( $this->is_feed ) {
2457
+ // This overrides posts_per_page.
2458
+ if ( ! empty( $q['posts_per_rss'] ) ) {
2459
+ $q['posts_per_page'] = $q['posts_per_rss'];
2460
+ } else {
2461
+ $q['posts_per_page'] = get_option( 'posts_per_rss' );
2462
+ }
2463
+ $q['nopaging'] = false;
2464
+ }
2465
+ $q['posts_per_page'] = (int) $q['posts_per_page'];
2466
+ if ( $q['posts_per_page'] < -1 )
2467
+ $q['posts_per_page'] = abs($q['posts_per_page']);
2468
+ else if ( $q['posts_per_page'] == 0 )
2469
+ $q['posts_per_page'] = 1;
2470
+
2471
+ if ( !isset($q['comments_per_page']) || $q['comments_per_page'] == 0 )
2472
+ $q['comments_per_page'] = get_option('comments_per_page');
2473
+
2474
+ if ( $this->is_home && (empty($this->query) || $q['preview'] == 'true') && ( 'page' == get_option('show_on_front') ) && get_option('page_on_front') ) {
2475
+ $this->is_page = true;
2476
+ $this->is_home = false;
2477
+ $q['page_id'] = get_option('page_on_front');
2478
+ }
2479
+
2480
+ if ( isset($q['page']) ) {
2481
+ $q['page'] = trim($q['page'], '/');
2482
+ $q['page'] = absint($q['page']);
2483
+ }
2484
+
2485
+ // If true, forcibly turns off SQL_CALC_FOUND_ROWS even when limits are present.
2486
+ if ( isset($q['no_found_rows']) )
2487
+ $q['no_found_rows'] = (bool) $q['no_found_rows'];
2488
+ else
2489
+ $q['no_found_rows'] = false;
2490
+
2491
+ switch ( $q['fields'] ) {
2492
+ case 'ids':
2493
+ $fields = "$wpdb->posts.ID";
2494
+ break;
2495
+ case 'id=>parent':
2496
+ $fields = "$wpdb->posts.ID, $wpdb->posts.post_parent";
2497
+ break;
2498
+ default:
2499
+ $fields = "$wpdb->posts.*";
2500
+ }
2501
+
2502
+ if ( '' !== $q['menu_order'] )
2503
+ $where .= " AND $wpdb->posts.menu_order = " . $q['menu_order'];
2504
+
2505
+ // The "m" parameter is meant for months but accepts datetimes of varying specificity
2506
+ if ( $q['m'] ) {
2507
+ $where .= " AND YEAR($wpdb->posts.post_date)=" . substr($q['m'], 0, 4);
2508
+ if ( strlen($q['m']) > 5 )
2509
+ $where .= " AND MONTH($wpdb->posts.post_date)=" . substr($q['m'], 4, 2);
2510
+ if ( strlen($q['m']) > 7 )
2511
+ $where .= " AND DAYOFMONTH($wpdb->posts.post_date)=" . substr($q['m'], 6, 2);
2512
+ if ( strlen($q['m']) > 9 )
2513
+ $where .= " AND HOUR($wpdb->posts.post_date)=" . substr($q['m'], 8, 2);
2514
+ if ( strlen($q['m']) > 11 )
2515
+ $where .= " AND MINUTE($wpdb->posts.post_date)=" . substr($q['m'], 10, 2);
2516
+ if ( strlen($q['m']) > 13 )
2517
+ $where .= " AND SECOND($wpdb->posts.post_date)=" . substr($q['m'], 12, 2);
2518
+ }
2519
+
2520
+ // Handle the other individual date parameters
2521
+ $date_parameters = array();
2522
+
2523
+ if ( '' !== $q['hour'] )
2524
+ $date_parameters['hour'] = $q['hour'];
2525
+
2526
+ if ( '' !== $q['minute'] )
2527
+ $date_parameters['minute'] = $q['minute'];
2528
+
2529
+ if ( '' !== $q['second'] )
2530
+ $date_parameters['second'] = $q['second'];
2531
+
2532
+ if ( $q['year'] )
2533
+ $date_parameters['year'] = $q['year'];
2534
+
2535
+ if ( $q['monthnum'] )
2536
+ $date_parameters['monthnum'] = $q['monthnum'];
2537
+
2538
+ if ( $q['w'] )
2539
+ $date_parameters['week'] = $q['w'];
2540
+
2541
+ if ( $q['day'] )
2542
+ $date_parameters['day'] = $q['day'];
2543
+
2544
+ if ( $date_parameters ) {
2545
+ $date_query = new WP_Date_Query( array( $date_parameters ) );
2546
+ $where .= $date_query->get_sql();
2547
+ }
2548
+ unset( $date_parameters, $date_query );
2549
+
2550
+ // Handle complex date queries
2551
+ if ( ! empty( $q['date_query'] ) ) {
2552
+ $this->date_query = new WP_Date_Query( $q['date_query'] );
2553
+ $where .= $this->date_query->get_sql();
2554
+ }
2555
+
2556
+
2557
+ // If we've got a post_type AND it's not "any" post_type.
2558
+ if ( !empty($q['post_type']) && 'any' != $q['post_type'] ) {
2559
+ foreach ( (array)$q['post_type'] as $_post_type ) {
2560
+ $ptype_obj = get_post_type_object($_post_type);
2561
+ if ( !$ptype_obj || !$ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) )
2562
+ continue;
2563
+
2564
+ if ( ! $ptype_obj->hierarchical ) {
2565
+ // Non-hierarchical post types can directly use 'name'.
2566
+ $q['name'] = $q[ $ptype_obj->query_var ];
2567
+ } else {
2568
+ // Hierarchical post types will operate through 'pagename'.
2569
+ $q['pagename'] = $q[ $ptype_obj->query_var ];
2570
+ $q['name'] = '';
2571
+ }
2572
+
2573
+ // Only one request for a slug is possible, this is why name & pagename are overwritten above.
2574
+ break;
2575
+ } //end foreach
2576
+ unset($ptype_obj);
2577
+ }
2578
+
2579
+ if ( '' != $q['name'] ) {
2580
+ $q['name'] = sanitize_title_for_query( $q['name'] );
2581
+ $where .= " AND $wpdb->posts.post_name = '" . $q['name'] . "'";
2582
+ } elseif ( '' != $q['pagename'] ) {
2583
+ if ( isset($this->queried_object_id) ) {
2584
+ $reqpage = $this->queried_object_id;
2585
+ } else {
2586
+ if ( 'page' != $q['post_type'] ) {
2587
+ foreach ( (array)$q['post_type'] as $_post_type ) {
2588
+ $ptype_obj = get_post_type_object($_post_type);
2589
+ if ( !$ptype_obj || !$ptype_obj->hierarchical )
2590
+ continue;
2591
+
2592
+ $reqpage = get_page_by_path($q['pagename'], OBJECT, $_post_type);
2593
+ if ( $reqpage )
2594
+ break;
2595
+ }
2596
+ unset($ptype_obj);
2597
+ } else {
2598
+ $reqpage = get_page_by_path($q['pagename']);
2599
+ }
2600
+ if ( !empty($reqpage) )
2601
+ $reqpage = $reqpage->ID;
2602
+ else
2603
+ $reqpage = 0;
2604
+ }
2605
+
2606
+ $page_for_posts = get_option('page_for_posts');
2607
+ if ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) {
2608
+ $q['pagename'] = sanitize_title_for_query( wp_basename( $q['pagename'] ) );
2609
+ $q['name'] = $q['pagename'];
2610
+ $where .= " AND ($wpdb->posts.ID = '$reqpage')";
2611
+ $reqpage_obj = get_post( $reqpage );
2612
+ if ( is_object($reqpage_obj) && 'attachment' == $reqpage_obj->post_type ) {
2613
+ $this->is_attachment = true;
2614
+ $post_type = $q['post_type'] = 'attachment';
2615
+ $this->is_page = true;
2616
+ $q['attachment_id'] = $reqpage;
2617
+ }
2618
+ }
2619
+ } elseif ( '' != $q['attachment'] ) {
2620
+ $q['attachment'] = sanitize_title_for_query( wp_basename( $q['attachment'] ) );
2621
+ $q['name'] = $q['attachment'];
2622
+ $where .= " AND $wpdb->posts.post_name = '" . $q['attachment'] . "'";
2623
+ }
2624
+
2625
+
2626
+ if ( intval($q['comments_popup']) )
2627
+ $q['p'] = absint($q['comments_popup']);
2628
+
2629
+ // If an attachment is requested by number, let it supersede any post number.
2630
+ if ( $q['attachment_id'] )
2631
+ $q['p'] = absint($q['attachment_id']);
2632
+
2633
+ // If a post number is specified, load that post
2634
+ if ( $q['p'] ) {
2635
+ $where .= " AND {$wpdb->posts}.ID = " . $q['p'];
2636
+ } elseif ( $q['post__in'] ) {
2637
+ $post__in = implode(',', array_map( 'absint', $q['post__in'] ));
2638
+ $where .= " AND {$wpdb->posts}.ID IN ($post__in)";
2639
+ } elseif ( $q['post__not_in'] ) {
2640
+ $post__not_in = implode(',', array_map( 'absint', $q['post__not_in'] ));
2641
+ $where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)";
2642
+ }
2643
+
2644
+ if ( is_numeric( $q['post_parent'] ) ) {
2645
+ $where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] );
2646
+ } elseif ( $q['post_parent__in'] ) {
2647
+ $post_parent__in = implode( ',', array_map( 'absint', $q['post_parent__in'] ) );
2648
+ $where .= " AND {$wpdb->posts}.post_parent IN ($post_parent__in)";
2649
+ } elseif ( $q['post_parent__not_in'] ) {
2650
+ $post_parent__not_in = implode( ',', array_map( 'absint', $q['post_parent__not_in'] ) );
2651
+ $where .= " AND {$wpdb->posts}.post_parent NOT IN ($post_parent__not_in)";
2652
+ }
2653
+
2654
+ if ( $q['page_id'] ) {
2655
+ if ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) {
2656
+ $q['p'] = $q['page_id'];
2657
+ $where = " AND {$wpdb->posts}.ID = " . $q['page_id'];
2658
+ }
2659
+ }
2660
+
2661
+ // If a search pattern is specified, load the posts that match.
2662
+ if ( ! empty( $q['s'] ) ) {
2663
+ $search = $this->parse_search( $q );
2664
+ }
2665
+
2666
+ /**
2667
+ * Filter the search SQL that is used in the WHERE clause of WP_Query.
2668
+ *
2669
+ * @since 3.0.0
2670
+ *
2671
+ * @param string $search Search SQL for WHERE clause.
2672
+ * @param WP_Query $this The current WP_Query object.
2673
+ */
2674
+ $search = apply_filters_ref_array( 'posts_search', array( $search, &$this ) );
2675
+
2676
+ // Taxonomies
2677
+ if ( !$this->is_singular ) {
2678
+ $this->parse_tax_query( $q );
2679
+
2680
+ $clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );
2681
+
2682
+ $join .= $clauses['join'];
2683
+ $where .= $clauses['where'];
2684
+ }
2685
+
2686
+ if ( $this->is_tax ) {
2687
+ if ( empty($post_type) ) {
2688
+ // Do a fully inclusive search for currently registered post types of queried taxonomies
2689
+ $post_type = array();
2690
+ $taxonomies = wp_list_pluck( $this->tax_query->queries, 'taxonomy' );
2691
+ foreach ( get_post_types( array( 'exclude_from_search' => false ) ) as $pt ) {
2692
+ $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies( $pt );
2693
+ if ( array_intersect( $taxonomies, $object_taxonomies ) )
2694
+ $post_type[] = $pt;
2695
+ }
2696
+ if ( ! $post_type )
2697
+ $post_type = 'any';
2698
+ elseif ( count( $post_type ) == 1 )
2699
+ $post_type = $post_type[0];
2700
+
2701
+ $post_status_join = true;
2702
+ } elseif ( in_array('attachment', (array) $post_type) ) {
2703
+ $post_status_join = true;
2704
+ }
2705
+ }
2706
+
2707
+ // Back-compat
2708
+ if ( !empty($this->tax_query->queries) ) {
2709
+ $tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' );
2710
+ if ( !empty( $tax_query_in_and ) ) {
2711
+ if ( !isset( $q['taxonomy'] ) ) {
2712
+ foreach ( $tax_query_in_and as $a_tax_query ) {
2713
+ if ( !in_array( $a_tax_query['taxonomy'], array( 'category', 'post_tag' ) ) ) {
2714
+ $q['taxonomy'] = $a_tax_query['taxonomy'];
2715
+ if ( 'slug' == $a_tax_query['field'] )
2716
+ $q['term'] = $a_tax_query['terms'][0];
2717
+ else
2718
+ $q['term_id'] = $a_tax_query['terms'][0];
2719
+
2720
+ break;
2721
+ }
2722
+ }
2723
+ }
2724
+
2725
+ $cat_query = wp_list_filter( $tax_query_in_and, array( 'taxonomy' => 'category' ) );
2726
+ if ( ! empty( $cat_query ) ) {
2727
+ $cat_query = reset( $cat_query );
2728
+
2729
+ if ( ! empty( $cat_query['terms'][0] ) ) {
2730
+ $the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
2731
+ if ( $the_cat ) {
2732
+ $this->set( 'cat', $the_cat->term_id );
2733
+ $this->set( 'category_name', $the_cat->slug );
2734
+ }
2735
+ unset( $the_cat );
2736
+ }
2737
+ }
2738
+ unset( $cat_query );
2739
+
2740
+ $tag_query = wp_list_filter( $tax_query_in_and, array( 'taxonomy' => 'post_tag' ) );
2741
+ if ( ! empty( $tag_query ) ) {
2742
+ $tag_query = reset( $tag_query );
2743
+
2744
+ if ( ! empty( $tag_query['terms'][0] ) ) {
2745
+ $the_tag = get_term_by( $tag_query['field'], $tag_query['terms'][0], 'post_tag' );
2746
+ if ( $the_tag )
2747
+ $this->set( 'tag_id', $the_tag->term_id );
2748
+ unset( $the_tag );
2749
+ }
2750
+ }
2751
+ unset( $tag_query );
2752
+ }
2753
+ }
2754
+
2755
+ if ( !empty( $this->tax_query->queries ) || !empty( $this->meta_query->queries ) ) {
2756
+ $groupby = "{$wpdb->posts}.ID";
2757
+ }
2758
+
2759
+ // Author/user stuff
2760
+
2761
+ if ( ! empty( $q['author'] ) && $q['author'] != '0' ) {
2762
+ $q['author'] = addslashes_gpc( '' . urldecode( $q['author'] ) );
2763
+ $authors = array_unique( array_map( 'intval', preg_split( '/[,\s]+/', $q['author'] ) ) );
2764
+ foreach ( $authors as $author ) {
2765
+ $key = $author > 0 ? 'author__in' : 'author__not_in';
2766
+ $q[$key][] = abs( $author );
2767
+ }
2768
+ $q['author'] = implode( ',', $authors );
2769
+ }
2770
+
2771
+ if ( ! empty( $q['author__not_in'] ) ) {
2772
+ $author__not_in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__not_in'] ) ) );
2773
+ $where .= " AND {$wpdb->posts}.post_author NOT IN ($author__not_in) ";
2774
+ } elseif ( ! empty( $q['author__in'] ) ) {
2775
+ $author__in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__in'] ) ) );
2776
+ $where .= " AND {$wpdb->posts}.post_author IN ($author__in) ";
2777
+ }
2778
+
2779
+ // Author stuff for nice URLs
2780
+
2781
+ if ( '' != $q['author_name'] ) {
2782
+ if ( strpos($q['author_name'], '/') !== false ) {
2783
+ $q['author_name'] = explode('/', $q['author_name']);
2784
+ if ( $q['author_name'][ count($q['author_name'])-1 ] ) {
2785
+ $q['author_name'] = $q['author_name'][count($q['author_name'])-1]; // no trailing slash
2786
+ } else {
2787
+ $q['author_name'] = $q['author_name'][count($q['author_name'])-2]; // there was a trailing slash
2788
+ }
2789
+ }
2790
+ $q['author_name'] = sanitize_title_for_query( $q['author_name'] );
2791
+ $q['author'] = get_user_by('slug', $q['author_name']);
2792
+ if ( $q['author'] )
2793
+ $q['author'] = $q['author']->ID;
2794
+ $whichauthor .= " AND ($wpdb->posts.post_author = " . absint($q['author']) . ')';
2795
+ }
2796
+
2797
+ // MIME-Type stuff for attachment browsing
2798
+
2799
+ if ( isset( $q['post_mime_type'] ) && '' != $q['post_mime_type'] )
2800
+ $whichmimetype = wp_post_mime_type_where( $q['post_mime_type'], $wpdb->posts );
2801
+
2802
+ $where .= $search . $whichauthor . $whichmimetype;
2803
+
2804
+ $rand = ( isset( $q['orderby'] ) && 'rand' === $q['orderby'] );
2805
+ if ( ! isset( $q['order'] ) ) {
2806
+ $q['order'] = $rand ? '' : 'DESC';
2807
+ } else {
2808
+ $q['order'] = $rand ? '' : $this->parse_order( $q['order'] );
2809
+ }
2810
+
2811
+ // Order by.
2812
+ if ( empty( $q['orderby'] ) ) {
2813
+ /*
2814
+ * Boolean false or empty array blanks out ORDER BY,
2815
+ * while leaving the value unset or otherwise empty sets the default.
2816
+ */
2817
+ if ( isset( $q['orderby'] ) && ( is_array( $q['orderby'] ) || false === $q['orderby'] ) ) {
2818
+ $orderby = '';
2819
+ } else {
2820
+ $orderby = "$wpdb->posts.post_date " . $q['order'];
2821
+ }
2822
+ } elseif ( 'none' == $q['orderby'] ) {
2823
+ $orderby = '';
2824
+ } elseif ( $q['orderby'] == 'post__in' && ! empty( $post__in ) ) {
2825
+ $orderby = "FIELD( {$wpdb->posts}.ID, $post__in )";
2826
+ } elseif ( $q['orderby'] == 'post_parent__in' && ! empty( $post_parent__in ) ) {
2827
+ $orderby = "FIELD( {$wpdb->posts}.post_parent, $post_parent__in )";
2828
+ } else {
2829
+ $orderby_array = array();
2830
+ if ( is_array( $q['orderby'] ) ) {
2831
+ foreach ( $q['orderby'] as $_orderby => $order ) {
2832
+ $orderby = addslashes_gpc( urldecode( $_orderby ) );
2833
+ $parsed = $this->parse_orderby( $orderby );
2834
+
2835
+ if ( ! $parsed ) {
2836
+ continue;
2837
+ }
2838
+
2839
+ $orderby_array[] = $parsed . ' ' . $this->parse_order( $order );
2840
+ }
2841
+ $orderby = implode( ', ', $orderby_array );
2842
+
2843
+ } else {
2844
+ $q['orderby'] = urldecode( $q['orderby'] );
2845
+ $q['orderby'] = addslashes_gpc( $q['orderby'] );
2846
+
2847
+ foreach ( explode( ' ', $q['orderby'] ) as $i => $orderby ) {
2848
+ $parsed = $this->parse_orderby( $orderby );
2849
+ // Only allow certain values for safety.
2850
+ if ( ! $parsed ) {
2851
+ continue;
2852
+ }
2853
+
2854
+ $orderby_array[] = $parsed;
2855
+ }
2856
+ $orderby = implode( ' ' . $q['order'] . ', ', $orderby_array );
2857
+
2858
+ if ( empty( $orderby ) ) {
2859
+ $orderby = "$wpdb->posts.post_date " . $q['order'];
2860
+ } elseif ( ! empty( $q['order'] ) ) {
2861
+ $orderby .= " {$q['order']}";
2862
+ }
2863
+ }
2864
+ }
2865
+
2866
+ // Order search results by relevance only when another "orderby" is not specified in the query.
2867
+ if ( ! empty( $q['s'] ) ) {
2868
+ $search_orderby = '';
2869
+ if ( ! empty( $q['search_orderby_title'] ) && ( empty( $q['orderby'] ) && ! $this->is_feed ) || ( isset( $q['orderby'] ) && 'relevance' === $q['orderby'] ) )
2870
+ $search_orderby = $this->parse_search_order( $q );
2871
+
2872
+ /**
2873
+ * Filter the ORDER BY used when ordering search results.
2874
+ *
2875
+ * @since 3.7.0
2876
+ *
2877
+ * @param string $search_orderby The ORDER BY clause.
2878
+ * @param WP_Query $this The current WP_Query instance.
2879
+ */
2880
+ $search_orderby = apply_filters( 'posts_search_orderby', $search_orderby, $this );
2881
+ if ( $search_orderby )
2882
+ $orderby = $orderby ? $search_orderby . ', ' . $orderby : $search_orderby;
2883
+ }
2884
+
2885
+ if ( is_array( $post_type ) && count( $post_type ) > 1 ) {
2886
+ $post_type_cap = 'multiple_post_type';
2887
+ } else {
2888
+ if ( is_array( $post_type ) )
2889
+ $post_type = reset( $post_type );
2890
+ $post_type_object = get_post_type_object( $post_type );
2891
+ if ( empty( $post_type_object ) )
2892
+ $post_type_cap = $post_type;
2893
+ }
2894
+
2895
+ if ( isset( $q['post_password'] ) ) {
2896
+ $where .= $wpdb->prepare( " AND $wpdb->posts.post_password = %s", $q['post_password'] );
2897
+ if ( empty( $q['perm'] ) ) {
2898
+ $q['perm'] = 'readable';
2899
+ }
2900
+ } elseif ( isset( $q['has_password'] ) ) {
2901
+ $where .= sprintf( " AND $wpdb->posts.post_password %s ''", $q['has_password'] ? '!=' : '=' );
2902
+ }
2903
+
2904
+ if ( 'any' == $post_type ) {
2905
+ $in_search_post_types = get_post_types( array('exclude_from_search' => false) );
2906
+ if ( empty( $in_search_post_types ) )
2907
+ $where .= ' AND 1=0 ';
2908
+ else
2909
+ $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')";
2910
+ } elseif ( !empty( $post_type ) && is_array( $post_type ) ) {
2911
+ $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";
2912
+ } elseif ( ! empty( $post_type ) ) {
2913
+ $where .= " AND $wpdb->posts.post_type = '$post_type'";
2914
+ $post_type_object = get_post_type_object ( $post_type );
2915
+ } elseif ( $this->is_attachment ) {
2916
+ $where .= " AND $wpdb->posts.post_type = 'attachment'";
2917
+ $post_type_object = get_post_type_object ( 'attachment' );
2918
+ } elseif ( $this->is_page ) {
2919
+ $where .= " AND $wpdb->posts.post_type = 'page'";
2920
+ $post_type_object = get_post_type_object ( 'page' );
2921
+ } else {
2922
+ $where .= " AND $wpdb->posts.post_type = 'post'";
2923
+ $post_type_object = get_post_type_object ( 'post' );
2924
+ }
2925
+
2926
+ $edit_cap = 'edit_post';
2927
+ $read_cap = 'read_post';
2928
+
2929
+ if ( ! empty( $post_type_object ) ) {
2930
+ $edit_others_cap = $post_type_object->cap->edit_others_posts;
2931
+ $read_private_cap = $post_type_object->cap->read_private_posts;
2932
+ } else {
2933
+ $edit_others_cap = 'edit_others_' . $post_type_cap . 's';
2934
+ $read_private_cap = 'read_private_' . $post_type_cap . 's';
2935
+ }
2936
+
2937
+ $user_id = get_current_user_id();
2938
+
2939
+ if ( ! empty( $q['post_status'] ) ) {
2940
+ $statuswheres = array();
2941
+ $q_status = $q['post_status'];
2942
+ if ( ! is_array( $q_status ) )
2943
+ $q_status = explode(',', $q_status);
2944
+ $r_status = array();
2945
+ $p_status = array();
2946
+ $e_status = array();
2947
+ if ( in_array( 'any', $q_status ) ) {
2948
+ foreach ( get_post_stati( array( 'exclude_from_search' => true ) ) as $status ) {
2949
+ if ( ! in_array( $status, $q_status ) ) {
2950
+ $e_status[] = "$wpdb->posts.post_status <> '$status'";
2951
+ }
2952
+ }
2953
+ } else {
2954
+ foreach ( get_post_stati() as $status ) {
2955
+ if ( in_array( $status, $q_status ) ) {
2956
+ if ( 'private' == $status )
2957
+ $p_status[] = "$wpdb->posts.post_status = '$status'";
2958
+ else
2959
+ $r_status[] = "$wpdb->posts.post_status = '$status'";
2960
+ }
2961
+ }
2962
+ }
2963
+
2964
+ if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) {
2965
+ $r_status = array_merge($r_status, $p_status);
2966
+ unset($p_status);
2967
+ }
2968
+
2969
+ if ( !empty($e_status) ) {
2970
+ $statuswheres[] = "(" . join( ' AND ', $e_status ) . ")";
2971
+ }
2972
+ if ( !empty($r_status) ) {
2973
+ if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can($edit_others_cap) )
2974
+ $statuswheres[] = "($wpdb->posts.post_author = $user_id " . "AND (" . join( ' OR ', $r_status ) . "))";
2975
+ else
2976
+ $statuswheres[] = "(" . join( ' OR ', $r_status ) . ")";
2977
+ }
2978
+ if ( !empty($p_status) ) {
2979
+ if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can($read_private_cap) )
2980
+ $statuswheres[] = "($wpdb->posts.post_author = $user_id " . "AND (" . join( ' OR ', $p_status ) . "))";
2981
+ else
2982
+ $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")";
2983
+ }
2984
+ if ( $post_status_join ) {
2985
+ $join .= " LEFT JOIN $wpdb->posts AS p2 ON ($wpdb->posts.post_parent = p2.ID) ";
2986
+ foreach ( $statuswheres as $index => $statuswhere )
2987
+ $statuswheres[$index] = "($statuswhere OR ($wpdb->posts.post_status = 'inherit' AND " . str_replace($wpdb->posts, 'p2', $statuswhere) . "))";
2988
+ }
2989
+ $where_status = implode( ' OR ', $statuswheres );
2990
+ if ( ! empty( $where_status ) ) {
2991
+ $where .= " AND ($where_status)";
2992
+ }
2993
+ } elseif ( !$this->is_singular ) {
2994
+ $where .= " AND ($wpdb->posts.post_status = 'publish'";
2995
+
2996
+ // Add public states.
2997
+ $public_states = get_post_stati( array('public' => true) );
2998
+ foreach ( (array) $public_states as $state ) {
2999
+ if ( 'publish' == $state ) // Publish is hard-coded above.
3000
+ continue;
3001
+ $where .= " OR $wpdb->posts.post_status = '$state'";
3002
+ }
3003
+
3004
+ if ( $this->is_admin ) {
3005
+ // Add protected states that should show in the admin all list.
3006
+ $admin_all_states = get_post_stati( array('protected' => true, 'show_in_admin_all_list' => true) );
3007
+ foreach ( (array) $admin_all_states as $state )
3008
+ $where .= " OR $wpdb->posts.post_status = '$state'";
3009
+ }
3010
+
3011
+ if ( is_user_logged_in() ) {
3012
+ // Add private states that are limited to viewing by the author of a post or someone who has caps to read private states.
3013
+ $private_states = get_post_stati( array('private' => true) );
3014
+ foreach ( (array) $private_states as $state )
3015
+ $where .= current_user_can( $read_private_cap ) ? " OR $wpdb->posts.post_status = '$state'" : " OR $wpdb->posts.post_author = $user_id AND $wpdb->posts.post_status = '$state'";
3016
+ }
3017
+
3018
+ $where .= ')';
3019
+ }
3020
+
3021
+ if ( !empty( $this->meta_query->queries ) ) {
3022
+ $clauses = $this->meta_query->get_sql( 'post', $wpdb->posts, 'ID', $this );
3023
+ $join .= $clauses['join'];
3024
+ $where .= $clauses['where'];
3025
+ }
3026
+
3027
+ /*
3028
+ * Apply filters on where and join prior to paging so that any
3029
+ * manipulations to them are reflected in the paging by day queries.
3030
+ */
3031
+ if ( !$q['suppress_filters'] ) {
3032
+ /**
3033
+ * Filter the WHERE clause of the query.
3034
+ *
3035
+ * @since 1.5.0
3036
+ *
3037
+ * @param string $where The WHERE clause of the query.
3038
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3039
+ */
3040
+ $where = apply_filters_ref_array( 'posts_where', array( $where, &$this ) );
3041
+
3042
+ /**
3043
+ * Filter the JOIN clause of the query.
3044
+ *
3045
+ * @since 1.5.0
3046
+ *
3047
+ * @param string $where The JOIN clause of the query.
3048
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3049
+ */
3050
+ $join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) );
3051
+ }
3052
+
3053
+ // Paging
3054
+ if ( empty($q['nopaging']) && !$this->is_singular ) {
3055
+ $page = absint($q['paged']);
3056
+ if ( !$page )
3057
+ $page = 1;
3058
+
3059
+ if ( empty($q['offset']) ) {
3060
+ $pgstrt = absint( ( $page - 1 ) * $q['posts_per_page'] ) . ', ';
3061
+ } else { // we're ignoring $page and using 'offset'
3062
+ $q['offset'] = absint($q['offset']);
3063
+ $pgstrt = $q['offset'] . ', ';
3064
+ }
3065
+ $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
3066
+ }
3067
+
3068
+ // Comments feeds
3069
+ if ( $this->is_comment_feed && ! $this->is_singular ) {
3070
+ if ( $this->is_archive || $this->is_search ) {
3071
+ $cjoin = "JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) $join ";
3072
+ $cwhere = "WHERE comment_approved = '1' $where";
3073
+ $cgroupby = "$wpdb->comments.comment_id";
3074
+ } else { // Other non singular e.g. front
3075
+ $cjoin = "JOIN $wpdb->posts ON ( $wpdb->comments.comment_post_ID = $wpdb->posts.ID )";
3076
+ $cwhere = "WHERE post_status = 'publish' AND comment_approved = '1'";
3077
+ $cgroupby = '';
3078
+ }
3079
+
3080
+ if ( !$q['suppress_filters'] ) {
3081
+ /**
3082
+ * Filter the JOIN clause of the comments feed query before sending.
3083
+ *
3084
+ * @since 2.2.0
3085
+ *
3086
+ * @param string $cjoin The JOIN clause of the query.
3087
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3088
+ */
3089
+ $cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$this ) );
3090
+
3091
+ /**
3092
+ * Filter the WHERE clause of the comments feed query before sending.
3093
+ *
3094
+ * @since 2.2.0
3095
+ *
3096
+ * @param string $cwhere The WHERE clause of the query.
3097
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3098
+ */
3099
+ $cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) );
3100
+
3101
+ /**
3102
+ * Filter the GROUP BY clause of the comments feed query before sending.
3103
+ *
3104
+ * @since 2.2.0
3105
+ *
3106
+ * @param string $cgroupby The GROUP BY clause of the query.
3107
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3108
+ */
3109
+ $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$this ) );
3110
+
3111
+ /**
3112
+ * Filter the ORDER BY clause of the comments feed query before sending.
3113
+ *
3114
+ * @since 2.8.0
3115
+ *
3116
+ * @param string $corderby The ORDER BY clause of the query.
3117
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3118
+ */
3119
+ $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
3120
+
3121
+ /**
3122
+ * Filter the LIMIT clause of the comments feed query before sending.
3123
+ *
3124
+ * @since 2.8.0
3125
+ *
3126
+ * @param string $climits The JOIN clause of the query.
3127
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3128
+ */
3129
+ $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
3130
+ }
3131
+ $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
3132
+ $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
3133
+
3134
+ $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits");
3135
+ $this->comment_count = count($this->comments);
3136
+
3137
+ $post_ids = array();
3138
+
3139
+ foreach ( $this->comments as $comment )
3140
+ $post_ids[] = (int) $comment->comment_post_ID;
3141
+
3142
+ $post_ids = join(',', $post_ids);
3143
+ $join = '';
3144
+ if ( $post_ids )
3145
+ $where = "AND $wpdb->posts.ID IN ($post_ids) ";
3146
+ else
3147
+ $where = "AND 0";
3148
+ }
3149
+
3150
+ $pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
3151
+
3152
+ /*
3153
+ * Apply post-paging filters on where and join. Only plugins that
3154
+ * manipulate paging queries should use these hooks.
3155
+ */
3156
+ if ( !$q['suppress_filters'] ) {
3157
+ /**
3158
+ * Filter the WHERE clause of the query.
3159
+ *
3160
+ * Specifically for manipulating paging queries.
3161
+ *
3162
+ * @since 1.5.0
3163
+ *
3164
+ * @param string $where The WHERE clause of the query.
3165
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3166
+ */
3167
+ $where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) );
3168
+
3169
+ /**
3170
+ * Filter the GROUP BY clause of the query.
3171
+ *
3172
+ * @since 2.0.0
3173
+ *
3174
+ * @param string $groupby The GROUP BY clause of the query.
3175
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3176
+ */
3177
+ $groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) );
3178
+
3179
+ /**
3180
+ * Filter the JOIN clause of the query.
3181
+ *
3182
+ * Specifically for manipulating paging queries.
3183
+ *
3184
+ * @since 1.5.0
3185
+ *
3186
+ * @param string $join The JOIN clause of the query.
3187
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3188
+ */
3189
+ $join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) );
3190
+
3191
+ /**
3192
+ * Filter the ORDER BY clause of the query.
3193
+ *
3194
+ * @since 1.5.1
3195
+ *
3196
+ * @param string $orderby The ORDER BY clause of the query.
3197
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3198
+ */
3199
+ $orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) );
3200
+
3201
+ /**
3202
+ * Filter the DISTINCT clause of the query.
3203
+ *
3204
+ * @since 2.1.0
3205
+ *
3206
+ * @param string $distinct The DISTINCT clause of the query.
3207
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3208
+ */
3209
+ $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) );
3210
+
3211
+ /**
3212
+ * Filter the LIMIT clause of the query.
3213
+ *
3214
+ * @since 2.1.0
3215
+ *
3216
+ * @param string $limits The LIMIT clause of the query.
3217
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3218
+ */
3219
+ $limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) );
3220
+
3221
+ /**
3222
+ * Filter the SELECT clause of the query.
3223
+ *
3224
+ * @since 2.1.0
3225
+ *
3226
+ * @param string $fields The SELECT clause of the query.
3227
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3228
+ */
3229
+ $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );
3230
+
3231
+ /**
3232
+ * Filter all query clauses at once, for convenience.
3233
+ *
3234
+ * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,
3235
+ * fields (SELECT), and LIMITS clauses.
3236
+ *
3237
+ * @since 3.1.0
3238
+ *
3239
+ * @param array $clauses The list of clauses for the query.
3240
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3241
+ */
3242
+ $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
3243
+
3244
+ $where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
3245
+ $groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
3246
+ $join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
3247
+ $orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
3248
+ $distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
3249
+ $fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
3250
+ $limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
3251
+ }
3252
+
3253
+ /**
3254
+ * Fires to announce the query's current selection parameters.
3255
+ *
3256
+ * For use by caching plugins.
3257
+ *
3258
+ * @since 2.3.0
3259
+ *
3260
+ * @param string $selection The assembled selection query.
3261
+ */
3262
+ do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );
3263
+
3264
+ /*
3265
+ * Filter again for the benefit of caching plugins.
3266
+ * Regular plugins should use the hooks above.
3267
+ */
3268
+ if ( !$q['suppress_filters'] ) {
3269
+ /**
3270
+ * Filter the WHERE clause of the query.
3271
+ *
3272
+ * For use by caching plugins.
3273
+ *
3274
+ * @since 2.5.0
3275
+ *
3276
+ * @param string $where The WHERE clause of the query.
3277
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3278
+ */
3279
+ $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) );
3280
+
3281
+ /**
3282
+ * Filter the GROUP BY clause of the query.
3283
+ *
3284
+ * For use by caching plugins.
3285
+ *
3286
+ * @since 2.5.0
3287
+ *
3288
+ * @param string $groupby The GROUP BY clause of the query.
3289
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3290
+ */
3291
+ $groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) );
3292
+
3293
+ /**
3294
+ * Filter the JOIN clause of the query.
3295
+ *
3296
+ * For use by caching plugins.
3297
+ *
3298
+ * @since 2.5.0
3299
+ *
3300
+ * @param string $join The JOIN clause of the query.
3301
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3302
+ */
3303
+ $join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) );
3304
+
3305
+ /**
3306
+ * Filter the ORDER BY clause of the query.
3307
+ *
3308
+ * For use by caching plugins.
3309
+ *
3310
+ * @since 2.5.0
3311
+ *
3312
+ * @param string $orderby The ORDER BY clause of the query.
3313
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3314
+ */
3315
+ $orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) );
3316
+
3317
+ /**
3318
+ * Filter the DISTINCT clause of the query.
3319
+ *
3320
+ * For use by caching plugins.
3321
+ *
3322
+ * @since 2.5.0
3323
+ *
3324
+ * @param string $distinct The DISTINCT clause of the query.
3325
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3326
+ */
3327
+ $distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) );
3328
+
3329
+ /**
3330
+ * Filter the SELECT clause of the query.
3331
+ *
3332
+ * For use by caching plugins.
3333
+ *
3334
+ * @since 2.5.0
3335
+ *
3336
+ * @param string $fields The SELECT clause of the query.
3337
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3338
+ */
3339
+ $fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) );
3340
+
3341
+ /**
3342
+ * Filter the LIMIT clause of the query.
3343
+ *
3344
+ * For use by caching plugins.
3345
+ *
3346
+ * @since 2.5.0
3347
+ *
3348
+ * @param string $limits The LIMIT clause of the query.
3349
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3350
+ */
3351
+ $limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) );
3352
+
3353
+ /**
3354
+ * Filter all query clauses at once, for convenience.
3355
+ *
3356
+ * For use by caching plugins.
3357
+ *
3358
+ * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,
3359
+ * fields (SELECT), and LIMITS clauses.
3360
+ *
3361
+ * @since 3.1.0
3362
+ *
3363
+ * @param array $pieces The pieces of the query.
3364
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3365
+ */
3366
+ $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
3367
+
3368
+ $where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
3369
+ $groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
3370
+ $join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
3371
+ $orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
3372
+ $distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
3373
+ $fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
3374
+ $limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
3375
+ }
3376
+
3377
+ if ( ! empty($groupby) )
3378
+ $groupby = 'GROUP BY ' . $groupby;
3379
+ if ( !empty( $orderby ) )
3380
+ $orderby = 'ORDER BY ' . $orderby;
3381
+
3382
+ $found_rows = '';
3383
+ if ( !$q['no_found_rows'] && !empty($limits) )
3384
+ $found_rows = 'SQL_CALC_FOUND_ROWS';
3385
+
3386
+ $this->request = $old_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
3387
+
3388
+ if ( !$q['suppress_filters'] ) {
3389
+ /**
3390
+ * Filter the completed SQL query before sending.
3391
+ *
3392
+ * @since 2.0.0
3393
+ *
3394
+ * @param array $request The complete SQL query.
3395
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3396
+ */
3397
+ $this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) );
3398
+ }
3399
+
3400
+ if ( 'ids' == $q['fields'] ) {
3401
+ $this->posts = $wpdb->get_col( $this->request );
3402
+ $this->post_count = count( $this->posts );
3403
+ $this->set_found_posts( $q, $limits );
3404
+
3405
+ return array_map( 'intval', $this->posts );
3406
+ }
3407
+
3408
+ if ( 'id=>parent' == $q['fields'] ) {
3409
+ $this->posts = $wpdb->get_results( $this->request );
3410
+ $this->post_count = count( $this->posts );
3411
+ $this->set_found_posts( $q, $limits );
3412
+
3413
+ $r = array();
3414
+ foreach ( $this->posts as $post ) {
3415
+ $r[ (int) $post->ID ] = (int) $post->post_parent;
3416
+ }
3417
+ return $r;
3418
+ }
3419
+
3420
+ $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 );
3421
+
3422
+ /**
3423
+ * Filter whether to split the query.
3424
+ *
3425
+ * Splitting the query will cause it to fetch just the IDs of the found posts
3426
+ * (and then individually fetch each post by ID), rather than fetching every
3427
+ * complete row at once. One massive result vs. many small results.
3428
+ *
3429
+ * @since 3.4.0
3430
+ *
3431
+ * @param bool $split_the_query Whether or not to split the query.
3432
+ * @param WP_Query $this The WP_Query instance.
3433
+ */
3434
+ $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this );
3435
+
3436
+ if ( $split_the_query ) {
3437
+ // First get the IDs and then fill in the objects
3438
+
3439
+ $this->request = "SELECT $found_rows $distinct $wpdb->posts.ID FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
3440
+
3441
+ /**
3442
+ * Filter the Post IDs SQL request before sending.
3443
+ *
3444
+ * @since 3.4.0
3445
+ *
3446
+ * @param string $request The post ID request.
3447
+ * @param WP_Query $this The WP_Query instance.
3448
+ */
3449
+ $this->request = apply_filters( 'posts_request_ids', $this->request, $this );
3450
+
3451
+ $ids = $wpdb->get_col( $this->request );
3452
+
3453
+ if ( $ids ) {
3454
+ $this->posts = $ids;
3455
+ $this->set_found_posts( $q, $limits );
3456
+ _prime_post_caches( $ids, $q['update_post_term_cache'], $q['update_post_meta_cache'] );
3457
+ } else {
3458
+ $this->posts = array();
3459
+ }
3460
+ } else {
3461
+ $this->posts = $wpdb->get_results( $this->request );
3462
+ $this->set_found_posts( $q, $limits );
3463
+ }
3464
+
3465
+ // Convert to WP_Post objects
3466
+ if ( $this->posts )
3467
+ $this->posts = array_map( 'get_post', $this->posts );
3468
+
3469
+ if ( ! $q['suppress_filters'] ) {
3470
+ /**
3471
+ * Filter the raw post results array, prior to status checks.
3472
+ *
3473
+ * @since 2.3.0
3474
+ *
3475
+ * @param array $posts The post results array.
3476
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3477
+ */
3478
+ $this->posts = apply_filters_ref_array( 'posts_results', array( $this->posts, &$this ) );
3479
+ }
3480
+
3481
+ if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
3482
+ /** This filter is documented in wp-includes/query.php */
3483
+ $cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) );
3484
+
3485
+ /** This filter is documented in wp-includes/query.php */
3486
+ $cwhere = apply_filters_ref_array( 'comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );
3487
+
3488
+ /** This filter is documented in wp-includes/query.php */
3489
+ $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) );
3490
+ $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
3491
+
3492
+ /** This filter is documented in wp-includes/query.php */
3493
+ $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
3494
+ $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
3495
+
3496
+ /** This filter is documented in wp-includes/query.php */
3497
+ $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
3498
+
3499
+ $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
3500
+ $this->comments = $wpdb->get_results($comments_request);
3501
+ $this->comment_count = count($this->comments);
3502
+ }
3503
+
3504
+ // Check post status to determine if post should be displayed.
3505
+ if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) {
3506
+ $status = get_post_status($this->posts[0]);
3507
+ $post_status_obj = get_post_status_object($status);
3508
+ //$type = get_post_type($this->posts[0]);
3509
+ if ( !$post_status_obj->public ) {
3510
+ if ( ! is_user_logged_in() ) {
3511
+ // User must be logged in to view unpublished posts.
3512
+ $this->posts = array();
3513
+ } else {
3514
+ if ( $post_status_obj->protected ) {
3515
+ // User must have edit permissions on the draft to preview.
3516
+ if ( ! current_user_can($edit_cap, $this->posts[0]->ID) ) {
3517
+ $this->posts = array();
3518
+ } else {
3519
+ $this->is_preview = true;
3520
+ if ( 'future' != $status )
3521
+ $this->posts[0]->post_date = current_time('mysql');
3522
+ }
3523
+ } elseif ( $post_status_obj->private ) {
3524
+ if ( ! current_user_can($read_cap, $this->posts[0]->ID) )
3525
+ $this->posts = array();
3526
+ } else {
3527
+ $this->posts = array();
3528
+ }
3529
+ }
3530
+ }
3531
+
3532
+ if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) {
3533
+ /**
3534
+ * Filter the single post for preview mode.
3535
+ *
3536
+ * @since 2.7.0
3537
+ *
3538
+ * @param WP_Post $post_preview The Post object.
3539
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3540
+ */
3541
+ $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );
3542
+ }
3543
+ }
3544
+
3545
+ // Put sticky posts at the top of the posts array
3546
+ $sticky_posts = get_option('sticky_posts');
3547
+ if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['ignore_sticky_posts'] ) {
3548
+ $num_posts = count($this->posts);
3549
+ $sticky_offset = 0;
3550
+ // Loop over posts and relocate stickies to the front.
3551
+ for ( $i = 0; $i < $num_posts; $i++ ) {
3552
+ if ( in_array($this->posts[$i]->ID, $sticky_posts) ) {
3553
+ $sticky_post = $this->posts[$i];
3554
+ // Remove sticky from current position
3555
+ array_splice($this->posts, $i, 1);
3556
+ // Move to front, after other stickies
3557
+ array_splice($this->posts, $sticky_offset, 0, array($sticky_post));
3558
+ // Increment the sticky offset. The next sticky will be placed at this offset.
3559
+ $sticky_offset++;
3560
+ // Remove post from sticky posts array
3561
+ $offset = array_search($sticky_post->ID, $sticky_posts);
3562
+ unset( $sticky_posts[$offset] );
3563
+ }
3564
+ }
3565
+
3566
+ // If any posts have been excluded specifically, Ignore those that are sticky.
3567
+ if ( !empty($sticky_posts) && !empty($q['post__not_in']) )
3568
+ $sticky_posts = array_diff($sticky_posts, $q['post__not_in']);
3569
+
3570
+ // Fetch sticky posts that weren't in the query results
3571
+ if ( !empty($sticky_posts) ) {
3572
+ $stickies = get_posts( array(
3573
+ 'post__in' => $sticky_posts,
3574
+ 'post_type' => $post_type,
3575
+ 'post_status' => 'publish',
3576
+ 'nopaging' => true
3577
+ ) );
3578
+
3579
+ foreach ( $stickies as $sticky_post ) {
3580
+ array_splice( $this->posts, $sticky_offset, 0, array( $sticky_post ) );
3581
+ $sticky_offset++;
3582
+ }
3583
+ }
3584
+ }
3585
+
3586
+ if ( ! $q['suppress_filters'] ) {
3587
+ /**
3588
+ * Filter the array of retrieved posts after they've been fetched and
3589
+ * internally processed.
3590
+ *
3591
+ * @since 1.5.0
3592
+ *
3593
+ * @param array $posts The array of retrieved posts.
3594
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3595
+ */
3596
+ $this->posts = apply_filters_ref_array( 'the_posts', array( $this->posts, &$this ) );
3597
+ }
3598
+
3599
+ // Ensure that any posts added/modified via one of the filters above are
3600
+ // of the type WP_Post and are filtered.
3601
+ if ( $this->posts ) {
3602
+ $this->post_count = count( $this->posts );
3603
+
3604
+ $this->posts = array_map( 'get_post', $this->posts );
3605
+
3606
+ if ( $q['cache_results'] )
3607
+ update_post_caches($this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache']);
3608
+
3609
+ $this->post = reset( $this->posts );
3610
+ } else {
3611
+ $this->post_count = 0;
3612
+ $this->posts = array();
3613
+ }
3614
+
3615
+ return $this->posts;
3616
+ }
3617
+
3618
+ /**
3619
+ * Set up the amount of found posts and the number of pages (if limit clause was used)
3620
+ * for the current query.
3621
+ *
3622
+ * @since 3.5.0
3623
+ * @access private
3624
+ */
3625
+ private function set_found_posts( $q, $limits ) {
3626
+ global $wpdb;
3627
+
3628
+ // Bail if posts is an empty array. Continue if posts is an empty string,
3629
+ // null, or false to accommodate caching plugins that fill posts later.
3630
+ if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) )
3631
+ return;
3632
+
3633
+ if ( ! empty( $limits ) ) {
3634
+ /**
3635
+ * Filter the query to run for retrieving the found posts.
3636
+ *
3637
+ * @since 2.1.0
3638
+ *
3639
+ * @param string $found_posts The query to run to find the found posts.
3640
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3641
+ */
3642
+ $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
3643
+ } else {
3644
+ $this->found_posts = count( $this->posts );
3645
+ }
3646
+
3647
+ /**
3648
+ * Filter the number of found posts for the query.
3649
+ *
3650
+ * @since 2.1.0
3651
+ *
3652
+ * @param int $found_posts The number of posts found.
3653
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3654
+ */
3655
+ $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
3656
+
3657
+ if ( ! empty( $limits ) )
3658
+ $this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );
3659
+ }
3660
+
3661
+ /**
3662
+ * Set up the next post and iterate current post index.
3663
+ *
3664
+ * @since 1.5.0
3665
+ * @access public
3666
+ *
3667
+ * @return WP_Post Next post.
3668
+ */
3669
+ public function next_post() {
3670
+
3671
+ $this->current_post++;
3672
+
3673
+ $this->post = $this->posts[$this->current_post];
3674
+ return $this->post;
3675
+ }
3676
+
3677
+ /**
3678
+ * Sets up the current post.
3679
+ *
3680
+ * Retrieves the next post, sets up the post, sets the 'in the loop'
3681
+ * property to true.
3682
+ *
3683
+ * @since 1.5.0
3684
+ * @access public
3685
+ * @uses $post
3686
+ * @uses do_action_ref_array() Calls 'loop_start' if loop has just started
3687
+ */
3688
+ public function the_post() {
3689
+ global $post;
3690
+ $this->in_the_loop = true;
3691
+
3692
+ if ( $this->current_post == -1 ) // loop has just started
3693
+ /**
3694
+ * Fires once the loop is started.
3695
+ *
3696
+ * @since 2.0.0
3697
+ *
3698
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3699
+ */
3700
+ do_action_ref_array( 'loop_start', array( &$this ) );
3701
+
3702
+ $post = $this->next_post();
3703
+ setup_postdata($post);
3704
+ }
3705
+
3706
+ /**
3707
+ * Whether there are more posts available in the loop.
3708
+ *
3709
+ * Calls action 'loop_end', when the loop is complete.
3710
+ *
3711
+ * @since 1.5.0
3712
+ * @access public
3713
+ * @uses do_action_ref_array() Calls 'loop_end' if loop is ended
3714
+ *
3715
+ * @return bool True if posts are available, false if end of loop.
3716
+ */
3717
+ public function have_posts() {
3718
+ if ( $this->current_post + 1 < $this->post_count ) {
3719
+ return true;
3720
+ } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
3721
+ /**
3722
+ * Fires once the loop has ended.
3723
+ *
3724
+ * @since 2.0.0
3725
+ *
3726
+ * @param WP_Query &$this The WP_Query instance (passed by reference).
3727
+ */
3728
+ do_action_ref_array( 'loop_end', array( &$this ) );
3729
+ // Do some cleaning up after the loop
3730
+ $this->rewind_posts();
3731
+ }
3732
+
3733
+ $this->in_the_loop = false;
3734
+ return false;
3735
+ }
3736
+
3737
+ /**
3738
+ * Rewind the posts and reset post index.
3739
+ *
3740
+ * @since 1.5.0
3741
+ * @access public
3742
+ */
3743
+ public function rewind_posts() {
3744
+ $this->current_post = -1;
3745
+ if ( $this->post_count > 0 ) {
3746
+ $this->post = $this->posts[0];
3747
+ }
3748
+ }
3749
+
3750
+ /**
3751
+ * Iterate current comment index and return comment object.
3752
+ *
3753
+ * @since 2.2.0
3754
+ * @access public
3755
+ *
3756
+ * @return object Comment object.
3757
+ */
3758
+ public function next_comment() {
3759
+ $this->current_comment++;
3760
+
3761
+ $this->comment = $this->comments[$this->current_comment];
3762
+ return $this->comment;
3763
+ }
3764
+
3765
+ /**
3766
+ * Sets up the current comment.
3767
+ *
3768
+ * @since 2.2.0
3769
+ * @access public
3770
+ * @global object $comment Current comment.
3771
+ * @uses do_action() Calls 'comment_loop_start' hook when first comment is processed.
3772
+ */
3773
+ public function the_comment() {
3774
+ global $comment;
3775
+
3776
+ $comment = $this->next_comment();
3777
+
3778
+ if ( $this->current_comment == 0 ) {
3779
+ /**
3780
+ * Fires once the comment loop is started.
3781
+ *
3782
+ * @since 2.2.0
3783
+ */
3784
+ do_action( 'comment_loop_start' );
3785
+ }
3786
+ }
3787
+
3788
+ /**
3789
+ * Whether there are more comments available.
3790
+ *
3791
+ * Automatically rewinds comments when finished.
3792
+ *
3793
+ * @since 2.2.0
3794
+ * @access public
3795
+ *
3796
+ * @return bool True, if more comments. False, if no more posts.
3797
+ */
3798
+ public function have_comments() {
3799
+ if ( $this->current_comment + 1 < $this->comment_count ) {
3800
+ return true;
3801
+ } elseif ( $this->current_comment + 1 == $this->comment_count ) {
3802
+ $this->rewind_comments();
3803
+ }
3804
+
3805
+ return false;
3806
+ }
3807
+
3808
+ /**
3809
+ * Rewind the comments, resets the comment index and comment to first.
3810
+ *
3811
+ * @since 2.2.0
3812
+ * @access public
3813
+ */
3814
+ public function rewind_comments() {
3815
+ $this->current_comment = -1;
3816
+ if ( $this->comment_count > 0 ) {
3817
+ $this->comment = $this->comments[0];
3818
+ }
3819
+ }
3820
+
3821
+ /**
3822
+ * Sets up the WordPress query by parsing query string.
3823
+ *
3824
+ * @since 1.5.0
3825
+ * @access public
3826
+ *
3827
+ * @param string $query URL query string.
3828
+ * @return array List of posts.
3829
+ */
3830
+ public function query( $query ) {
3831
+ $this->init();
3832
+ $this->query = $this->query_vars = wp_parse_args( $query );
3833
+ return $this->get_posts();
3834
+ }
3835
+
3836
+ /**
3837
+ * Retrieve queried object.
3838
+ *
3839
+ * If queried object is not set, then the queried object will be set from
3840
+ * the category, tag, taxonomy, posts page, single post, page, or author
3841
+ * query variable. After it is set up, it will be returned.
3842
+ *
3843
+ * @since 1.5.0
3844
+ * @access public
3845
+ *
3846
+ * @return object
3847
+ */
3848
+ public function get_queried_object() {
3849
+ if ( isset($this->queried_object) )
3850
+ return $this->queried_object;
3851
+
3852
+ $this->queried_object = null;
3853
+ $this->queried_object_id = 0;
3854
+
3855
+ if ( $this->is_category || $this->is_tag || $this->is_tax ) {
3856
+ if ( $this->is_category ) {
3857
+ if ( $this->get( 'cat' ) ) {
3858
+ $term = get_term( $this->get( 'cat' ), 'category' );
3859
+ } elseif ( $this->get( 'category_name' ) ) {
3860
+ $term = get_term_by( 'slug', $this->get( 'category_name' ), 'category' );
3861
+ }
3862
+ } elseif ( $this->is_tag ) {
3863
+ if ( $this->get( 'tag_id' ) ) {
3864
+ $term = get_term( $this->get( 'tag_id' ), 'post_tag' );
3865
+ } elseif ( $this->get( 'tag' ) ) {
3866
+ $term = get_term_by( 'slug', $this->get( 'tag' ), 'post_tag' );
3867
+ }
3868
+ } else {
3869
+ $tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' );
3870
+ $query = reset( $tax_query_in_and );
3871
+
3872
+ if ( $query['terms'] ) {
3873
+ if ( 'term_id' == $query['field'] ) {
3874
+ $term = get_term( reset( $query['terms'] ), $query['taxonomy'] );
3875
+ } else {
3876
+ $term = get_term_by( $query['field'], reset( $query['terms'] ), $query['taxonomy'] );
3877
+ }
3878
+ }
3879
+ }
3880
+
3881
+ if ( ! empty( $term ) && ! is_wp_error( $term ) ) {
3882
+ $this->queried_object = $term;
3883
+ $this->queried_object_id = (int) $term->term_id;
3884
+
3885
+ if ( $this->is_category && 'category' === $this->queried_object->taxonomy )
3886
+ _make_cat_compat( $this->queried_object );
3887
+ }
3888
+ } elseif ( $this->is_post_type_archive ) {
3889
+ $post_type = $this->get( 'post_type' );
3890
+ if ( is_array( $post_type ) )
3891
+ $post_type = reset( $post_type );
3892
+ $this->queried_object = get_post_type_object( $post_type );
3893
+ } elseif ( $this->is_posts_page ) {
3894
+ $page_for_posts = get_option('page_for_posts');
3895
+ $this->queried_object = get_post( $page_for_posts );
3896
+ $this->queried_object_id = (int) $this->queried_object->ID;
3897
+ } elseif ( $this->is_singular && ! empty( $this->post ) ) {
3898
+ $this->queried_object = $this->post;
3899
+ $this->queried_object_id = (int) $this->post->ID;
3900
+ } elseif ( $this->is_author ) {
3901
+ $this->queried_object_id = (int) $this->get('author');
3902
+ $this->queried_object = get_userdata( $this->queried_object_id );
3903
+ }
3904
+
3905
+ return $this->queried_object;
3906
+ }
3907
+
3908
+ /**
3909
+ * Retrieve ID of the current queried object.
3910
+ *
3911
+ * @since 1.5.0
3912
+ * @access public
3913
+ *
3914
+ * @return int
3915
+ */
3916
+ public function get_queried_object_id() {
3917
+ $this->get_queried_object();
3918
+
3919
+ if ( isset($this->queried_object_id) ) {
3920
+ return $this->queried_object_id;
3921
+ }
3922
+
3923
+ return 0;
3924
+ }
3925
+
3926
+ /**
3927
+ * Constructor.
3928
+ *
3929
+ * Sets up the WordPress query, if parameter is not empty.
3930
+ *
3931
+ * @since 1.5.0
3932
+ * @access public
3933
+ *
3934
+ * @param string $query URL query string.
3935
+ * @return WP_Query
3936
+ */
3937
+ public function __construct($query = '') {
3938
+ if ( ! empty($query) ) {
3939
+ $this->query($query);
3940
+ }
3941
+ }
3942
+
3943
+ /**
3944
+ * Make private properties readable for backwards compatibility.
3945
+ *
3946
+ * @since 4.0.0
3947
+ * @access public
3948
+ *
3949
+ * @param string $name Property to get.
3950
+ * @return mixed Property.
3951
+ */
3952
+ public function __get( $name ) {
3953
+ return $this->$name;
3954
+ }
3955
+
3956
+ /**
3957
+ * Make private properties settable for backwards compatibility.
3958
+ *
3959
+ * @since 4.0.0
3960
+ * @access public
3961
+ *
3962
+ * @param string $name Property to check if set.
3963
+ * @return bool Whether the property is set.
3964
+ */
3965
+ public function __isset( $name ) {
3966
+ return isset( $this->$name );
3967
+ }
3968
+
3969
+ /**
3970
+ * Make private properties settable for backwards compatibility.
3971
+ *
3972
+ * @since 4.0.0
3973
+ * @access public
3974
+ *
3975
+ * @param string $name Property to unset.
3976
+ */
3977
+ public function __unset( $name ) {
3978
+ unset( $this->$name );
3979
+ }
3980
+
3981
+ /**
3982
+ * Make private/protected methods readable for backwards compatibility.
3983
+ *
3984
+ * @since 4.0.0
3985
+ * @access public
3986
+ *
3987
+ * @param callable $name Method to call.
3988
+ * @param array $arguments Arguments to pass when calling.
3989
+ * @return mixed|bool Return value of the callback, otherwise false.
3990
+ */
3991
+ public function __call( $name, $arguments ) {
3992
+ return call_user_func_array( array( $this, $name ), $arguments );
3993
+ }
3994
+
3995
+ /**
3996
+ * Is the query for an existing archive page?
3997
+ *
3998
+ * Month, Year, Category, Author, Post Type archive...
3999
+ *
4000
+ * @since 3.1.0
4001
+ *
4002
+ * @return bool
4003
+ */
4004
+ public function is_archive() {
4005
+ return (bool) $this->is_archive;
4006
+ }
4007
+
4008
+ /**
4009
+ * Is the query for an existing post type archive page?
4010
+ *
4011
+ * @since 3.1.0
4012
+ *
4013
+ * @param mixed $post_types Optional. Post type or array of posts types to check against.
4014
+ * @return bool
4015
+ */
4016
+ public function is_post_type_archive( $post_types = '' ) {
4017
+ if ( empty( $post_types ) || ! $this->is_post_type_archive )
4018
+ return (bool) $this->is_post_type_archive;
4019
+
4020
+ $post_type = $this->get( 'post_type' );
4021
+ if ( is_array( $post_type ) )
4022
+ $post_type = reset( $post_type );
4023
+ $post_type_object = get_post_type_object( $post_type );
4024
+
4025
+ return in_array( $post_type_object->name, (array) $post_types );
4026
+ }
4027
+
4028
+ /**
4029
+ * Is the query for an existing attachment page?
4030
+ *
4031
+ * @since 3.1.0
4032
+ *
4033
+ * @param mixed $attachment Attachment ID, title, slug, or array of such.
4034
+ * @return bool
4035
+ */
4036
+ public function is_attachment( $attachment = '' ) {
4037
+ if ( ! $this->is_attachment ) {
4038
+ return false;
4039
+ }
4040
+
4041
+ if ( empty( $attachment ) ) {
4042
+ return true;
4043
+ }
4044
+
4045
+ $attachment = (array) $attachment;
4046
+
4047
+ $post_obj = $this->get_queried_object();
4048
+
4049
+ if ( in_array( $post_obj->ID, $attachment ) ) {
4050
+ return true;
4051
+ } elseif ( in_array( $post_obj->post_title, $attachment ) ) {
4052
+ return true;
4053
+ } elseif ( in_array( $post_obj->post_name, $attachment ) ) {
4054
+ return true;
4055
+ }
4056
+ return false;
4057
+ }
4058
+
4059
+ /**
4060
+ * Is the query for an existing author archive page?
4061
+ *
4062
+ * If the $author parameter is specified, this function will additionally
4063
+ * check if the query is for one of the authors specified.
4064
+ *
4065
+ * @since 3.1.0
4066
+ *
4067
+ * @param mixed $author Optional. User ID, nickname, nicename, or array of User IDs, nicknames, and nicenames
4068
+ * @return bool
4069
+ */
4070
+ public function is_author( $author = '' ) {
4071
+ if ( !$this->is_author )
4072
+ return false;
4073
+
4074
+ if ( empty($author) )
4075
+ return true;
4076
+
4077
+ $author_obj = $this->get_queried_object();
4078
+
4079
+ $author = (array) $author;
4080
+
4081
+ if ( in_array( $author_obj->ID, $author ) )
4082
+ return true;
4083
+ elseif ( in_array( $author_obj->nickname, $author ) )
4084
+ return true;
4085
+ elseif ( in_array( $author_obj->user_nicename, $author ) )
4086
+ return true;
4087
+
4088
+ return false;
4089
+ }
4090
+
4091
+ /**
4092
+ * Is the query for an existing category archive page?
4093
+ *
4094
+ * If the $category parameter is specified, this function will additionally
4095
+ * check if the query is for one of the categories specified.
4096
+ *
4097
+ * @since 3.1.0
4098
+ *
4099
+ * @param mixed $category Optional. Category ID, name, slug, or array of Category IDs, names, and slugs.
4100
+ * @return bool
4101
+ */
4102
+ public function is_category( $category = '' ) {
4103
+ if ( !$this->is_category )
4104
+ return false;
4105
+
4106
+ if ( empty($category) )
4107
+ return true;
4108
+
4109
+ $cat_obj = $this->get_queried_object();
4110
+
4111
+ $category = (array) $category;
4112
+
4113
+ if ( in_array( $cat_obj->term_id, $category ) )
4114
+ return true;
4115
+ elseif ( in_array( $cat_obj->name, $category ) )
4116
+ return true;
4117
+ elseif ( in_array( $cat_obj->slug, $category ) )
4118
+ return true;
4119
+
4120
+ return false;
4121
+ }
4122
+
4123
+ /**
4124
+ * Is the query for an existing tag archive page?
4125
+ *
4126
+ * If the $tag parameter is specified, this function will additionally
4127
+ * check if the query is for one of the tags specified.
4128
+ *
4129
+ * @since 3.1.0
4130
+ *
4131
+ * @param mixed $tag Optional. Tag ID, name, slug, or array of Tag IDs, names, and slugs.
4132
+ * @return bool
4133
+ */
4134
+ public function is_tag( $tag = '' ) {
4135
+ if ( ! $this->is_tag )
4136
+ return false;
4137
+
4138
+ if ( empty( $tag ) )
4139
+ return true;
4140
+
4141
+ $tag_obj = $this->get_queried_object();
4142
+
4143
+ $tag = (array) $tag;
4144
+
4145
+ if ( in_array( $tag_obj->term_id, $tag ) )
4146
+ return true;
4147
+ elseif ( in_array( $tag_obj->name, $tag ) )
4148
+ return true;
4149
+ elseif ( in_array( $tag_obj->slug, $tag ) )
4150
+ return true;
4151
+
4152
+ return false;
4153
+ }
4154
+
4155
+ /**
4156
+ * Is the query for an existing taxonomy archive page?
4157
+ *
4158
+ * If the $taxonomy parameter is specified, this function will additionally
4159
+ * check if the query is for that specific $taxonomy.
4160
+ *
4161
+ * If the $term parameter is specified in addition to the $taxonomy parameter,
4162
+ * this function will additionally check if the query is for one of the terms
4163
+ * specified.
4164
+ *
4165
+ * @since 3.1.0
4166
+ *
4167
+ * @param mixed $taxonomy Optional. Taxonomy slug or slugs.
4168
+ * @param mixed $term. Optional. Term ID, name, slug or array of Term IDs, names, and slugs.
4169
+ * @return bool
4170
+ */
4171
+ public function is_tax( $taxonomy = '', $term = '' ) {
4172
+ global $wp_taxonomies;
4173
+
4174
+ if ( !$this->is_tax )
4175
+ return false;
4176
+
4177
+ if ( empty( $taxonomy ) )
4178
+ return true;
4179
+
4180
+ $queried_object = $this->get_queried_object();
4181
+ $tax_array = array_intersect( array_keys( $wp_taxonomies ), (array) $taxonomy );
4182
+ $term_array = (array) $term;
4183
+
4184
+ // Check that the taxonomy matches.
4185
+ if ( ! ( isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array ) ) )
4186
+ return false;
4187
+
4188
+ // Only a Taxonomy provided.
4189
+ if ( empty( $term ) )
4190
+ return true;
4191
+
4192
+ return isset( $queried_object->term_id ) &&
4193
+ count( array_intersect(
4194
+ array( $queried_object->term_id, $queried_object->name, $queried_object->slug ),
4195
+ $term_array
4196
+ ) );
4197
+ }
4198
+
4199
+ /**
4200
+ * Whether the current URL is within the comments popup window.
4201
+ *
4202
+ * @since 3.1.0
4203
+ *
4204
+ * @return bool
4205
+ */
4206
+ public function is_comments_popup() {
4207
+ return (bool) $this->is_comments_popup;
4208
+ }
4209
+
4210
+ /**
4211
+ * Is the query for an existing date archive?
4212
+ *
4213
+ * @since 3.1.0
4214
+ *
4215
+ * @return bool
4216
+ */
4217
+ public function is_date() {
4218
+ return (bool) $this->is_date;
4219
+ }
4220
+
4221
+ /**
4222
+ * Is the query for an existing day archive?
4223
+ *
4224
+ * @since 3.1.0
4225
+ *
4226
+ * @return bool
4227
+ */
4228
+ public function is_day() {
4229
+ return (bool) $this->is_day;
4230
+ }
4231
+
4232
+ /**
4233
+ * Is the query for a feed?
4234
+ *
4235
+ * @since 3.1.0
4236
+ *
4237
+ * @param string|array $feeds Optional feed types to check.
4238
+ * @return bool
4239
+ */
4240
+ public function is_feed( $feeds = '' ) {
4241
+ if ( empty( $feeds ) || ! $this->is_feed )
4242
+ return (bool) $this->is_feed;
4243
+ $qv = $this->get( 'feed' );
4244
+ if ( 'feed' == $qv )
4245
+ $qv = get_default_feed();
4246
+ return in_array( $qv, (array) $feeds );
4247
+ }
4248
+
4249
+ /**
4250
+ * Is the query for a comments feed?
4251
+ *
4252
+ * @since 3.1.0
4253
+ *
4254
+ * @return bool
4255
+ */
4256
+ public function is_comment_feed() {
4257
+ return (bool) $this->is_comment_feed;
4258
+ }
4259
+
4260
+ /**
4261
+ * Is the query for the front page of the site?
4262
+ *
4263
+ * This is for what is displayed at your site's main URL.
4264
+ *
4265
+ * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_on_front'.
4266
+ *
4267
+ * If you set a static page for the front page of your site, this function will return
4268
+ * true when viewing that page.
4269
+ *
4270
+ * Otherwise the same as @see WP_Query::is_home()
4271
+ *
4272
+ * @since 3.1.0
4273
+ * @uses is_home()
4274
+ * @uses get_option()
4275
+ *
4276
+ * @return bool True, if front of site.
4277
+ */
4278
+ public function is_front_page() {
4279
+ // most likely case
4280
+ if ( 'posts' == get_option( 'show_on_front') && $this->is_home() )
4281
+ return true;
4282
+ elseif ( 'page' == get_option( 'show_on_front') && get_option( 'page_on_front' ) && $this->is_page( get_option( 'page_on_front' ) ) )
4283
+ return true;
4284
+ else
4285
+ return false;
4286
+ }
4287
+
4288
+ /**
4289
+ * Is the query for the blog homepage?
4290
+ *
4291
+ * This is the page which shows the time based blog content of your site.
4292
+ *
4293
+ * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_for_posts'.
4294
+ *
4295
+ * If you set a static page for the front page of your site, this function will return
4296
+ * true only on the page you set as the "Posts page".
4297
+ *
4298
+ * @see WP_Query::is_front_page()
4299
+ *
4300
+ * @since 3.1.0
4301
+ *
4302
+ * @return bool True if blog view homepage.
4303
+ */
4304
+ public function is_home() {
4305
+ return (bool) $this->is_home;
4306
+ }
4307
+
4308
+ /**
4309
+ * Is the query for an existing month archive?
4310
+ *
4311
+ * @since 3.1.0
4312
+ *
4313
+ * @return bool
4314
+ */
4315
+ public function is_month() {
4316
+ return (bool) $this->is_month;
4317
+ }
4318
+
4319
+ /**
4320
+ * Is the query for an existing single page?
4321
+ *
4322
+ * If the $page parameter is specified, this function will additionally
4323
+ * check if the query is for one of the pages specified.
4324
+ *
4325
+ * @see WP_Query::is_single()
4326
+ * @see WP_Query::is_singular()
4327
+ *
4328
+ * @since 3.1.0
4329
+ *
4330
+ * @param mixed $page Page ID, title, slug, path, or array of such.
4331
+ * @return bool
4332
+ */
4333
+ public function is_page( $page = '' ) {
4334
+ if ( !$this->is_page )
4335
+ return false;
4336
+
4337
+ if ( empty( $page ) )
4338
+ return true;
4339
+
4340
+ $page_obj = $this->get_queried_object();
4341
+
4342
+ $page = (array) $page;
4343
+
4344
+ if ( in_array( $page_obj->ID, $page ) ) {
4345
+ return true;
4346
+ } elseif ( in_array( $page_obj->post_title, $page ) ) {
4347
+ return true;
4348
+ } else if ( in_array( $page_obj->post_name, $page ) ) {
4349
+ return true;
4350
+ } else {
4351
+ foreach ( $page as $pagepath ) {
4352
+ if ( ! strpos( $pagepath, '/' ) ) {
4353
+ continue;
4354
+ }
4355
+ $pagepath_obj = get_page_by_path( $pagepath );
4356
+
4357
+ if ( $pagepath_obj && ( $pagepath_obj->ID == $page_obj->ID ) ) {
4358
+ return true;
4359
+ }
4360
+ }
4361
+ }
4362
+
4363
+ return false;
4364
+ }
4365
+
4366
+ /**
4367
+ * Is the query for paged result and not for the first page?
4368
+ *
4369
+ * @since 3.1.0
4370
+ *
4371
+ * @return bool
4372
+ */
4373
+ public function is_paged() {
4374
+ return (bool) $this->is_paged;
4375
+ }
4376
+
4377
+ /**
4378
+ * Is the query for a post or page preview?
4379
+ *
4380
+ * @since 3.1.0
4381
+ *
4382
+ * @return bool
4383
+ */
4384
+ public function is_preview() {
4385
+ return (bool) $this->is_preview;
4386
+ }
4387
+
4388
+ /**
4389
+ * Is the query for the robots file?
4390
+ *
4391
+ * @since 3.1.0
4392
+ *
4393
+ * @return bool
4394
+ */
4395
+ public function is_robots() {
4396
+ return (bool) $this->is_robots;
4397
+ }
4398
+
4399
+ /**
4400
+ * Is the query for a search?
4401
+ *
4402
+ * @since 3.1.0
4403
+ *
4404
+ * @return bool
4405
+ */
4406
+ public function is_search() {
4407
+ return (bool) $this->is_search;
4408
+ }
4409
+
4410
+ /**
4411
+ * Is the query for an existing single post?
4412
+ *
4413
+ * Works for any post type, except attachments and pages
4414
+ *
4415
+ * If the $post parameter is specified, this function will additionally
4416
+ * check if the query is for one of the Posts specified.
4417
+ *
4418
+ * @see WP_Query::is_page()
4419
+ * @see WP_Query::is_singular()
4420
+ *
4421
+ * @since 3.1.0
4422
+ *
4423
+ * @param mixed $post Post ID, title, slug, path, or array of such.
4424
+ * @return bool
4425
+ */
4426
+ public function is_single( $post = '' ) {
4427
+ if ( !$this->is_single )
4428
+ return false;
4429
+
4430
+ if ( empty($post) )
4431
+ return true;
4432
+
4433
+ $post_obj = $this->get_queried_object();
4434
+
4435
+ $post = (array) $post;
4436
+
4437
+ if ( in_array( $post_obj->ID, $post ) ) {
4438
+ return true;
4439
+ } elseif ( in_array( $post_obj->post_title, $post ) ) {
4440
+ return true;
4441
+ } elseif ( in_array( $post_obj->post_name, $post ) ) {
4442
+ return true;
4443
+ } else {
4444
+ foreach ( $post as $postpath ) {
4445
+ if ( ! strpos( $postpath, '/' ) ) {
4446
+ continue;
4447
+ }
4448
+ $postpath_obj = get_page_by_path( $postpath, OBJECT, $post_obj->post_type );
4449
+
4450
+ if ( $postpath_obj && ( $postpath_obj->ID == $post_obj->ID ) ) {
4451
+ return true;
4452
+ }
4453
+ }
4454
+ }
4455
+ return false;
4456
+ }
4457
+
4458
+ /**
4459
+ * Is the query for an existing single post of any post type (post, attachment, page, ... )?
4460
+ *
4461
+ * If the $post_types parameter is specified, this function will additionally
4462
+ * check if the query is for one of the Posts Types specified.
4463
+ *
4464
+ * @see WP_Query::is_page()
4465
+ * @see WP_Query::is_single()
4466
+ *
4467
+ * @since 3.1.0
4468
+ *
4469
+ * @param mixed $post_types Optional. Post Type or array of Post Types
4470
+ * @return bool
4471
+ */
4472
+ public function is_singular( $post_types = '' ) {
4473
+ if ( empty( $post_types ) || !$this->is_singular )
4474
+ return (bool) $this->is_singular;
4475
+
4476
+ $post_obj = $this->get_queried_object();
4477
+
4478
+ return in_array( $post_obj->post_type, (array) $post_types );
4479
+ }
4480
+
4481
+ /**
4482
+ * Is the query for a specific time?
4483
+ *
4484
+ * @since 3.1.0
4485
+ *
4486
+ * @return bool
4487
+ */
4488
+ public function is_time() {
4489
+ return (bool) $this->is_time;
4490
+ }
4491
+
4492
+ /**
4493
+ * Is the query for a trackback endpoint call?
4494
+ *
4495
+ * @since 3.1.0
4496
+ *
4497
+ * @return bool
4498
+ */
4499
+ public function is_trackback() {
4500
+ return (bool) $this->is_trackback;
4501
+ }
4502
+
4503
+ /**
4504
+ * Is the query for an existing year archive?
4505
+ *
4506
+ * @since 3.1.0
4507
+ *
4508
+ * @return bool
4509
+ */
4510
+ public function is_year() {
4511
+ return (bool) $this->is_year;
4512
+ }
4513
+
4514
+ /**
4515
+ * Is the query a 404 (returns no results)?
4516
+ *
4517
+ * @since 3.1.0
4518
+ *
4519
+ * @return bool
4520
+ */
4521
+ public function is_404() {
4522
+ return (bool) $this->is_404;
4523
+ }
4524
+
4525
+ /**
4526
+ * Is the query the main query?
4527
+ *
4528
+ * @since 3.3.0
4529
+ *
4530
+ * @return bool
4531
+ */
4532
+ public function is_main_query() {
4533
+ global $wp_the_query;
4534
+ return $wp_the_query === $this;
4535
+ }
4536
+
4537
+ /**
4538
+ * After looping through a nested query, this function
4539
+ * restores the $post global to the current post in this query.
4540
+ *
4541
+ * @since 3.7.0
4542
+ *
4543
+ * @return bool
4544
+ */
4545
+ public function reset_postdata() {
4546
+ if ( ! empty( $this->post ) ) {
4547
+ $GLOBALS['post'] = $this->post;
4548
+ setup_postdata( $this->post );
4549
+ }
4550
+ }
4551
+ }
4552
+
4553
+ /**
4554
+ * Redirect old slugs to the correct permalink.
4555
+ *
4556
+ * Attempts to find the current slug from the past slugs.
4557
+ *
4558
+ * @since 2.1.0
4559
+ * @uses $wp_query
4560
+ * @uses $wpdb
4561
+ *
4562
+ * @return null If no link is found, null is returned.
4563
+ */
4564
+ function wp_old_slug_redirect() {
4565
+ global $wp_query;
4566
+ if ( is_404() && '' != $wp_query->query_vars['name'] ) :
4567
+ global $wpdb;
4568
+
4569
+ // Guess the current post_type based on the query vars.
4570
+ if ( get_query_var('post_type') )
4571
+ $post_type = get_query_var('post_type');
4572
+ elseif ( !empty($wp_query->query_vars['pagename']) )
4573
+ $post_type = 'page';
4574
+ else
4575
+ $post_type = 'post';
4576
+
4577
+ if ( is_array( $post_type ) ) {
4578
+ if ( count( $post_type ) > 1 )
4579
+ return;
4580
+ $post_type = array_shift( $post_type );
4581
+ }
4582
+
4583
+ // Do not attempt redirect for hierarchical post types
4584
+ if ( is_post_type_hierarchical( $post_type ) )
4585
+ return;
4586
+
4587
+ $query = $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, $wp_query->query_vars['name']);
4588
+
4589
+ // if year, monthnum, or day have been specified, make our query more precise
4590
+ // just in case there are multiple identical _wp_old_slug values
4591
+ if ( '' != $wp_query->query_vars['year'] )
4592
+ $query .= $wpdb->prepare(" AND YEAR(post_date) = %d", $wp_query->query_vars['year']);
4593
+ if ( '' != $wp_query->query_vars['monthnum'] )
4594
+ $query .= $wpdb->prepare(" AND MONTH(post_date) = %d", $wp_query->query_vars['monthnum']);
4595
+ if ( '' != $wp_query->query_vars['day'] )
4596
+ $query .= $wpdb->prepare(" AND DAYOFMONTH(post_date) = %d", $wp_query->query_vars['day']);
4597
+
4598
+ $id = (int) $wpdb->get_var($query);
4599
+
4600
+ if ( ! $id )
4601
+ return;
4602
+
4603
+ $link = get_permalink($id);
4604
+
4605
+ if ( !$link )
4606
+ return;
4607
+
4608
+ wp_redirect( $link, 301 ); // Permanent redirect
4609
+ exit;
4610
+ endif;
4611
+ }
4612
+
4613
+ /**
4614
+ * Set up global post data.
4615
+ *
4616
+ * @since 1.5.0
4617
+ *
4618
+ * @param object $post Post data.
4619
+ * @uses do_action_ref_array() Calls 'the_post'
4620
+ * @return bool True when finished.
4621
+ */
4622
+ function setup_postdata( $post ) {
4623
+ global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
4624
+
4625
+ $id = (int) $post->ID;
4626
+
4627
+ $authordata = get_userdata($post->post_author);
4628
+
4629
+ $currentday = mysql2date('d.m.y', $post->post_date, false);
4630
+ $currentmonth = mysql2date('m', $post->post_date, false);
4631
+ $numpages = 1;
4632
+ $multipage = 0;
4633
+ $page = get_query_var('page');
4634
+ if ( ! $page )
4635
+ $page = 1;
4636
+ if ( is_single() || is_page() || is_feed() )
4637
+ $more = 1;
4638
+ $content = $post->post_content;
4639
+ if ( false !== strpos( $content, '<!--nextpage-->' ) ) {
4640
+ if ( $page > 1 )
4641
+ $more = 1;
4642
+ $content = str_replace( "\n<!--nextpage-->\n", '<!--nextpage-->', $content );
4643
+ $content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
4644
+ $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
4645
+ // Ignore nextpage at the beginning of the content.
4646
+ if ( 0 === strpos( $content, '<!--nextpage-->' ) )
4647
+ $content = substr( $content, 15 );
4648
+ $pages = explode('<!--nextpage-->', $content);
4649
+ $numpages = count($pages);
4650
+ if ( $numpages > 1 )
4651
+ $multipage = 1;
4652
+ } else {
4653
+ $pages = array( $post->post_content );
4654
+ }
4655
+
4656
+ /**
4657
+ * Fires once the post data has been setup.
4658
+ *
4659
+ * @since 2.8.0
4660
+ *
4661
+ * @param WP_Post &$post The Post object (passed by reference).
4662
+ */
4663
+ do_action_ref_array( 'the_post', array( &$post ) );
4664
+
4665
+ return true;
4666
+ }