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.
- checksums.yaml +8 -8
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +3 -16
- data/Rakefile +2 -0
- data/bin/stump-cli +58 -0
- data/lib/stump-cli/version.rb +3 -0
- data/lib/stump.rb +5 -0
- data/lib/wp/Movefile-example +62 -0
- data/lib/wp/README.md +25 -0
- data/lib/wp/index.php +17 -0
- data/lib/wp/license.txt +385 -0
- data/lib/wp/readme.html +96 -0
- data/lib/wp/wp-activate.php +131 -0
- data/lib/wp/wp-admin/about.php +193 -0
- data/lib/wp/wp-admin/admin-ajax.php +98 -0
- data/lib/wp/wp-admin/admin-footer.php +99 -0
- data/lib/wp/wp-admin/admin-functions.php +15 -0
- data/lib/wp/wp-admin/admin-header.php +243 -0
- data/lib/wp/wp-admin/admin-post.php +71 -0
- data/lib/wp/wp-admin/admin.php +347 -0
- data/lib/wp/wp-admin/async-upload.php +114 -0
- data/lib/wp/wp-admin/comment.php +299 -0
- data/lib/wp/wp-admin/credits.php +192 -0
- data/lib/wp/wp-admin/css/about-rtl.css +446 -0
- data/lib/wp/wp-admin/css/about.css +446 -0
- data/lib/wp/wp-admin/css/admin-menu-rtl.css +917 -0
- data/lib/wp/wp-admin/css/admin-menu.css +917 -0
- data/lib/wp/wp-admin/css/color-picker-rtl.css +127 -0
- data/lib/wp/wp-admin/css/color-picker-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/color-picker.css +127 -0
- data/lib/wp/wp-admin/css/color-picker.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/_admin.scss +525 -0
- data/lib/wp/wp-admin/css/colors/_mixins.scss +43 -0
- data/lib/wp/wp-admin/css/colors/_variables.scss +58 -0
- data/lib/wp/wp-admin/css/colors/blue/colors-rtl.css +341 -0
- data/lib/wp/wp-admin/css/colors/blue/colors-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/blue/colors.css +341 -0
- data/lib/wp/wp-admin/css/colors/blue/colors.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/blue/colors.scss +11 -0
- data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.css +341 -0
- data/lib/wp/wp-admin/css/colors/coffee/colors-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/coffee/colors.css +341 -0
- data/lib/wp/wp-admin/css/colors/coffee/colors.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/coffee/colors.scss +7 -0
- data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.css +341 -0
- data/lib/wp/wp-admin/css/colors/ectoplasm/colors-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/ectoplasm/colors.css +341 -0
- data/lib/wp/wp-admin/css/colors/ectoplasm/colors.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/ectoplasm/colors.scss +8 -0
- data/lib/wp/wp-admin/css/colors/light/colors-rtl.css +349 -0
- data/lib/wp/wp-admin/css/colors/light/colors-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/light/colors.css +349 -0
- data/lib/wp/wp-admin/css/colors/light/colors.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/light/colors.scss +38 -0
- data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.css +341 -0
- data/lib/wp/wp-admin/css/colors/midnight/colors-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/midnight/colors.css +341 -0
- data/lib/wp/wp-admin/css/colors/midnight/colors.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/midnight/colors.scss +5 -0
- data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.css +341 -0
- data/lib/wp/wp-admin/css/colors/ocean/colors-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/ocean/colors.css +341 -0
- data/lib/wp/wp-admin/css/colors/ocean/colors.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/ocean/colors.scss +8 -0
- data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.css +341 -0
- data/lib/wp/wp-admin/css/colors/sunrise/colors-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/sunrise/colors.css +341 -0
- data/lib/wp/wp-admin/css/colors/sunrise/colors.min.css +1 -0
- data/lib/wp/wp-admin/css/colors/sunrise/colors.scss +6 -0
- data/lib/wp/wp-admin/css/common-rtl.css +3212 -0
- data/lib/wp/wp-admin/css/common.css +3212 -0
- data/lib/wp/wp-admin/css/customize-controls-rtl.css +889 -0
- data/lib/wp/wp-admin/css/customize-controls-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/customize-controls.css +889 -0
- data/lib/wp/wp-admin/css/customize-controls.min.css +1 -0
- data/lib/wp/wp-admin/css/customize-widgets-rtl.css +603 -0
- data/lib/wp/wp-admin/css/customize-widgets-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/customize-widgets.css +603 -0
- data/lib/wp/wp-admin/css/customize-widgets.min.css +1 -0
- data/lib/wp/wp-admin/css/dashboard-rtl.css +1116 -0
- data/lib/wp/wp-admin/css/dashboard.css +1116 -0
- data/lib/wp/wp-admin/css/deprecated-media-rtl.css +371 -0
- data/lib/wp/wp-admin/css/deprecated-media-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/deprecated-media.css +371 -0
- data/lib/wp/wp-admin/css/deprecated-media.min.css +1 -0
- data/lib/wp/wp-admin/css/edit-rtl.css +1501 -0
- data/lib/wp/wp-admin/css/edit.css +1501 -0
- data/lib/wp/wp-admin/css/farbtastic-rtl.css +41 -0
- data/lib/wp/wp-admin/css/farbtastic.css +41 -0
- data/lib/wp/wp-admin/css/forms-rtl.css +992 -0
- data/lib/wp/wp-admin/css/forms.css +992 -0
- data/lib/wp/wp-admin/css/ie-rtl.css +785 -0
- data/lib/wp/wp-admin/css/ie-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/ie.css +785 -0
- data/lib/wp/wp-admin/css/ie.min.css +1 -0
- data/lib/wp/wp-admin/css/install-rtl.css +389 -0
- data/lib/wp/wp-admin/css/install-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/install.css +389 -0
- data/lib/wp/wp-admin/css/install.min.css +1 -0
- data/lib/wp/wp-admin/css/l10n-rtl.css +101 -0
- data/lib/wp/wp-admin/css/l10n.css +101 -0
- data/lib/wp/wp-admin/css/list-tables-rtl.css +1875 -0
- data/lib/wp/wp-admin/css/list-tables.css +1875 -0
- data/lib/wp/wp-admin/css/login-rtl.css +269 -0
- data/lib/wp/wp-admin/css/login-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/login.css +269 -0
- data/lib/wp/wp-admin/css/login.min.css +1 -0
- data/lib/wp/wp-admin/css/media-rtl.css +1196 -0
- data/lib/wp/wp-admin/css/media.css +1196 -0
- data/lib/wp/wp-admin/css/nav-menus-rtl.css +857 -0
- data/lib/wp/wp-admin/css/nav-menus.css +857 -0
- data/lib/wp/wp-admin/css/press-this-rtl.css +458 -0
- data/lib/wp/wp-admin/css/press-this.css +458 -0
- data/lib/wp/wp-admin/css/revisions-rtl.css +574 -0
- data/lib/wp/wp-admin/css/revisions.css +574 -0
- data/lib/wp/wp-admin/css/themes-rtl.css +1732 -0
- data/lib/wp/wp-admin/css/themes.css +1732 -0
- data/lib/wp/wp-admin/css/widgets-rtl.css +577 -0
- data/lib/wp/wp-admin/css/widgets.css +577 -0
- data/lib/wp/wp-admin/css/wp-admin-rtl.css +14 -0
- data/lib/wp/wp-admin/css/wp-admin-rtl.min.css +1 -0
- data/lib/wp/wp-admin/css/wp-admin.css +14 -0
- data/lib/wp/wp-admin/css/wp-admin.min.css +1 -0
- data/lib/wp/wp-admin/custom-background.php +482 -0
- data/lib/wp/wp-admin/custom-header.php +1366 -0
- data/lib/wp/wp-admin/customize.php +278 -0
- data/lib/wp/wp-admin/edit-comments.php +254 -0
- data/lib/wp/wp-admin/edit-form-advanced.php +636 -0
- data/lib/wp/wp-admin/edit-form-comment.php +160 -0
- data/lib/wp/wp-admin/edit-link-form.php +150 -0
- data/lib/wp/wp-admin/edit-tag-form.php +204 -0
- data/lib/wp/wp-admin/edit-tags.php +591 -0
- data/lib/wp/wp-admin/edit.php +330 -0
- data/lib/wp/wp-admin/export.php +243 -0
- data/lib/wp/wp-admin/freedoms.php +57 -0
- data/lib/wp/wp-admin/images/align-center-2x.png +0 -0
- data/lib/wp/wp-admin/images/align-center.png +0 -0
- data/lib/wp/wp-admin/images/align-left-2x.png +0 -0
- data/lib/wp/wp-admin/images/align-left.png +0 -0
- data/lib/wp/wp-admin/images/align-none-2x.png +0 -0
- data/lib/wp/wp-admin/images/align-none.png +0 -0
- data/lib/wp/wp-admin/images/align-right-2x.png +0 -0
- data/lib/wp/wp-admin/images/align-right.png +0 -0
- data/lib/wp/wp-admin/images/arrows-2x.png +0 -0
- data/lib/wp/wp-admin/images/arrows.png +0 -0
- data/lib/wp/wp-admin/images/bubble_bg-2x.gif +0 -0
- data/lib/wp/wp-admin/images/bubble_bg.gif +0 -0
- data/lib/wp/wp-admin/images/comment-grey-bubble-2x.png +0 -0
- data/lib/wp/wp-admin/images/comment-grey-bubble.png +0 -0
- data/lib/wp/wp-admin/images/date-button-2x.gif +0 -0
- data/lib/wp/wp-admin/images/date-button.gif +0 -0
- data/lib/wp/wp-admin/images/generic.png +0 -0
- data/lib/wp/wp-admin/images/icons32-2x.png +0 -0
- data/lib/wp/wp-admin/images/icons32-vs-2x.png +0 -0
- data/lib/wp/wp-admin/images/icons32-vs.png +0 -0
- data/lib/wp/wp-admin/images/icons32.png +0 -0
- data/lib/wp/wp-admin/images/imgedit-icons-2x.png +0 -0
- data/lib/wp/wp-admin/images/imgedit-icons.png +0 -0
- data/lib/wp/wp-admin/images/list-2x.png +0 -0
- data/lib/wp/wp-admin/images/list.png +0 -0
- data/lib/wp/wp-admin/images/loading.gif +0 -0
- data/lib/wp/wp-admin/images/marker.png +0 -0
- data/lib/wp/wp-admin/images/mask.png +0 -0
- data/lib/wp/wp-admin/images/media-button-2x.png +0 -0
- data/lib/wp/wp-admin/images/media-button-image.gif +0 -0
- data/lib/wp/wp-admin/images/media-button-music.gif +0 -0
- data/lib/wp/wp-admin/images/media-button-other.gif +0 -0
- data/lib/wp/wp-admin/images/media-button-video.gif +0 -0
- data/lib/wp/wp-admin/images/media-button.png +0 -0
- data/lib/wp/wp-admin/images/menu-2x.png +0 -0
- data/lib/wp/wp-admin/images/menu-vs-2x.png +0 -0
- data/lib/wp/wp-admin/images/menu-vs.png +0 -0
- data/lib/wp/wp-admin/images/menu.png +0 -0
- data/lib/wp/wp-admin/images/no.png +0 -0
- data/lib/wp/wp-admin/images/post-formats-vs.png +0 -0
- data/lib/wp/wp-admin/images/post-formats.png +0 -0
- data/lib/wp/wp-admin/images/post-formats32-vs.png +0 -0
- data/lib/wp/wp-admin/images/post-formats32.png +0 -0
- data/lib/wp/wp-admin/images/resize-2x.gif +0 -0
- data/lib/wp/wp-admin/images/resize-rtl-2x.gif +0 -0
- data/lib/wp/wp-admin/images/resize-rtl.gif +0 -0
- data/lib/wp/wp-admin/images/resize.gif +0 -0
- data/lib/wp/wp-admin/images/se.png +0 -0
- data/lib/wp/wp-admin/images/sort-2x.gif +0 -0
- data/lib/wp/wp-admin/images/sort.gif +0 -0
- data/lib/wp/wp-admin/images/spinner-2x.gif +0 -0
- data/lib/wp/wp-admin/images/spinner.gif +0 -0
- data/lib/wp/wp-admin/images/stars-2x.png +0 -0
- data/lib/wp/wp-admin/images/stars.png +0 -0
- data/lib/wp/wp-admin/images/w-logo-blue.png +0 -0
- data/lib/wp/wp-admin/images/w-logo-white.png +0 -0
- data/lib/wp/wp-admin/images/wheel.png +0 -0
- data/lib/wp/wp-admin/images/wordpress-logo-white.svg +1 -0
- data/lib/wp/wp-admin/images/wordpress-logo.png +0 -0
- data/lib/wp/wp-admin/images/wordpress-logo.svg +1 -0
- data/lib/wp/wp-admin/images/wpspin_light-2x.gif +0 -0
- data/lib/wp/wp-admin/images/wpspin_light.gif +0 -0
- data/lib/wp/wp-admin/images/xit-2x.gif +0 -0
- data/lib/wp/wp-admin/images/xit.gif +0 -0
- data/lib/wp/wp-admin/images/yes.png +0 -0
- data/lib/wp/wp-admin/import.php +132 -0
- data/lib/wp/wp-admin/includes/admin.php +74 -0
- data/lib/wp/wp-admin/includes/ajax-actions.php +2762 -0
- data/lib/wp/wp-admin/includes/bookmark.php +305 -0
- data/lib/wp/wp-admin/includes/class-ftp-pure.php +190 -0
- data/lib/wp/wp-admin/includes/class-ftp-sockets.php +250 -0
- data/lib/wp/wp-admin/includes/class-ftp.php +907 -0
- data/lib/wp/wp-admin/includes/class-pclzip.php +5687 -0
- data/lib/wp/wp-admin/includes/class-wp-comments-list-table.php +637 -0
- data/lib/wp/wp-admin/includes/class-wp-filesystem-base.php +815 -0
- data/lib/wp/wp-admin/includes/class-wp-filesystem-direct.php +384 -0
- data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpext.php +415 -0
- data/lib/wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php +352 -0
- data/lib/wp/wp-admin/includes/class-wp-filesystem-ssh2.php +392 -0
- data/lib/wp/wp-admin/includes/class-wp-importer.php +302 -0
- data/lib/wp/wp-admin/includes/class-wp-links-list-table.php +207 -0
- data/lib/wp/wp-admin/includes/class-wp-list-table.php +1080 -0
- data/lib/wp/wp-admin/includes/class-wp-media-list-table.php +574 -0
- data/lib/wp/wp-admin/includes/class-wp-ms-sites-list-table.php +402 -0
- data/lib/wp/wp-admin/includes/class-wp-ms-themes-list-table.php +459 -0
- data/lib/wp/wp-admin/includes/class-wp-ms-users-list-table.php +303 -0
- data/lib/wp/wp-admin/includes/class-wp-plugin-install-list-table.php +490 -0
- data/lib/wp/wp-admin/includes/class-wp-plugins-list-table.php +605 -0
- data/lib/wp/wp-admin/includes/class-wp-posts-list-table.php +1306 -0
- data/lib/wp/wp-admin/includes/class-wp-terms-list-table.php +466 -0
- data/lib/wp/wp-admin/includes/class-wp-theme-install-list-table.php +431 -0
- data/lib/wp/wp-admin/includes/class-wp-themes-list-table.php +279 -0
- data/lib/wp/wp-admin/includes/class-wp-upgrader-skins.php +767 -0
- data/lib/wp/wp-admin/includes/class-wp-upgrader.php +2676 -0
- data/lib/wp/wp-admin/includes/class-wp-users-list-table.php +459 -0
- data/lib/wp/wp-admin/includes/comment.php +171 -0
- data/lib/wp/wp-admin/includes/continents-cities.php +493 -0
- data/lib/wp/wp-admin/includes/dashboard.php +1333 -0
- data/lib/wp/wp-admin/includes/deprecated.php +1190 -0
- data/lib/wp/wp-admin/includes/export.php +508 -0
- data/lib/wp/wp-admin/includes/file.php +1152 -0
- data/lib/wp/wp-admin/includes/image-edit.php +828 -0
- data/lib/wp/wp-admin/includes/image.php +598 -0
- data/lib/wp/wp-admin/includes/import.php +206 -0
- data/lib/wp/wp-admin/includes/list-table.php +113 -0
- data/lib/wp/wp-admin/includes/media.php +3012 -0
- data/lib/wp/wp-admin/includes/menu.php +322 -0
- data/lib/wp/wp-admin/includes/meta-boxes.php +1119 -0
- data/lib/wp/wp-admin/includes/misc.php +845 -0
- data/lib/wp/wp-admin/includes/ms-deprecated.php +78 -0
- data/lib/wp/wp-admin/includes/ms.php +814 -0
- data/lib/wp/wp-admin/includes/nav-menu.php +1328 -0
- data/lib/wp/wp-admin/includes/plugin-install.php +550 -0
- data/lib/wp/wp-admin/includes/plugin.php +1899 -0
- data/lib/wp/wp-admin/includes/post.php +1661 -0
- data/lib/wp/wp-admin/includes/revision.php +228 -0
- data/lib/wp/wp-admin/includes/schema.php +1038 -0
- data/lib/wp/wp-admin/includes/screen.php +1179 -0
- data/lib/wp/wp-admin/includes/taxonomy.php +284 -0
- data/lib/wp/wp-admin/includes/template.php +2157 -0
- data/lib/wp/wp-admin/includes/theme-install.php +205 -0
- data/lib/wp/wp-admin/includes/theme.php +474 -0
- data/lib/wp/wp-admin/includes/translation-install.php +240 -0
- data/lib/wp/wp-admin/includes/update-core.php +1186 -0
- data/lib/wp/wp-admin/includes/update.php +432 -0
- data/lib/wp/wp-admin/includes/upgrade.php +2218 -0
- data/lib/wp/wp-admin/includes/user.php +442 -0
- data/lib/wp/wp-admin/includes/widgets.php +245 -0
- data/lib/wp/wp-admin/index.php +131 -0
- data/lib/wp/wp-admin/install-helper.php +199 -0
- data/lib/wp/wp-admin/install.php +305 -0
- data/lib/wp/wp-admin/js/accordion.js +143 -0
- data/lib/wp/wp-admin/js/accordion.min.js +1 -0
- data/lib/wp/wp-admin/js/color-picker.js +155 -0
- data/lib/wp/wp-admin/js/color-picker.min.js +1 -0
- data/lib/wp/wp-admin/js/comment.js +50 -0
- data/lib/wp/wp-admin/js/comment.min.js +1 -0
- data/lib/wp/wp-admin/js/common.js +804 -0
- data/lib/wp/wp-admin/js/common.min.js +1 -0
- data/lib/wp/wp-admin/js/custom-background.js +75 -0
- data/lib/wp/wp-admin/js/custom-background.min.js +1 -0
- data/lib/wp/wp-admin/js/custom-header.js +61 -0
- data/lib/wp/wp-admin/js/customize-controls.js +1305 -0
- data/lib/wp/wp-admin/js/customize-controls.min.js +1 -0
- data/lib/wp/wp-admin/js/customize-widgets.js +1882 -0
- data/lib/wp/wp-admin/js/customize-widgets.min.js +1 -0
- data/lib/wp/wp-admin/js/dashboard.js +190 -0
- data/lib/wp/wp-admin/js/dashboard.min.js +1 -0
- data/lib/wp/wp-admin/js/edit-comments.js +625 -0
- data/lib/wp/wp-admin/js/edit-comments.min.js +1 -0
- data/lib/wp/wp-admin/js/editor-expand.js +705 -0
- data/lib/wp/wp-admin/js/editor-expand.min.js +1 -0
- data/lib/wp/wp-admin/js/editor.js +324 -0
- data/lib/wp/wp-admin/js/editor.min.js +1 -0
- data/lib/wp/wp-admin/js/farbtastic.js +276 -0
- data/lib/wp/wp-admin/js/gallery.js +237 -0
- data/lib/wp/wp-admin/js/gallery.min.js +1 -0
- data/lib/wp/wp-admin/js/image-edit.js +633 -0
- data/lib/wp/wp-admin/js/image-edit.min.js +1 -0
- data/lib/wp/wp-admin/js/inline-edit-post.js +359 -0
- data/lib/wp/wp-admin/js/inline-edit-post.min.js +1 -0
- data/lib/wp/wp-admin/js/inline-edit-tax.js +142 -0
- data/lib/wp/wp-admin/js/inline-edit-tax.min.js +1 -0
- data/lib/wp/wp-admin/js/iris.min.js +4 -0
- data/lib/wp/wp-admin/js/language-chooser.js +26 -0
- data/lib/wp/wp-admin/js/language-chooser.min.js +1 -0
- data/lib/wp/wp-admin/js/link.js +69 -0
- data/lib/wp/wp-admin/js/link.min.js +1 -0
- data/lib/wp/wp-admin/js/media-gallery.js +26 -0
- data/lib/wp/wp-admin/js/media-gallery.min.js +1 -0
- data/lib/wp/wp-admin/js/media-upload.js +69 -0
- data/lib/wp/wp-admin/js/media-upload.min.js +1 -0
- data/lib/wp/wp-admin/js/media.js +111 -0
- data/lib/wp/wp-admin/js/media.min.js +1 -0
- data/lib/wp/wp-admin/js/nav-menu.js +1205 -0
- data/lib/wp/wp-admin/js/nav-menu.min.js +1 -0
- data/lib/wp/wp-admin/js/password-strength-meter.js +75 -0
- data/lib/wp/wp-admin/js/password-strength-meter.min.js +1 -0
- data/lib/wp/wp-admin/js/plugin-install.js +76 -0
- data/lib/wp/wp-admin/js/plugin-install.min.js +1 -0
- data/lib/wp/wp-admin/js/post.js +1094 -0
- data/lib/wp/wp-admin/js/post.min.js +1 -0
- data/lib/wp/wp-admin/js/postbox.js +199 -0
- data/lib/wp/wp-admin/js/postbox.min.js +1 -0
- data/lib/wp/wp-admin/js/revisions.js +1110 -0
- data/lib/wp/wp-admin/js/revisions.min.js +1 -0
- data/lib/wp/wp-admin/js/set-post-thumbnail.js +24 -0
- data/lib/wp/wp-admin/js/set-post-thumbnail.min.js +1 -0
- data/lib/wp/wp-admin/js/svg-painter.js +240 -0
- data/lib/wp/wp-admin/js/svg-painter.min.js +1 -0
- data/lib/wp/wp-admin/js/tags.js +72 -0
- data/lib/wp/wp-admin/js/tags.min.js +1 -0
- data/lib/wp/wp-admin/js/theme.js +1691 -0
- data/lib/wp/wp-admin/js/theme.min.js +1 -0
- data/lib/wp/wp-admin/js/updates.js +65 -0
- data/lib/wp/wp-admin/js/updates.min.js +1 -0
- data/lib/wp/wp-admin/js/user-profile.js +127 -0
- data/lib/wp/wp-admin/js/user-profile.min.js +1 -0
- data/lib/wp/wp-admin/js/user-suggest.js +30 -0
- data/lib/wp/wp-admin/js/user-suggest.min.js +1 -0
- data/lib/wp/wp-admin/js/widgets.js +494 -0
- data/lib/wp/wp-admin/js/widgets.min.js +1 -0
- data/lib/wp/wp-admin/js/word-count.js +44 -0
- data/lib/wp/wp-admin/js/word-count.min.js +1 -0
- data/lib/wp/wp-admin/js/wp-fullscreen.js +704 -0
- data/lib/wp/wp-admin/js/wp-fullscreen.min.js +1 -0
- data/lib/wp/wp-admin/js/xfn.js +17 -0
- data/lib/wp/wp-admin/js/xfn.min.js +1 -0
- data/lib/wp/wp-admin/link-add.php +29 -0
- data/lib/wp/wp-admin/link-manager.php +99 -0
- data/lib/wp/wp-admin/link-parse-opml.php +84 -0
- data/lib/wp/wp-admin/link.php +117 -0
- data/lib/wp/wp-admin/load-scripts.php +162 -0
- data/lib/wp/wp-admin/load-styles.php +153 -0
- data/lib/wp/wp-admin/maint/repair.php +124 -0
- data/lib/wp/wp-admin/media-new.php +84 -0
- data/lib/wp/wp-admin/media-upload.php +100 -0
- data/lib/wp/wp-admin/media.php +146 -0
- data/lib/wp/wp-admin/menu-header.php +227 -0
- data/lib/wp/wp-admin/menu.php +255 -0
- data/lib/wp/wp-admin/moderation.php +12 -0
- data/lib/wp/wp-admin/ms-admin.php +13 -0
- data/lib/wp/wp-admin/ms-delete-site.php +91 -0
- data/lib/wp/wp-admin/ms-edit.php +13 -0
- data/lib/wp/wp-admin/ms-options.php +12 -0
- data/lib/wp/wp-admin/ms-sites.php +13 -0
- data/lib/wp/wp-admin/ms-themes.php +13 -0
- data/lib/wp/wp-admin/ms-upgrade-network.php +13 -0
- data/lib/wp/wp-admin/ms-users.php +13 -0
- data/lib/wp/wp-admin/my-sites.php +145 -0
- data/lib/wp/wp-admin/nav-menus.php +798 -0
- data/lib/wp/wp-admin/network.php +561 -0
- data/lib/wp/wp-admin/network/about.php +16 -0
- data/lib/wp/wp-admin/network/admin.php +32 -0
- data/lib/wp/wp-admin/network/credits.php +16 -0
- data/lib/wp/wp-admin/network/edit.php +42 -0
- data/lib/wp/wp-admin/network/freedoms.php +16 -0
- data/lib/wp/wp-admin/network/index.php +79 -0
- data/lib/wp/wp-admin/network/menu.php +63 -0
- data/lib/wp/wp-admin/network/plugin-editor.php +16 -0
- data/lib/wp/wp-admin/network/plugin-install.php +19 -0
- data/lib/wp/wp-admin/network/plugins.php +16 -0
- data/lib/wp/wp-admin/network/profile.php +16 -0
- data/lib/wp/wp-admin/network/settings.php +347 -0
- data/lib/wp/wp-admin/network/setup.php +16 -0
- data/lib/wp/wp-admin/network/site-info.php +178 -0
- data/lib/wp/wp-admin/network/site-new.php +153 -0
- data/lib/wp/wp-admin/network/site-settings.php +173 -0
- data/lib/wp/wp-admin/network/site-themes.php +185 -0
- data/lib/wp/wp-admin/network/site-users.php +319 -0
- data/lib/wp/wp-admin/network/sites.php +275 -0
- data/lib/wp/wp-admin/network/theme-editor.php +16 -0
- data/lib/wp/wp-admin/network/theme-install.php +19 -0
- data/lib/wp/wp-admin/network/themes.php +291 -0
- data/lib/wp/wp-admin/network/update-core.php +16 -0
- data/lib/wp/wp-admin/network/update.php +19 -0
- data/lib/wp/wp-admin/network/upgrade.php +120 -0
- data/lib/wp/wp-admin/network/user-edit.php +16 -0
- data/lib/wp/wp-admin/network/user-new.php +106 -0
- data/lib/wp/wp-admin/network/users.php +296 -0
- data/lib/wp/wp-admin/options-discussion.php +273 -0
- data/lib/wp/wp-admin/options-general.php +355 -0
- data/lib/wp/wp-admin/options-head.php +18 -0
- data/lib/wp/wp-admin/options-media.php +136 -0
- data/lib/wp/wp-admin/options-permalink.php +289 -0
- data/lib/wp/wp-admin/options-reading.php +184 -0
- data/lib/wp/wp-admin/options-writing.php +194 -0
- data/lib/wp/wp-admin/options.php +265 -0
- data/lib/wp/wp-admin/plugin-editor.php +279 -0
- data/lib/wp/wp-admin/plugin-install.php +134 -0
- data/lib/wp/wp-admin/plugins.php +474 -0
- data/lib/wp/wp-admin/post-new.php +74 -0
- data/lib/wp/wp-admin/post.php +318 -0
- data/lib/wp/wp-admin/press-this.php +691 -0
- data/lib/wp/wp-admin/profile.php +18 -0
- data/lib/wp/wp-admin/revision.php +221 -0
- data/lib/wp/wp-admin/setup-config.php +345 -0
- data/lib/wp/wp-admin/theme-editor.php +243 -0
- data/lib/wp/wp-admin/theme-install.php +278 -0
- data/lib/wp/wp-admin/themes.php +374 -0
- data/lib/wp/wp-admin/tools.php +75 -0
- data/lib/wp/wp-admin/update-core.php +653 -0
- data/lib/wp/wp-admin/update.php +272 -0
- data/lib/wp/wp-admin/upgrade-functions.php +12 -0
- data/lib/wp/wp-admin/upgrade.php +116 -0
- data/lib/wp/wp-admin/upload.php +292 -0
- data/lib/wp/wp-admin/user-edit.php +557 -0
- data/lib/wp/wp-admin/user-new.php +439 -0
- data/lib/wp/wp-admin/user/about.php +13 -0
- data/lib/wp/wp-admin/user/admin.php +32 -0
- data/lib/wp/wp-admin/user/credits.php +13 -0
- data/lib/wp/wp-admin/user/freedoms.php +13 -0
- data/lib/wp/wp-admin/user/index.php +12 -0
- data/lib/wp/wp-admin/user/menu.php +22 -0
- data/lib/wp/wp-admin/user/profile.php +12 -0
- data/lib/wp/wp-admin/user/user-edit.php +12 -0
- data/lib/wp/wp-admin/users.php +460 -0
- data/lib/wp/wp-admin/widgets.php +442 -0
- data/lib/wp/wp-blog-header.php +18 -0
- data/lib/wp/wp-comments-post.php +164 -0
- data/lib/wp/wp-config-sample.php +80 -0
- data/lib/wp/wp-content/index.php +2 -0
- data/lib/wp/wp-content/plugins/hello.php +82 -0
- data/lib/wp/wp-content/plugins/index.php +2 -0
- data/lib/wp/wp-content/themes/index.php +2 -0
- data/lib/wp/wp-content/themes/stump/.editorconfig +11 -0
- data/lib/wp/wp-content/themes/stump/.jshintrc +16 -0
- data/lib/wp/wp-content/themes/stump/404.php +13 -0
- data/lib/wp/wp-content/themes/stump/CHANGELOG.md +333 -0
- data/lib/wp/wp-content/themes/stump/CONTRIBUTING.md +121 -0
- data/lib/wp/wp-content/themes/stump/Gruntfile.js +151 -0
- data/lib/wp/wp-content/themes/stump/LICENSE.md +19 -0
- data/lib/wp/wp-content/themes/stump/assets/coffee/build/.gitkeep +0 -0
- data/lib/wp/wp-content/themes/stump/assets/coffee/build/site.js +6 -0
- data/lib/wp/wp-content/themes/stump/assets/css/editor-style.css +548 -0
- data/lib/wp/wp-content/themes/stump/assets/css/main.min.css +4 -0
- data/lib/wp/wp-content/themes/stump/assets/css/main.min.css.map +7 -0
- data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/wp/wp-content/themes/stump/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/wp/wp-content/themes/stump/assets/img/.gitignore +0 -0
- data/lib/wp/wp-content/themes/stump/assets/js/_main.js +63 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/affix.js +137 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/alert.js +88 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/button.js +107 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/carousel.js +205 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/collapse.js +170 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/dropdown.js +147 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/modal.js +243 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/popover.js +110 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/scrollspy.js +153 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tab.js +125 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/tooltip.js +399 -0
- data/lib/wp/wp-content/themes/stump/assets/js/plugins/bootstrap/transition.js +48 -0
- data/lib/wp/wp-content/themes/stump/assets/js/scripts.min.js +1 -0
- data/lib/wp/wp-content/themes/stump/assets/js/vendor/jquery-1.11.0.min.js +4 -0
- data/lib/wp/wp-content/themes/stump/assets/js/vendor/modernizr-2.7.0.min.js +4 -0
- data/lib/wp/wp-content/themes/stump/assets/sass/app.scss +9 -0
- data/lib/wp/wp-content/themes/stump/assets/sass/core/_variables.scss +1 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_alerts.scss +67 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_badges.scss +55 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_bootstrap.scss +49 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_breadcrumbs.scss +26 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_button-groups.scss +226 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_buttons.scss +159 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_carousel.scss +232 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_close.scss +35 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_code.scss +63 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_component-animations.scss +29 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_dropdowns.scss +213 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_forms.scss +436 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_glyphicons.scss +233 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_grid.scss +84 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_input-groups.scss +162 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_jumbotron.scss +44 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_labels.scss +64 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_list-group.scss +110 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_media.scss +56 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_mixins.scss +947 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_modals.scss +139 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navbar.scss +620 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_navs.scss +242 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_normalize.scss +423 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pager.scss +55 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_pagination.scss +88 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_panels.scss +241 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_popovers.scss +133 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_print.scss +101 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_progress-bars.scss +80 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_responsive-utilities.scss +74 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_scaffolding.scss +134 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tables.scss +233 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_theme.scss +247 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_thumbnails.scss +38 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_tooltip.scss +95 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_type.scss +284 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_utilities.scss +56 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_variables.scss +833 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/bootstrap/_wells.scss +29 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon-deprecated-upcoming.scss +13 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/_bourbon.scss +59 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_button.scss +273 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_clearfix.scss +29 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_font-family.scss +5 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_hide-text.scss +5 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_html5-input-types.scss +56 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_position.scss +42 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_prefixer.scss +49 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_retina-image.scss +32 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_size.scss +44 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_timing-functions.scss +32 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/addons/_triangle.scss +45 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_animation.scss +52 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_appearance.scss +3 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_backface-visibility.scss +6 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background-image.scss +48 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_background.scss +103 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-image.scss +55 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_border-radius.scss +22 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_box-sizing.scss +4 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_columns.scss +47 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_flex-box.scss +52 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_font-face.scss +23 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_hidpi-media-query.scss +10 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_image-rendering.scss +13 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_inline-block.scss +8 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_keyframes.scss +43 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_linear-gradient.scss +41 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_perspective.scss +8 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_placeholder.scss +29 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_radial-gradient.scss +44 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transform.scss +15 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_transition.scss +34 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/css3/_user-select.scss +3 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_compact.scss +11 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_flex-grid.scss +39 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_grid-width.scss +13 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_linear-gradient.scss +13 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_modular-scale.scss +40 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_px-to-em.scss +8 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_radial-gradient.scss +23 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_tint-shade.scss +9 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/functions/_transition-property-name.scss +22 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_deprecated-webkit-gradient.scss +39 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_gradient-positions-parser.scss +13 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_linear-positions-parser.scss +61 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-arg-parser.scss +69 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_radial-positions-parser.scss +18 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_render-gradients.scss +26 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/bourbon/helpers/_shape-size-stripper.scss +10 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan.sass +11 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_grid.sass +161 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_mixins.sass +63 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_utilities.sass +24 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/manhattan/_variables.sass +42 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat-helpers.scss +8 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/_neat.scss +21 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_new-breakpoint.scss +16 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_private.scss +107 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/functions/_px-to-em.scss +3 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_fill-parent.scss +7 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_grid.scss +5 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_media.scss +51 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_omega.scss +79 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_outer-container.scss +8 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_pad.scss +8 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_private.scss +50 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_reset.scss +12 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_row.scss +17 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_shift.scss +9 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_span-columns.scss +38 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_to-deprecate.scss +57 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/grid/_visual-grid.scss +41 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_grid.scss +7 -0
- data/lib/wp/wp-content/themes/stump/assets/vendor/manhattan/neat/settings/_visual-grid.scss +5 -0
- data/lib/wp/wp-content/themes/stump/base.php +36 -0
- data/lib/wp/wp-content/themes/stump/functions.php +19 -0
- data/lib/wp/wp-content/themes/stump/index.php +21 -0
- data/lib/wp/wp-content/themes/stump/lang/ar.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/ar.po +270 -0
- data/lib/wp/wp-content/themes/stump/lang/bg_BG.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/bg_BG.po +338 -0
- data/lib/wp/wp-content/themes/stump/lang/ca.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/ca.po +517 -0
- data/lib/wp/wp-content/themes/stump/lang/da_DK.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/da_DK.po +305 -0
- data/lib/wp/wp-content/themes/stump/lang/de_DE.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/de_DE.po +271 -0
- data/lib/wp/wp-content/themes/stump/lang/el.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/el.po +319 -0
- data/lib/wp/wp-content/themes/stump/lang/es_ES.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/es_ES.po +270 -0
- data/lib/wp/wp-content/themes/stump/lang/et.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/et.po +262 -0
- data/lib/wp/wp-content/themes/stump/lang/fa_IR.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/fa_IR.po +273 -0
- data/lib/wp/wp-content/themes/stump/lang/fi_FI.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/fi_FI.po +367 -0
- data/lib/wp/wp-content/themes/stump/lang/fr_FR.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/fr_FR.po +336 -0
- data/lib/wp/wp-content/themes/stump/lang/he_IL.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/he_IL.po +336 -0
- data/lib/wp/wp-content/themes/stump/lang/hu_HU.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/hu_HU.po +271 -0
- data/lib/wp/wp-content/themes/stump/lang/id_ID.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/id_ID.po +278 -0
- data/lib/wp/wp-content/themes/stump/lang/it_IT.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/it_IT.po +269 -0
- data/lib/wp/wp-content/themes/stump/lang/ja.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/ja.po +267 -0
- data/lib/wp/wp-content/themes/stump/lang/ko_KR.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/ko_KR.po +282 -0
- data/lib/wp/wp-content/themes/stump/lang/mk_MK.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/mk_MK.po +297 -0
- data/lib/wp/wp-content/themes/stump/lang/ms_MY.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/ms_MY.po +342 -0
- data/lib/wp/wp-content/themes/stump/lang/nb_NO.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/nb_NO.po +517 -0
- data/lib/wp/wp-content/themes/stump/lang/nl_NL.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/nl_NL.po +261 -0
- data/lib/wp/wp-content/themes/stump/lang/nn_NO.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/nn_NO.po +517 -0
- data/lib/wp/wp-content/themes/stump/lang/pl_PL.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/pl_PL.po +283 -0
- data/lib/wp/wp-content/themes/stump/lang/pt_BR.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/pt_BR.po +394 -0
- data/lib/wp/wp-content/themes/stump/lang/ro_RO.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/ro_RO.po +271 -0
- data/lib/wp/wp-content/themes/stump/lang/roots.pot +244 -0
- data/lib/wp/wp-content/themes/stump/lang/ru_RU.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/ru_RU.po +255 -0
- data/lib/wp/wp-content/themes/stump/lang/sk_SK.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/sk_SK.po +267 -0
- data/lib/wp/wp-content/themes/stump/lang/sr_RS.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/sr_RS.pot +261 -0
- data/lib/wp/wp-content/themes/stump/lang/sv_SE.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/sv_SE.po +323 -0
- data/lib/wp/wp-content/themes/stump/lang/tr_TR.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/tr_TR.po +405 -0
- data/lib/wp/wp-content/themes/stump/lang/vi_VN.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/vi_VN.po +516 -0
- data/lib/wp/wp-content/themes/stump/lang/zh_CN.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/zh_CN.po +329 -0
- data/lib/wp/wp-content/themes/stump/lang/zh_TW.mo +0 -0
- data/lib/wp/wp-content/themes/stump/lang/zh_TW.po +261 -0
- data/lib/wp/wp-content/themes/stump/lib/activation.php +215 -0
- data/lib/wp/wp-content/themes/stump/lib/cleanup.php +261 -0
- data/lib/wp/wp-content/themes/stump/lib/comments.php +52 -0
- data/lib/wp/wp-content/themes/stump/lib/config.php +79 -0
- data/lib/wp/wp-content/themes/stump/lib/custom.php +4 -0
- data/lib/wp/wp-content/themes/stump/lib/gallery.php +130 -0
- data/lib/wp/wp-content/themes/stump/lib/init.php +25 -0
- data/lib/wp/wp-content/themes/stump/lib/nav.php +93 -0
- data/lib/wp/wp-content/themes/stump/lib/relative-urls.php +50 -0
- data/lib/wp/wp-content/themes/stump/lib/scripts.php +67 -0
- data/lib/wp/wp-content/themes/stump/lib/sidebar.php +43 -0
- data/lib/wp/wp-content/themes/stump/lib/titles.php +37 -0
- data/lib/wp/wp-content/themes/stump/lib/utils.php +14 -0
- data/lib/wp/wp-content/themes/stump/lib/widgets.php +133 -0
- data/lib/wp/wp-content/themes/stump/lib/wrapper.php +49 -0
- data/lib/wp/wp-content/themes/stump/package.json +32 -0
- data/lib/wp/wp-content/themes/stump/page.php +2 -0
- data/lib/wp/wp-content/themes/stump/screenshot.png +0 -0
- data/lib/wp/wp-content/themes/stump/single.php +1 -0
- data/lib/wp/wp-content/themes/stump/style.css +11 -0
- data/lib/wp/wp-content/themes/stump/template-custom.php +8 -0
- data/lib/wp/wp-content/themes/stump/templates/comment.php +14 -0
- data/lib/wp/wp-content/themes/stump/templates/comments.php +80 -0
- data/lib/wp/wp-content/themes/stump/templates/content-page.php +4 -0
- data/lib/wp/wp-content/themes/stump/templates/content-single.php +15 -0
- data/lib/wp/wp-content/themes/stump/templates/content.php +9 -0
- data/lib/wp/wp-content/themes/stump/templates/entry-meta.php +2 -0
- data/lib/wp/wp-content/themes/stump/templates/footer.php +8 -0
- data/lib/wp/wp-content/themes/stump/templates/head.php +12 -0
- data/lib/wp/wp-content/themes/stump/templates/header-top-navbar.php +21 -0
- data/lib/wp/wp-content/themes/stump/templates/header.php +14 -0
- data/lib/wp/wp-content/themes/stump/templates/page-header.php +5 -0
- data/lib/wp/wp-content/themes/stump/templates/searchform.php +9 -0
- data/lib/wp/wp-content/themes/stump/templates/sidebar.php +1 -0
- data/lib/wp/wp-content/themes/twentyfourteen/404.php +32 -0
- data/lib/wp/wp-content/themes/twentyfourteen/archive.php +74 -0
- data/lib/wp/wp-content/themes/twentyfourteen/author.php +74 -0
- data/lib/wp/wp-content/themes/twentyfourteen/category.php +58 -0
- data/lib/wp/wp-content/themes/twentyfourteen/comments.php +66 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-aside.php +57 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-audio.php +57 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-featured-post.php +34 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-gallery.php +57 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-image.php +57 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-link.php +57 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-none.php +31 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-page.php +31 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-quote.php +57 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content-video.php +57 -0
- data/lib/wp/wp-content/themes/twentyfourteen/content.php +66 -0
- data/lib/wp/wp-content/themes/twentyfourteen/css/editor-style.css +717 -0
- data/lib/wp/wp-content/themes/twentyfourteen/css/ie.css +1335 -0
- data/lib/wp/wp-content/themes/twentyfourteen/featured-content.php +39 -0
- data/lib/wp/wp-content/themes/twentyfourteen/footer.php +28 -0
- data/lib/wp/wp-content/themes/twentyfourteen/functions.php +519 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/COPYING.txt +9 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/Genericons-Regular.otf +0 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/LICENSE.txt +339 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/README.txt +123 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/example.html +464 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.eot +0 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.svg +135 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.ttf +0 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.woff +0 -0
- data/lib/wp/wp-content/themes/twentyfourteen/genericons/genericons.css +197 -0
- data/lib/wp/wp-content/themes/twentyfourteen/header.php +65 -0
- data/lib/wp/wp-content/themes/twentyfourteen/image.php +79 -0
- data/lib/wp/wp-content/themes/twentyfourteen/images/pattern-dark.svg +16 -0
- data/lib/wp/wp-content/themes/twentyfourteen/images/pattern-light.svg +6 -0
- data/lib/wp/wp-content/themes/twentyfourteen/inc/back-compat.php +63 -0
- data/lib/wp/wp-content/themes/twentyfourteen/inc/custom-header.php +147 -0
- data/lib/wp/wp-content/themes/twentyfourteen/inc/customizer.php +114 -0
- data/lib/wp/wp-content/themes/twentyfourteen/inc/featured-content.php +531 -0
- data/lib/wp/wp-content/themes/twentyfourteen/inc/template-tags.php +203 -0
- data/lib/wp/wp-content/themes/twentyfourteen/inc/widgets.php +269 -0
- data/lib/wp/wp-content/themes/twentyfourteen/index.php +61 -0
- data/lib/wp/wp-content/themes/twentyfourteen/js/customizer.js +38 -0
- data/lib/wp/wp-content/themes/twentyfourteen/js/featured-content-admin.js +9 -0
- data/lib/wp/wp-content/themes/twentyfourteen/js/functions.js +134 -0
- data/lib/wp/wp-content/themes/twentyfourteen/js/html5.js +8 -0
- data/lib/wp/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js +21 -0
- data/lib/wp/wp-content/themes/twentyfourteen/js/slider.js +598 -0
- data/lib/wp/wp-content/themes/twentyfourteen/languages/twentyfourteen.pot +467 -0
- data/lib/wp/wp-content/themes/twentyfourteen/page-templates/contributors.php +52 -0
- data/lib/wp/wp-content/themes/twentyfourteen/page-templates/full-width.php +42 -0
- data/lib/wp/wp-content/themes/twentyfourteen/page.php +48 -0
- data/lib/wp/wp-content/themes/twentyfourteen/rtl.css +854 -0
- data/lib/wp/wp-content/themes/twentyfourteen/screenshot.png +0 -0
- data/lib/wp/wp-content/themes/twentyfourteen/search.php +49 -0
- data/lib/wp/wp-content/themes/twentyfourteen/sidebar-content.php +16 -0
- data/lib/wp/wp-content/themes/twentyfourteen/sidebar-footer.php +19 -0
- data/lib/wp/wp-content/themes/twentyfourteen/sidebar.php +29 -0
- data/lib/wp/wp-content/themes/twentyfourteen/single.php +40 -0
- data/lib/wp/wp-content/themes/twentyfourteen/style.css +4321 -0
- data/lib/wp/wp-content/themes/twentyfourteen/tag.php +60 -0
- data/lib/wp/wp-content/themes/twentyfourteen/taxonomy-post_format.php +85 -0
- data/lib/wp/wp-cron.php +115 -0
- data/lib/wp/wp-includes/ID3/getid3.lib.php +1376 -0
- data/lib/wp/wp-includes/ID3/getid3.php +1796 -0
- data/lib/wp/wp-includes/ID3/license.commercial.txt +27 -0
- data/lib/wp/wp-includes/ID3/license.txt +29 -0
- data/lib/wp/wp-includes/ID3/module.audio-video.asf.php +2013 -0
- data/lib/wp/wp-includes/ID3/module.audio-video.flv.php +745 -0
- data/lib/wp/wp-includes/ID3/module.audio-video.matroska.php +1751 -0
- data/lib/wp/wp-includes/ID3/module.audio-video.quicktime.php +2246 -0
- data/lib/wp/wp-includes/ID3/module.audio-video.riff.php +2586 -0
- data/lib/wp/wp-includes/ID3/module.audio.ac3.php +474 -0
- data/lib/wp/wp-includes/ID3/module.audio.dts.php +291 -0
- data/lib/wp/wp-includes/ID3/module.audio.flac.php +443 -0
- data/lib/wp/wp-includes/ID3/module.audio.mp3.php +2012 -0
- data/lib/wp/wp-includes/ID3/module.audio.ogg.php +756 -0
- data/lib/wp/wp-includes/ID3/module.tag.apetag.php +371 -0
- data/lib/wp/wp-includes/ID3/module.tag.id3v1.php +360 -0
- data/lib/wp/wp-includes/ID3/module.tag.id3v2.php +3424 -0
- data/lib/wp/wp-includes/ID3/module.tag.lyrics3.php +294 -0
- data/lib/wp/wp-includes/ID3/readme.txt +604 -0
- data/lib/wp/wp-includes/SimplePie/Author.php +157 -0
- data/lib/wp/wp-includes/SimplePie/Cache.php +133 -0
- data/lib/wp/wp-includes/SimplePie/Cache/Base.php +114 -0
- data/lib/wp/wp-includes/SimplePie/Cache/DB.php +137 -0
- data/lib/wp/wp-includes/SimplePie/Cache/File.php +173 -0
- data/lib/wp/wp-includes/SimplePie/Cache/Memcache.php +183 -0
- data/lib/wp/wp-includes/SimplePie/Cache/MySQL.php +438 -0
- data/lib/wp/wp-includes/SimplePie/Caption.php +210 -0
- data/lib/wp/wp-includes/SimplePie/Category.php +157 -0
- data/lib/wp/wp-includes/SimplePie/Content/Type/Sniffer.php +332 -0
- data/lib/wp/wp-includes/SimplePie/Copyright.php +130 -0
- data/lib/wp/wp-includes/SimplePie/Core.php +57 -0
- data/lib/wp/wp-includes/SimplePie/Credit.php +156 -0
- data/lib/wp/wp-includes/SimplePie/Decode/HTML/Entities.php +617 -0
- data/lib/wp/wp-includes/SimplePie/Enclosure.php +1380 -0
- data/lib/wp/wp-includes/SimplePie/Exception.php +52 -0
- data/lib/wp/wp-includes/SimplePie/File.php +292 -0
- data/lib/wp/wp-includes/SimplePie/HTTP/Parser.php +500 -0
- data/lib/wp/wp-includes/SimplePie/IRI.php +1238 -0
- data/lib/wp/wp-includes/SimplePie/Item.php +2964 -0
- data/lib/wp/wp-includes/SimplePie/Locator.php +372 -0
- data/lib/wp/wp-includes/SimplePie/Misc.php +2247 -0
- data/lib/wp/wp-includes/SimplePie/Net/IPv6.php +276 -0
- data/lib/wp/wp-includes/SimplePie/Parse/Date.php +983 -0
- data/lib/wp/wp-includes/SimplePie/Parser.php +407 -0
- data/lib/wp/wp-includes/SimplePie/Rating.php +129 -0
- data/lib/wp/wp-includes/SimplePie/Registry.php +225 -0
- data/lib/wp/wp-includes/SimplePie/Restriction.php +155 -0
- data/lib/wp/wp-includes/SimplePie/Sanitize.php +554 -0
- data/lib/wp/wp-includes/SimplePie/Source.php +611 -0
- data/lib/wp/wp-includes/SimplePie/XML/Declaration/Parser.php +362 -0
- data/lib/wp/wp-includes/SimplePie/gzdecode.php +371 -0
- data/lib/wp/wp-includes/Text/Diff.php +450 -0
- data/lib/wp/wp-includes/Text/Diff/Engine/native.php +436 -0
- data/lib/wp/wp-includes/Text/Diff/Engine/shell.php +162 -0
- data/lib/wp/wp-includes/Text/Diff/Engine/string.php +248 -0
- data/lib/wp/wp-includes/Text/Diff/Engine/xdiff.php +64 -0
- data/lib/wp/wp-includes/Text/Diff/Renderer.php +235 -0
- data/lib/wp/wp-includes/Text/Diff/Renderer/inline.php +206 -0
- data/lib/wp/wp-includes/admin-bar.php +870 -0
- data/lib/wp/wp-includes/atomlib.php +352 -0
- data/lib/wp/wp-includes/author-template.php +471 -0
- data/lib/wp/wp-includes/bookmark-template.php +298 -0
- data/lib/wp/wp-includes/bookmark.php +416 -0
- data/lib/wp/wp-includes/cache.php +704 -0
- data/lib/wp/wp-includes/canonical.php +586 -0
- data/lib/wp/wp-includes/capabilities.php +1539 -0
- data/lib/wp/wp-includes/category-template.php +1407 -0
- data/lib/wp/wp-includes/category.php +343 -0
- data/lib/wp/wp-includes/certificates/ca-bundle.crt +3785 -0
- data/lib/wp/wp-includes/class-IXR.php +1100 -0
- data/lib/wp/wp-includes/class-feed.php +140 -0
- data/lib/wp/wp-includes/class-http.php +2245 -0
- data/lib/wp/wp-includes/class-json.php +936 -0
- data/lib/wp/wp-includes/class-oembed.php +579 -0
- data/lib/wp/wp-includes/class-phpass.php +260 -0
- data/lib/wp/wp-includes/class-phpmailer.php +3265 -0
- data/lib/wp/wp-includes/class-pop3.php +652 -0
- data/lib/wp/wp-includes/class-simplepie.php +3119 -0
- data/lib/wp/wp-includes/class-smtp.php +943 -0
- data/lib/wp/wp-includes/class-snoopy.php +1256 -0
- data/lib/wp/wp-includes/class-wp-admin-bar.php +517 -0
- data/lib/wp/wp-includes/class-wp-ajax-response.php +199 -0
- data/lib/wp/wp-includes/class-wp-customize-control.php +1124 -0
- data/lib/wp/wp-includes/class-wp-customize-manager.php +1272 -0
- data/lib/wp/wp-includes/class-wp-customize-panel.php +200 -0
- data/lib/wp/wp-includes/class-wp-customize-section.php +196 -0
- data/lib/wp/wp-includes/class-wp-customize-setting.php +554 -0
- data/lib/wp/wp-includes/class-wp-customize-widgets.php +1556 -0
- data/lib/wp/wp-includes/class-wp-editor.php +1435 -0
- data/lib/wp/wp-includes/class-wp-embed.php +373 -0
- data/lib/wp/wp-includes/class-wp-error.php +276 -0
- data/lib/wp/wp-includes/class-wp-http-ixr-client.php +97 -0
- data/lib/wp/wp-includes/class-wp-image-editor-gd.php +459 -0
- data/lib/wp/wp-includes/class-wp-image-editor-imagick.php +512 -0
- data/lib/wp/wp-includes/class-wp-image-editor.php +475 -0
- data/lib/wp/wp-includes/class-wp-theme.php +1235 -0
- data/lib/wp/wp-includes/class-wp-walker.php +471 -0
- data/lib/wp/wp-includes/class-wp-xmlrpc-server.php +5984 -0
- data/lib/wp/wp-includes/class-wp.php +782 -0
- data/lib/wp/wp-includes/class.wp-dependencies.php +509 -0
- data/lib/wp/wp-includes/class.wp-scripts.php +247 -0
- data/lib/wp/wp-includes/class.wp-styles.php +210 -0
- data/lib/wp/wp-includes/comment-template.php +2286 -0
- data/lib/wp/wp-includes/comment.php +2606 -0
- data/lib/wp/wp-includes/compat.php +125 -0
- data/lib/wp/wp-includes/cron.php +469 -0
- data/lib/wp/wp-includes/css/admin-bar-rtl.css +1099 -0
- data/lib/wp/wp-includes/css/admin-bar-rtl.min.css +1 -0
- data/lib/wp/wp-includes/css/admin-bar.css +1099 -0
- data/lib/wp/wp-includes/css/admin-bar.min.css +1 -0
- data/lib/wp/wp-includes/css/buttons-rtl.css +364 -0
- data/lib/wp/wp-includes/css/buttons-rtl.min.css +1 -0
- data/lib/wp/wp-includes/css/buttons.css +364 -0
- data/lib/wp/wp-includes/css/buttons.min.css +1 -0
- data/lib/wp/wp-includes/css/dashicons.css +893 -0
- data/lib/wp/wp-includes/css/dashicons.min.css +1 -0
- data/lib/wp/wp-includes/css/editor-rtl.css +1993 -0
- data/lib/wp/wp-includes/css/editor-rtl.min.css +1 -0
- data/lib/wp/wp-includes/css/editor.css +1993 -0
- data/lib/wp/wp-includes/css/editor.min.css +1 -0
- data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.css +343 -0
- data/lib/wp/wp-includes/css/jquery-ui-dialog-rtl.min.css +19 -0
- data/lib/wp/wp-includes/css/jquery-ui-dialog.css +343 -0
- data/lib/wp/wp-includes/css/jquery-ui-dialog.min.css +19 -0
- data/lib/wp/wp-includes/css/media-views-rtl.css +2568 -0
- data/lib/wp/wp-includes/css/media-views-rtl.min.css +1 -0
- data/lib/wp/wp-includes/css/media-views.css +2568 -0
- data/lib/wp/wp-includes/css/media-views.min.css +1 -0
- data/lib/wp/wp-includes/css/wp-auth-check-rtl.css +100 -0
- data/lib/wp/wp-includes/css/wp-auth-check-rtl.min.css +1 -0
- data/lib/wp/wp-includes/css/wp-auth-check.css +100 -0
- data/lib/wp/wp-includes/css/wp-auth-check.min.css +1 -0
- data/lib/wp/wp-includes/css/wp-pointer-rtl.css +212 -0
- data/lib/wp/wp-includes/css/wp-pointer-rtl.min.css +1 -0
- data/lib/wp/wp-includes/css/wp-pointer.css +212 -0
- data/lib/wp/wp-includes/css/wp-pointer.min.css +1 -0
- data/lib/wp/wp-includes/date.php +475 -0
- data/lib/wp/wp-includes/default-constants.php +323 -0
- data/lib/wp/wp-includes/default-filters.php +307 -0
- data/lib/wp/wp-includes/default-widgets.php +1423 -0
- data/lib/wp/wp-includes/deprecated.php +3501 -0
- data/lib/wp/wp-includes/feed-atom-comments.php +115 -0
- data/lib/wp/wp-includes/feed-atom.php +87 -0
- data/lib/wp/wp-includes/feed-rdf.php +81 -0
- data/lib/wp/wp-includes/feed-rss.php +46 -0
- data/lib/wp/wp-includes/feed-rss2-comments.php +97 -0
- data/lib/wp/wp-includes/feed-rss2.php +115 -0
- data/lib/wp/wp-includes/feed.php +659 -0
- data/lib/wp/wp-includes/fonts/dashicons.eot +0 -0
- data/lib/wp/wp-includes/fonts/dashicons.svg +250 -0
- data/lib/wp/wp-includes/fonts/dashicons.ttf +0 -0
- data/lib/wp/wp-includes/fonts/dashicons.woff +0 -0
- data/lib/wp/wp-includes/formatting.php +4006 -0
- data/lib/wp/wp-includes/functions.php +4631 -0
- data/lib/wp/wp-includes/functions.wp-scripts.php +258 -0
- data/lib/wp/wp-includes/functions.wp-styles.php +245 -0
- data/lib/wp/wp-includes/general-template.php +2982 -0
- data/lib/wp/wp-includes/http.php +551 -0
- data/lib/wp/wp-includes/images/admin-bar-sprite-2x.png +0 -0
- data/lib/wp/wp-includes/images/admin-bar-sprite.png +0 -0
- data/lib/wp/wp-includes/images/arrow-pointer-blue-2x.png +0 -0
- data/lib/wp/wp-includes/images/arrow-pointer-blue.png +0 -0
- data/lib/wp/wp-includes/images/blank.gif +0 -0
- data/lib/wp/wp-includes/images/crystal/archive.png +0 -0
- data/lib/wp/wp-includes/images/crystal/audio.png +0 -0
- data/lib/wp/wp-includes/images/crystal/code.png +0 -0
- data/lib/wp/wp-includes/images/crystal/default.png +0 -0
- data/lib/wp/wp-includes/images/crystal/document.png +0 -0
- data/lib/wp/wp-includes/images/crystal/interactive.png +0 -0
- data/lib/wp/wp-includes/images/crystal/license.txt +9 -0
- data/lib/wp/wp-includes/images/crystal/spreadsheet.png +0 -0
- data/lib/wp/wp-includes/images/crystal/text.png +0 -0
- data/lib/wp/wp-includes/images/crystal/video.png +0 -0
- data/lib/wp/wp-includes/images/down_arrow-2x.gif +0 -0
- data/lib/wp/wp-includes/images/down_arrow.gif +0 -0
- data/lib/wp/wp-includes/images/icon-pointer-flag-2x.png +0 -0
- data/lib/wp/wp-includes/images/icon-pointer-flag.png +0 -0
- data/lib/wp/wp-includes/images/media/archive.png +0 -0
- data/lib/wp/wp-includes/images/media/audio.png +0 -0
- data/lib/wp/wp-includes/images/media/code.png +0 -0
- data/lib/wp/wp-includes/images/media/default.png +0 -0
- data/lib/wp/wp-includes/images/media/document.png +0 -0
- data/lib/wp/wp-includes/images/media/interactive.png +0 -0
- data/lib/wp/wp-includes/images/media/spreadsheet.png +0 -0
- data/lib/wp/wp-includes/images/media/text.png +0 -0
- data/lib/wp/wp-includes/images/media/video.png +0 -0
- data/lib/wp/wp-includes/images/rss-2x.png +0 -0
- data/lib/wp/wp-includes/images/rss.png +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_arrow.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_biggrin.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_confused.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_cool.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_cry.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_eek.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_evil.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_exclaim.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_idea.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_lol.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_mad.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_mrgreen.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_neutral.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_question.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_razz.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_redface.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_rolleyes.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_sad.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_smile.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_surprised.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_twisted.gif +0 -0
- data/lib/wp/wp-includes/images/smilies/icon_wink.gif +0 -0
- data/lib/wp/wp-includes/images/spinner-2x.gif +0 -0
- data/lib/wp/wp-includes/images/spinner.gif +0 -0
- data/lib/wp/wp-includes/images/toggle-arrow-2x.png +0 -0
- data/lib/wp/wp-includes/images/toggle-arrow.png +0 -0
- data/lib/wp/wp-includes/images/uploader-icons-2x.png +0 -0
- data/lib/wp/wp-includes/images/uploader-icons.png +0 -0
- data/lib/wp/wp-includes/images/wlw/wp-comments.png +0 -0
- data/lib/wp/wp-includes/images/wlw/wp-icon.png +0 -0
- data/lib/wp/wp-includes/images/wlw/wp-watermark.png +0 -0
- data/lib/wp/wp-includes/images/wpicons-2x.png +0 -0
- data/lib/wp/wp-includes/images/wpicons.png +0 -0
- data/lib/wp/wp-includes/images/wpspin-2x.gif +0 -0
- data/lib/wp/wp-includes/images/wpspin.gif +0 -0
- data/lib/wp/wp-includes/images/xit-2x.gif +0 -0
- data/lib/wp/wp-includes/images/xit.gif +0 -0
- data/lib/wp/wp-includes/js/admin-bar.js +365 -0
- data/lib/wp/wp-includes/js/admin-bar.min.js +1 -0
- data/lib/wp/wp-includes/js/autosave.js +589 -0
- data/lib/wp/wp-includes/js/autosave.min.js +1 -0
- data/lib/wp/wp-includes/js/backbone.min.js +1 -0
- data/lib/wp/wp-includes/js/colorpicker.js +707 -0
- data/lib/wp/wp-includes/js/colorpicker.min.js +1 -0
- data/lib/wp/wp-includes/js/comment-reply.js +47 -0
- data/lib/wp/wp-includes/js/comment-reply.min.js +1 -0
- data/lib/wp/wp-includes/js/crop/cropper.css +165 -0
- data/lib/wp/wp-includes/js/crop/cropper.js +516 -0
- data/lib/wp/wp-includes/js/crop/marqueeHoriz.gif +0 -0
- data/lib/wp/wp-includes/js/crop/marqueeVert.gif +0 -0
- data/lib/wp/wp-includes/js/customize-base.js +617 -0
- data/lib/wp/wp-includes/js/customize-base.min.js +1 -0
- data/lib/wp/wp-includes/js/customize-loader.js +246 -0
- data/lib/wp/wp-includes/js/customize-loader.min.js +1 -0
- data/lib/wp/wp-includes/js/customize-models.js +247 -0
- data/lib/wp/wp-includes/js/customize-models.min.js +1 -0
- data/lib/wp/wp-includes/js/customize-preview-widgets.js +129 -0
- data/lib/wp/wp-includes/js/customize-preview-widgets.min.js +1 -0
- data/lib/wp/wp-includes/js/customize-preview.js +154 -0
- data/lib/wp/wp-includes/js/customize-preview.min.js +1 -0
- data/lib/wp/wp-includes/js/customize-views.js +231 -0
- data/lib/wp/wp-includes/js/customize-views.min.js +1 -0
- data/lib/wp/wp-includes/js/heartbeat.js +738 -0
- data/lib/wp/wp-includes/js/heartbeat.min.js +1 -0
- data/lib/wp/wp-includes/js/hoverIntent.js +115 -0
- data/lib/wp/wp-includes/js/hoverIntent.min.js +1 -0
- data/lib/wp/wp-includes/js/imgareaselect/border-anim-h.gif +0 -0
- data/lib/wp/wp-includes/js/imgareaselect/border-anim-v.gif +0 -0
- data/lib/wp/wp-includes/js/imgareaselect/imgareaselect.css +41 -0
- data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.js +1205 -0
- data/lib/wp/wp-includes/js/imgareaselect/jquery.imgareaselect.min.js +1 -0
- data/lib/wp/wp-includes/js/jcrop/Jcrop.gif +0 -0
- data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.css +29 -0
- data/lib/wp/wp-includes/js/jcrop/jquery.Jcrop.min.js +22 -0
- data/lib/wp/wp-includes/js/jquery/jquery-migrate.js +521 -0
- data/lib/wp/wp-includes/js/jquery/jquery-migrate.min.js +2 -0
- data/lib/wp/wp-includes/js/jquery/jquery.color.min.js +2 -0
- data/lib/wp/wp-includes/js/jquery/jquery.form.js +1193 -0
- data/lib/wp/wp-includes/js/jquery/jquery.form.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.js +134 -0
- data/lib/wp/wp-includes/js/jquery/jquery.hotkeys.min.js +1 -0
- data/lib/wp/wp-includes/js/jquery/jquery.js +5 -0
- data/lib/wp/wp-includes/js/jquery/jquery.masonry.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/jquery.query.js +11 -0
- data/lib/wp/wp-includes/js/jquery/jquery.schedule.js +36 -0
- data/lib/wp/wp-includes/js/jquery/jquery.serialize-object.js +31 -0
- data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.js +99 -0
- data/lib/wp/wp-includes/js/jquery/jquery.table-hotkeys.min.js +1 -0
- data/lib/wp/wp-includes/js/jquery/jquery.ui.touch-punch.js +11 -0
- data/lib/wp/wp-includes/js/jquery/suggest.js +316 -0
- data/lib/wp/wp-includes/js/jquery/suggest.min.js +1 -0
- data/lib/wp/wp-includes/js/jquery/ui/accordion.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/autocomplete.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/button.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/core.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/datepicker.min.js +12 -0
- data/lib/wp/wp-includes/js/jquery/ui/dialog.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/draggable.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/droppable.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-blind.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-bounce.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-clip.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-drop.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-explode.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-fade.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-fold.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-highlight.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-puff.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-pulsate.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-scale.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-shake.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-size.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-slide.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect-transfer.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/effect.min.js +21 -0
- data/lib/wp/wp-includes/js/jquery/ui/menu.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/mouse.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/position.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/progressbar.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/resizable.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/selectable.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/selectmenu.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/slider.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/sortable.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/spinner.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/tabs.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/tooltip.min.js +11 -0
- data/lib/wp/wp-includes/js/jquery/ui/widget.min.js +11 -0
- data/lib/wp/wp-includes/js/json2.js +480 -0
- data/lib/wp/wp-includes/js/json2.min.js +1 -0
- data/lib/wp/wp-includes/js/masonry.min.js +1 -0
- data/lib/wp/wp-includes/js/mce-view.js +829 -0
- data/lib/wp/wp-includes/js/mce-view.min.js +1 -0
- data/lib/wp/wp-includes/js/media-audiovideo.js +831 -0
- data/lib/wp/wp-includes/js/media-audiovideo.min.js +1 -0
- data/lib/wp/wp-includes/js/media-editor.js +1114 -0
- data/lib/wp/wp-includes/js/media-editor.min.js +1 -0
- data/lib/wp/wp-includes/js/media-grid.js +732 -0
- data/lib/wp/wp-includes/js/media-grid.min.js +1 -0
- data/lib/wp/wp-includes/js/media-models.js +1362 -0
- data/lib/wp/wp-includes/js/media-models.min.js +1 -0
- data/lib/wp/wp-includes/js/media-views.js +7484 -0
- data/lib/wp/wp-includes/js/media-views.min.js +3 -0
- data/lib/wp/wp-includes/js/mediaelement/background.png +0 -0
- data/lib/wp/wp-includes/js/mediaelement/bigplay.png +0 -0
- data/lib/wp/wp-includes/js/mediaelement/bigplay.svg +1 -0
- data/lib/wp/wp-includes/js/mediaelement/controls.png +0 -0
- data/lib/wp/wp-includes/js/mediaelement/controls.svg +1 -0
- data/lib/wp/wp-includes/js/mediaelement/flashmediaelement.swf +0 -0
- data/lib/wp/wp-includes/js/mediaelement/loading.gif +0 -0
- data/lib/wp/wp-includes/js/mediaelement/mediaelement-and-player.min.js +181 -0
- data/lib/wp/wp-includes/js/mediaelement/mediaelementplayer.min.css +1 -0
- data/lib/wp/wp-includes/js/mediaelement/silverlightmediaelement.xap +0 -0
- data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.css +274 -0
- data/lib/wp/wp-includes/js/mediaelement/wp-mediaelement.js +34 -0
- data/lib/wp/wp-includes/js/mediaelement/wp-playlist.js +175 -0
- data/lib/wp/wp-includes/js/plupload/handlers.js +488 -0
- data/lib/wp/wp-includes/js/plupload/handlers.min.js +1 -0
- data/lib/wp/wp-includes/js/plupload/license.txt +339 -0
- data/lib/wp/wp-includes/js/plupload/plupload.flash.swf +0 -0
- data/lib/wp/wp-includes/js/plupload/plupload.full.min.js +28 -0
- data/lib/wp/wp-includes/js/plupload/plupload.silverlight.xap +0 -0
- data/lib/wp/wp-includes/js/plupload/wp-plupload.js +376 -0
- data/lib/wp/wp-includes/js/plupload/wp-plupload.min.js +1 -0
- data/lib/wp/wp-includes/js/quicktags.js +652 -0
- data/lib/wp/wp-includes/js/quicktags.min.js +1 -0
- data/lib/wp/wp-includes/js/shortcode.js +356 -0
- data/lib/wp/wp-includes/js/shortcode.min.js +1 -0
- data/lib/wp/wp-includes/js/swfobject.js +4 -0
- data/lib/wp/wp-includes/js/swfupload/handlers.js +376 -0
- data/lib/wp/wp-includes/js/swfupload/handlers.min.js +1 -0
- data/lib/wp/wp-includes/js/swfupload/license.txt +32 -0
- data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js +53 -0
- data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.queue.js +98 -0
- data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.speed.js +342 -0
- data/lib/wp/wp-includes/js/swfupload/plugins/swfupload.swfobject.js +105 -0
- data/lib/wp/wp-includes/js/swfupload/swfupload.js +980 -0
- data/lib/wp/wp-includes/js/swfupload/swfupload.swf +0 -0
- data/lib/wp/wp-includes/js/thickbox/loadingAnimation.gif +0 -0
- data/lib/wp/wp-includes/js/thickbox/macFFBgHack.png +0 -0
- data/lib/wp/wp-includes/js/thickbox/thickbox.css +138 -0
- data/lib/wp/wp-includes/js/thickbox/thickbox.js +314 -0
- data/lib/wp/wp-includes/js/tinymce/langs/wp-langs-en.js +519 -0
- data/lib/wp/wp-includes/js/tinymce/license.txt +504 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.js +370 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/charmap/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.js +112 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/css/dialog.css +212 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.js +304 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.js +64 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/directionality/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.js +136 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.js +30 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/hr/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.js +450 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/image/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.js +786 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/lists/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/media/moxieplayer.swf +0 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.js +774 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/media/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.js +1553 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/paste/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.js +125 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.js +272 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.js +513 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js +207 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpautoresize/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js +92 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js +1035 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpeditimage/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.js +78 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpfullscreen/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.js +130 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpgallery/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.js +63 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wplink/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.js +694 -0
- data/lib/wp/wp-includes/js/tinymce/plugins/wpview/plugin.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/content.min.css +1 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +62 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.svg +63 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/object.gif +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/lib/wp/wp-includes/js/tinymce/skins/lightgray/skin.min.css +1 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/audio.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/embedded.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery-2x.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/gallery.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more-2x.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/more.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak-2x.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/pagebreak.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-audio.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/playlist-video.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/images/video.png +0 -0
- data/lib/wp/wp-includes/js/tinymce/skins/wordpress/wp-content.css +618 -0
- data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.js +617 -0
- data/lib/wp/wp-includes/js/tinymce/themes/modern/theme.min.js +1 -0
- data/lib/wp/wp-includes/js/tinymce/tiny_mce_popup.js +539 -0
- data/lib/wp/wp-includes/js/tinymce/tinymce.min.js +11 -0
- data/lib/wp/wp-includes/js/tinymce/utils/editable_selects.js +70 -0
- data/lib/wp/wp-includes/js/tinymce/utils/form_utils.js +210 -0
- data/lib/wp/wp-includes/js/tinymce/utils/mctabs.js +164 -0
- data/lib/wp/wp-includes/js/tinymce/utils/validate.js +252 -0
- data/lib/wp/wp-includes/js/tinymce/wp-mce-help.php +145 -0
- data/lib/wp/wp-includes/js/tinymce/wp-tinymce.js.gz +0 -0
- data/lib/wp/wp-includes/js/tinymce/wp-tinymce.php +39 -0
- data/lib/wp/wp-includes/js/tw-sack.js +193 -0
- data/lib/wp/wp-includes/js/tw-sack.min.js +1 -0
- data/lib/wp/wp-includes/js/underscore.min.js +1 -0
- data/lib/wp/wp-includes/js/utils.js +197 -0
- data/lib/wp/wp-includes/js/utils.min.js +1 -0
- data/lib/wp/wp-includes/js/wp-ajax-response.js +64 -0
- data/lib/wp/wp-includes/js/wp-ajax-response.min.js +1 -0
- data/lib/wp/wp-includes/js/wp-auth-check.js +112 -0
- data/lib/wp/wp-includes/js/wp-auth-check.min.js +1 -0
- data/lib/wp/wp-includes/js/wp-backbone.js +386 -0
- data/lib/wp/wp-includes/js/wp-backbone.min.js +1 -0
- data/lib/wp/wp-includes/js/wp-list-revisions.js +24 -0
- data/lib/wp/wp-includes/js/wp-list-revisions.min.js +1 -0
- data/lib/wp/wp-includes/js/wp-lists.js +469 -0
- data/lib/wp/wp-includes/js/wp-lists.min.js +1 -0
- data/lib/wp/wp-includes/js/wp-pointer.js +282 -0
- data/lib/wp/wp-includes/js/wp-pointer.min.js +1 -0
- data/lib/wp/wp-includes/js/wp-util.js +106 -0
- data/lib/wp/wp-includes/js/wp-util.min.js +1 -0
- data/lib/wp/wp-includes/js/wpdialog.js +19 -0
- data/lib/wp/wp-includes/js/wpdialog.min.js +1 -0
- data/lib/wp/wp-includes/js/wplink.js +615 -0
- data/lib/wp/wp-includes/js/wplink.min.js +1 -0
- data/lib/wp/wp-includes/js/zxcvbn-async.js +18 -0
- data/lib/wp/wp-includes/js/zxcvbn-async.min.js +1 -0
- data/lib/wp/wp-includes/js/zxcvbn.min.js +47 -0
- data/lib/wp/wp-includes/kses.php +1526 -0
- data/lib/wp/wp-includes/l10n.php +908 -0
- data/lib/wp/wp-includes/link-template.php +3141 -0
- data/lib/wp/wp-includes/load.php +828 -0
- data/lib/wp/wp-includes/locale.php +368 -0
- data/lib/wp/wp-includes/media-template.php +1235 -0
- data/lib/wp/wp-includes/media.php +3329 -0
- data/lib/wp/wp-includes/meta.php +1221 -0
- data/lib/wp/wp-includes/ms-blogs.php +939 -0
- data/lib/wp/wp-includes/ms-default-constants.php +153 -0
- data/lib/wp/wp-includes/ms-default-filters.php +82 -0
- data/lib/wp/wp-includes/ms-deprecated.php +347 -0
- data/lib/wp/wp-includes/ms-files.php +82 -0
- data/lib/wp/wp-includes/ms-functions.php +2476 -0
- data/lib/wp/wp-includes/ms-load.php +458 -0
- data/lib/wp/wp-includes/ms-settings.php +213 -0
- data/lib/wp/wp-includes/nav-menu-template.php +678 -0
- data/lib/wp/wp-includes/nav-menu.php +895 -0
- data/lib/wp/wp-includes/option.php +1440 -0
- data/lib/wp/wp-includes/pluggable-deprecated.php +192 -0
- data/lib/wp/wp-includes/pluggable.php +2283 -0
- data/lib/wp/wp-includes/plugin.php +920 -0
- data/lib/wp/wp-includes/pomo/entry.php +78 -0
- data/lib/wp/wp-includes/pomo/mo.php +262 -0
- data/lib/wp/wp-includes/pomo/po.php +384 -0
- data/lib/wp/wp-includes/pomo/streams.php +209 -0
- data/lib/wp/wp-includes/pomo/translations.php +275 -0
- data/lib/wp/wp-includes/post-formats.php +243 -0
- data/lib/wp/wp-includes/post-template.php +1766 -0
- data/lib/wp/wp-includes/post-thumbnail-template.php +142 -0
- data/lib/wp/wp-includes/post.php +5842 -0
- data/lib/wp/wp-includes/query.php +4666 -0
- data/lib/wp/wp-includes/registration-functions.php +7 -0
- data/lib/wp/wp-includes/registration.php +7 -0
- data/lib/wp/wp-includes/revision.php +657 -0
- data/lib/wp/wp-includes/rewrite.php +2180 -0
- data/lib/wp/wp-includes/rss-functions.php +9 -0
- data/lib/wp/wp-includes/rss.php +936 -0
- data/lib/wp/wp-includes/script-loader.php +1045 -0
- data/lib/wp/wp-includes/session.php +430 -0
- data/lib/wp/wp-includes/shortcodes.php +410 -0
- data/lib/wp/wp-includes/taxonomy.php +4006 -0
- data/lib/wp/wp-includes/template-loader.php +76 -0
- data/lib/wp/wp-includes/template.php +505 -0
- data/lib/wp/wp-includes/theme-compat/comments-popup.php +128 -0
- data/lib/wp/wp-includes/theme-compat/comments.php +101 -0
- data/lib/wp/wp-includes/theme-compat/footer.php +30 -0
- data/lib/wp/wp-includes/theme-compat/header.php +49 -0
- data/lib/wp/wp-includes/theme-compat/sidebar.php +83 -0
- data/lib/wp/wp-includes/theme.php +2014 -0
- data/lib/wp/wp-includes/update.php +674 -0
- data/lib/wp/wp-includes/user.php +2292 -0
- data/lib/wp/wp-includes/vars.php +144 -0
- data/lib/wp/wp-includes/version.php +35 -0
- data/lib/wp/wp-includes/widgets.php +1514 -0
- data/lib/wp/wp-includes/wlwmanifest.xml +43 -0
- data/lib/wp/wp-includes/wp-db.php +2190 -0
- data/lib/wp/wp-includes/wp-diff.php +523 -0
- data/lib/wp/wp-links-opml.php +80 -0
- data/lib/wp/wp-load.php +73 -0
- data/lib/wp/wp-login.php +952 -0
- data/lib/wp/wp-mail.php +260 -0
- data/lib/wp/wp-settings.php +374 -0
- data/lib/wp/wp-signup.php +749 -0
- data/lib/wp/wp-trackback.php +127 -0
- data/lib/wp/xmlrpc.php +101 -0
- data/stump-cli.gemspec +26 -0
- metadata +1332 -4
@@ -0,0 +1,206 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* WordPress Administration Importer API.
|
4
|
+
*
|
5
|
+
* @package WordPress
|
6
|
+
* @subpackage Administration
|
7
|
+
*/
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Retrieve list of importers.
|
11
|
+
*
|
12
|
+
* @since 2.0.0
|
13
|
+
*
|
14
|
+
* @return array
|
15
|
+
*/
|
16
|
+
function get_importers() {
|
17
|
+
global $wp_importers;
|
18
|
+
if ( is_array( $wp_importers ) ) {
|
19
|
+
uasort( $wp_importers, '_usort_by_first_member' );
|
20
|
+
}
|
21
|
+
return $wp_importers;
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Sorts a multidimensional array by first member of each top level member
|
26
|
+
*
|
27
|
+
* Used by uasort() as a callback, should not be used directly.
|
28
|
+
*
|
29
|
+
* @since 2.9.0
|
30
|
+
* @access private
|
31
|
+
*
|
32
|
+
* @param array $a
|
33
|
+
* @param array $b
|
34
|
+
* @return int
|
35
|
+
*/
|
36
|
+
function _usort_by_first_member( $a, $b ) {
|
37
|
+
return strnatcasecmp( $a[0], $b[0] );
|
38
|
+
}
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Register importer for WordPress.
|
42
|
+
*
|
43
|
+
* @since 2.0.0
|
44
|
+
*
|
45
|
+
* @param string $id Importer tag. Used to uniquely identify importer.
|
46
|
+
* @param string $name Importer name and title.
|
47
|
+
* @param string $description Importer description.
|
48
|
+
* @param callback $callback Callback to run.
|
49
|
+
* @return WP_Error Returns WP_Error when $callback is WP_Error.
|
50
|
+
*/
|
51
|
+
function register_importer( $id, $name, $description, $callback ) {
|
52
|
+
global $wp_importers;
|
53
|
+
if ( is_wp_error( $callback ) )
|
54
|
+
return $callback;
|
55
|
+
$wp_importers[$id] = array ( $name, $description, $callback );
|
56
|
+
}
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Cleanup importer.
|
60
|
+
*
|
61
|
+
* Removes attachment based on ID.
|
62
|
+
*
|
63
|
+
* @since 2.0.0
|
64
|
+
*
|
65
|
+
* @param string $id Importer ID.
|
66
|
+
*/
|
67
|
+
function wp_import_cleanup( $id ) {
|
68
|
+
wp_delete_attachment( $id );
|
69
|
+
}
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Handle importer uploading and add attachment.
|
73
|
+
*
|
74
|
+
* @since 2.0.0
|
75
|
+
*
|
76
|
+
* @return array Uploaded file's details on success, error message on failure
|
77
|
+
*/
|
78
|
+
function wp_import_handle_upload() {
|
79
|
+
if ( !isset($_FILES['import']) ) {
|
80
|
+
$file['error'] = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' );
|
81
|
+
return $file;
|
82
|
+
}
|
83
|
+
|
84
|
+
$overrides = array( 'test_form' => false, 'test_type' => false );
|
85
|
+
$_FILES['import']['name'] .= '.txt';
|
86
|
+
$file = wp_handle_upload( $_FILES['import'], $overrides );
|
87
|
+
|
88
|
+
if ( isset( $file['error'] ) )
|
89
|
+
return $file;
|
90
|
+
|
91
|
+
$url = $file['url'];
|
92
|
+
$type = $file['type'];
|
93
|
+
$file = $file['file'];
|
94
|
+
$filename = basename( $file );
|
95
|
+
|
96
|
+
// Construct the object array
|
97
|
+
$object = array( 'post_title' => $filename,
|
98
|
+
'post_content' => $url,
|
99
|
+
'post_mime_type' => $type,
|
100
|
+
'guid' => $url,
|
101
|
+
'context' => 'import',
|
102
|
+
'post_status' => 'private'
|
103
|
+
);
|
104
|
+
|
105
|
+
// Save the data
|
106
|
+
$id = wp_insert_attachment( $object, $file );
|
107
|
+
|
108
|
+
/*
|
109
|
+
* Schedule a cleanup for one day from now in case of failed
|
110
|
+
* import or missing wp_import_cleanup() call.
|
111
|
+
*/
|
112
|
+
wp_schedule_single_event( time() + DAY_IN_SECONDS, 'importer_scheduled_cleanup', array( $id ) );
|
113
|
+
|
114
|
+
return array( 'file' => $file, 'id' => $id );
|
115
|
+
}
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Returns a list from WordPress.org of popular importer plugins.
|
119
|
+
*
|
120
|
+
* @since 3.5.0
|
121
|
+
*
|
122
|
+
* @return array Importers with metadata for each.
|
123
|
+
*/
|
124
|
+
function wp_get_popular_importers() {
|
125
|
+
include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
|
126
|
+
|
127
|
+
$locale = get_locale();
|
128
|
+
$popular_importers = get_site_transient( 'popular_importers_' . $locale );
|
129
|
+
|
130
|
+
if ( ! $popular_importers ) {
|
131
|
+
$url = add_query_arg( 'locale', get_locale(), 'http://api.wordpress.org/core/importers/1.1/' );
|
132
|
+
$options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url() );
|
133
|
+
$response = wp_remote_get( $url, $options );
|
134
|
+
$popular_importers = json_decode( wp_remote_retrieve_body( $response ), true );
|
135
|
+
|
136
|
+
if ( is_array( $popular_importers ) )
|
137
|
+
set_site_transient( 'popular_importers_' . $locale, $popular_importers, 2 * DAY_IN_SECONDS );
|
138
|
+
else
|
139
|
+
$popular_importers = false;
|
140
|
+
}
|
141
|
+
|
142
|
+
if ( is_array( $popular_importers ) ) {
|
143
|
+
// If the data was received as translated, return it as-is.
|
144
|
+
if ( $popular_importers['translated'] )
|
145
|
+
return $popular_importers['importers'];
|
146
|
+
|
147
|
+
foreach ( $popular_importers['importers'] as &$importer ) {
|
148
|
+
$importer['description'] = translate( $importer['description'] );
|
149
|
+
if ( $importer['name'] != 'WordPress' )
|
150
|
+
$importer['name'] = translate( $importer['name'] );
|
151
|
+
}
|
152
|
+
return $popular_importers['importers'];
|
153
|
+
}
|
154
|
+
|
155
|
+
return array(
|
156
|
+
// slug => name, description, plugin slug, and register_importer() slug
|
157
|
+
'blogger' => array(
|
158
|
+
'name' => __( 'Blogger' ),
|
159
|
+
'description' => __( 'Install the Blogger importer to import posts, comments, and users from a Blogger blog.' ),
|
160
|
+
'plugin-slug' => 'blogger-importer',
|
161
|
+
'importer-id' => 'blogger',
|
162
|
+
),
|
163
|
+
'wpcat2tag' => array(
|
164
|
+
'name' => __( 'Categories and Tags Converter' ),
|
165
|
+
'description' => __( 'Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.' ),
|
166
|
+
'plugin-slug' => 'wpcat2tag-importer',
|
167
|
+
'importer-id' => 'wp-cat2tag',
|
168
|
+
),
|
169
|
+
'livejournal' => array(
|
170
|
+
'name' => __( 'LiveJournal' ),
|
171
|
+
'description' => __( 'Install the LiveJournal importer to import posts from LiveJournal using their API.' ),
|
172
|
+
'plugin-slug' => 'livejournal-importer',
|
173
|
+
'importer-id' => 'livejournal',
|
174
|
+
),
|
175
|
+
'movabletype' => array(
|
176
|
+
'name' => __( 'Movable Type and TypePad' ),
|
177
|
+
'description' => __( 'Install the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.' ),
|
178
|
+
'plugin-slug' => 'movabletype-importer',
|
179
|
+
'importer-id' => 'mt',
|
180
|
+
),
|
181
|
+
'opml' => array(
|
182
|
+
'name' => __( 'Blogroll' ),
|
183
|
+
'description' => __( 'Install the blogroll importer to import links in OPML format.' ),
|
184
|
+
'plugin-slug' => 'opml-importer',
|
185
|
+
'importer-id' => 'opml',
|
186
|
+
),
|
187
|
+
'rss' => array(
|
188
|
+
'name' => __( 'RSS' ),
|
189
|
+
'description' => __( 'Install the RSS importer to import posts from an RSS feed.' ),
|
190
|
+
'plugin-slug' => 'rss-importer',
|
191
|
+
'importer-id' => 'rss',
|
192
|
+
),
|
193
|
+
'tumblr' => array(
|
194
|
+
'name' => __( 'Tumblr' ),
|
195
|
+
'description' => __( 'Install the Tumblr importer to import posts & media from Tumblr using their API.' ),
|
196
|
+
'plugin-slug' => 'tumblr-importer',
|
197
|
+
'importer-id' => 'tumblr',
|
198
|
+
),
|
199
|
+
'wordpress' => array(
|
200
|
+
'name' => 'WordPress',
|
201
|
+
'description' => __( 'Install the WordPress importer to import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.' ),
|
202
|
+
'plugin-slug' => 'wordpress-importer',
|
203
|
+
'importer-id' => 'wordpress',
|
204
|
+
),
|
205
|
+
);
|
206
|
+
}
|
@@ -0,0 +1,113 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* Helper functions for displaying a list of items in an ajaxified HTML table.
|
4
|
+
*
|
5
|
+
* @package WordPress
|
6
|
+
* @subpackage List_Table
|
7
|
+
* @since 3.1.0
|
8
|
+
*/
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Fetch an instance of a WP_List_Table class.
|
12
|
+
*
|
13
|
+
* @access private
|
14
|
+
* @since 3.1.0
|
15
|
+
*
|
16
|
+
* @param string $class The type of the list table, which is the class name.
|
17
|
+
* @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
|
18
|
+
* @return object|bool Object on success, false if the class does not exist.
|
19
|
+
*/
|
20
|
+
function _get_list_table( $class, $args = array() ) {
|
21
|
+
$core_classes = array(
|
22
|
+
//Site Admin
|
23
|
+
'WP_Posts_List_Table' => 'posts',
|
24
|
+
'WP_Media_List_Table' => 'media',
|
25
|
+
'WP_Terms_List_Table' => 'terms',
|
26
|
+
'WP_Users_List_Table' => 'users',
|
27
|
+
'WP_Comments_List_Table' => 'comments',
|
28
|
+
'WP_Post_Comments_List_Table' => 'comments',
|
29
|
+
'WP_Links_List_Table' => 'links',
|
30
|
+
'WP_Plugin_Install_List_Table' => 'plugin-install',
|
31
|
+
'WP_Themes_List_Table' => 'themes',
|
32
|
+
'WP_Theme_Install_List_Table' => array( 'themes', 'theme-install' ),
|
33
|
+
'WP_Plugins_List_Table' => 'plugins',
|
34
|
+
// Network Admin
|
35
|
+
'WP_MS_Sites_List_Table' => 'ms-sites',
|
36
|
+
'WP_MS_Users_List_Table' => 'ms-users',
|
37
|
+
'WP_MS_Themes_List_Table' => 'ms-themes',
|
38
|
+
);
|
39
|
+
|
40
|
+
if ( isset( $core_classes[ $class ] ) ) {
|
41
|
+
foreach ( (array) $core_classes[ $class ] as $required )
|
42
|
+
require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
|
43
|
+
|
44
|
+
if ( isset( $args['screen'] ) )
|
45
|
+
$args['screen'] = convert_to_screen( $args['screen'] );
|
46
|
+
elseif ( isset( $GLOBALS['hook_suffix'] ) )
|
47
|
+
$args['screen'] = get_current_screen();
|
48
|
+
else
|
49
|
+
$args['screen'] = null;
|
50
|
+
|
51
|
+
return new $class( $args );
|
52
|
+
}
|
53
|
+
|
54
|
+
return false;
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Register column headers for a particular screen.
|
59
|
+
*
|
60
|
+
* @since 2.7.0
|
61
|
+
*
|
62
|
+
* @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
|
63
|
+
* @param array $columns An array of columns with column IDs as the keys and translated column names as the values
|
64
|
+
* @see get_column_headers(), print_column_headers(), get_hidden_columns()
|
65
|
+
*/
|
66
|
+
function register_column_headers($screen, $columns) {
|
67
|
+
$wp_list_table = new _WP_List_Table_Compat($screen, $columns);
|
68
|
+
}
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Prints column headers for a particular screen.
|
72
|
+
*
|
73
|
+
* @since 2.7.0
|
74
|
+
*/
|
75
|
+
function print_column_headers($screen, $id = true) {
|
76
|
+
$wp_list_table = new _WP_List_Table_Compat($screen);
|
77
|
+
|
78
|
+
$wp_list_table->print_column_headers($id);
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Helper class to be used only by back compat functions
|
83
|
+
*
|
84
|
+
* @since 3.1.0
|
85
|
+
*/
|
86
|
+
class _WP_List_Table_Compat extends WP_List_Table {
|
87
|
+
public $_screen;
|
88
|
+
public $_columns;
|
89
|
+
|
90
|
+
public function __construct( $screen, $columns = array() ) {
|
91
|
+
if ( is_string( $screen ) )
|
92
|
+
$screen = convert_to_screen( $screen );
|
93
|
+
|
94
|
+
$this->_screen = $screen;
|
95
|
+
|
96
|
+
if ( !empty( $columns ) ) {
|
97
|
+
$this->_columns = $columns;
|
98
|
+
add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
protected function get_column_info() {
|
103
|
+
$columns = get_column_headers( $this->_screen );
|
104
|
+
$hidden = get_hidden_columns( $this->_screen );
|
105
|
+
$sortable = array();
|
106
|
+
|
107
|
+
return array( $columns, $hidden, $sortable );
|
108
|
+
}
|
109
|
+
|
110
|
+
public function get_columns() {
|
111
|
+
return $this->_columns;
|
112
|
+
}
|
113
|
+
}
|
@@ -0,0 +1,3012 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* WordPress Administration Media API.
|
4
|
+
*
|
5
|
+
* @package WordPress
|
6
|
+
* @subpackage Administration
|
7
|
+
*/
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Defines the default media upload tabs
|
11
|
+
*
|
12
|
+
* @since 2.5.0
|
13
|
+
*
|
14
|
+
* @return array default tabs
|
15
|
+
*/
|
16
|
+
function media_upload_tabs() {
|
17
|
+
$_default_tabs = array(
|
18
|
+
'type' => __('From Computer'), // handler action suffix => tab text
|
19
|
+
'type_url' => __('From URL'),
|
20
|
+
'gallery' => __('Gallery'),
|
21
|
+
'library' => __('Media Library')
|
22
|
+
);
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Filter the available tabs in the legacy (pre-3.5.0) media popup.
|
26
|
+
*
|
27
|
+
* @since 2.5.0
|
28
|
+
*
|
29
|
+
* @param array $_default_tabs An array of media tabs.
|
30
|
+
*/
|
31
|
+
return apply_filters( 'media_upload_tabs', $_default_tabs );
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Adds the gallery tab back to the tabs array if post has image attachments
|
36
|
+
*
|
37
|
+
* @since 2.5.0
|
38
|
+
*
|
39
|
+
* @param array $tabs
|
40
|
+
* @return array $tabs with gallery if post has image attachment
|
41
|
+
*/
|
42
|
+
function update_gallery_tab($tabs) {
|
43
|
+
global $wpdb;
|
44
|
+
|
45
|
+
if ( !isset($_REQUEST['post_id']) ) {
|
46
|
+
unset($tabs['gallery']);
|
47
|
+
return $tabs;
|
48
|
+
}
|
49
|
+
|
50
|
+
$post_id = intval($_REQUEST['post_id']);
|
51
|
+
|
52
|
+
if ( $post_id )
|
53
|
+
$attachments = intval( $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id ) ) );
|
54
|
+
|
55
|
+
if ( empty($attachments) ) {
|
56
|
+
unset($tabs['gallery']);
|
57
|
+
return $tabs;
|
58
|
+
}
|
59
|
+
|
60
|
+
$tabs['gallery'] = sprintf(__('Gallery (%s)'), "<span id='attachments-count'>$attachments</span>");
|
61
|
+
|
62
|
+
return $tabs;
|
63
|
+
}
|
64
|
+
add_filter('media_upload_tabs', 'update_gallery_tab');
|
65
|
+
|
66
|
+
/**
|
67
|
+
* {@internal Missing Short Description}}
|
68
|
+
*
|
69
|
+
* @since 2.5.0
|
70
|
+
*/
|
71
|
+
function the_media_upload_tabs() {
|
72
|
+
global $redir_tab;
|
73
|
+
$tabs = media_upload_tabs();
|
74
|
+
$default = 'type';
|
75
|
+
|
76
|
+
if ( !empty($tabs) ) {
|
77
|
+
echo "<ul id='sidemenu'>\n";
|
78
|
+
if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) ) {
|
79
|
+
$current = $redir_tab;
|
80
|
+
} elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) {
|
81
|
+
$current = $_GET['tab'];
|
82
|
+
} else {
|
83
|
+
/** This filter is documented in wp-admin/media-upload.php */
|
84
|
+
$current = apply_filters( 'media_upload_default_tab', $default );
|
85
|
+
}
|
86
|
+
|
87
|
+
foreach ( $tabs as $callback => $text ) {
|
88
|
+
$class = '';
|
89
|
+
|
90
|
+
if ( $current == $callback )
|
91
|
+
$class = " class='current'";
|
92
|
+
|
93
|
+
$href = add_query_arg(array('tab' => $callback, 's' => false, 'paged' => false, 'post_mime_type' => false, 'm' => false));
|
94
|
+
$link = "<a href='" . esc_url($href) . "'$class>$text</a>";
|
95
|
+
echo "\t<li id='" . esc_attr("tab-$callback") . "'>$link</li>\n";
|
96
|
+
}
|
97
|
+
echo "</ul>\n";
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* {@internal Missing Short Description}}
|
103
|
+
*
|
104
|
+
* @since 2.5.0
|
105
|
+
*
|
106
|
+
* @param integer $id image attachment id
|
107
|
+
* @param string $caption image caption
|
108
|
+
* @param string $alt image alt attribute
|
109
|
+
* @param string $title image title attribute
|
110
|
+
* @param string $align image css alignment property
|
111
|
+
* @param string $url image src url
|
112
|
+
* @param string|bool $rel image rel attribute
|
113
|
+
* @param string $size image size (thumbnail, medium, large, full or added with add_image_size() )
|
114
|
+
* @return string the html to insert into editor
|
115
|
+
*/
|
116
|
+
function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel = false, $size='medium', $alt = '') {
|
117
|
+
|
118
|
+
$html = get_image_tag($id, $alt, '', $align, $size);
|
119
|
+
|
120
|
+
$rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : '';
|
121
|
+
|
122
|
+
if ( $url )
|
123
|
+
$html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";
|
124
|
+
|
125
|
+
/**
|
126
|
+
* Filter the image HTML markup to send to the editor.
|
127
|
+
*
|
128
|
+
* @since 2.5.0
|
129
|
+
*
|
130
|
+
* @param string $html The image HTML markup to send.
|
131
|
+
* @param int $id The attachment id.
|
132
|
+
* @param string $caption The image caption.
|
133
|
+
* @param string $title The image title.
|
134
|
+
* @param string $align The image alignment.
|
135
|
+
* @param string $url The image source URL.
|
136
|
+
* @param string $size The image size.
|
137
|
+
* @param string $alt The image alternative, or alt, text.
|
138
|
+
*/
|
139
|
+
$html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt );
|
140
|
+
|
141
|
+
return $html;
|
142
|
+
}
|
143
|
+
|
144
|
+
/**
|
145
|
+
* Adds image shortcode with caption to editor
|
146
|
+
*
|
147
|
+
* @since 2.6.0
|
148
|
+
*
|
149
|
+
* @param string $html
|
150
|
+
* @param integer $id
|
151
|
+
* @param string $caption image caption
|
152
|
+
* @param string $alt image alt attribute
|
153
|
+
* @param string $title image title attribute
|
154
|
+
* @param string $align image css alignment property
|
155
|
+
* @param string $url image src url
|
156
|
+
* @param string $size image size (thumbnail, medium, large, full or added with add_image_size() )
|
157
|
+
* @return string
|
158
|
+
*/
|
159
|
+
function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
|
160
|
+
|
161
|
+
/**
|
162
|
+
* Filter the caption text.
|
163
|
+
*
|
164
|
+
* Note: If the caption text is empty, the caption shortcode will not be appended
|
165
|
+
* to the image HTML when inserted into the editor.
|
166
|
+
*
|
167
|
+
* Passing an empty value also prevents the 'image_add_caption_shortcode' filter
|
168
|
+
* from being evaluated at the end of {@see image_add_caption()}.
|
169
|
+
*
|
170
|
+
* @since 4.1.0
|
171
|
+
*
|
172
|
+
* @param string $caption The original caption text.
|
173
|
+
* @param int $id The attachment ID.
|
174
|
+
*/
|
175
|
+
$caption = apply_filters( 'image_add_caption_text', $caption, $id );
|
176
|
+
|
177
|
+
/**
|
178
|
+
* Filter whether to disable captions.
|
179
|
+
*
|
180
|
+
* Prevents image captions from being appended to image HTML when inserted into the editor.
|
181
|
+
*
|
182
|
+
* @since 2.6.0
|
183
|
+
*
|
184
|
+
* @param bool $bool Whether to disable appending captions. Returning true to the filter
|
185
|
+
* will disable captions. Default empty string.
|
186
|
+
*/
|
187
|
+
if ( empty($caption) || apply_filters( 'disable_captions', '' ) )
|
188
|
+
return $html;
|
189
|
+
|
190
|
+
$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
|
191
|
+
|
192
|
+
if ( ! preg_match( '/width=["\']([0-9]+)/', $html, $matches ) )
|
193
|
+
return $html;
|
194
|
+
|
195
|
+
$width = $matches[1];
|
196
|
+
|
197
|
+
$caption = str_replace( array("\r\n", "\r"), "\n", $caption);
|
198
|
+
$caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption );
|
199
|
+
|
200
|
+
// Convert any remaining line breaks to <br>.
|
201
|
+
$caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption );
|
202
|
+
|
203
|
+
$html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
|
204
|
+
if ( empty($align) )
|
205
|
+
$align = 'none';
|
206
|
+
|
207
|
+
$shcode = '[caption id="' . $id . '" align="align' . $align . '" width="' . $width . '"]' . $html . ' ' . $caption . '[/caption]';
|
208
|
+
|
209
|
+
/**
|
210
|
+
* Filter the image HTML markup including the caption shortcode.
|
211
|
+
*
|
212
|
+
* @since 2.6.0
|
213
|
+
*
|
214
|
+
* @param string $shcode The image HTML markup with caption shortcode.
|
215
|
+
* @param string $html The image HTML markup.
|
216
|
+
*/
|
217
|
+
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
|
218
|
+
}
|
219
|
+
add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 );
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Private preg_replace callback used in image_add_caption()
|
223
|
+
*
|
224
|
+
* @access private
|
225
|
+
* @since 3.4.0
|
226
|
+
*/
|
227
|
+
function _cleanup_image_add_caption( $matches ) {
|
228
|
+
// Remove any line breaks from inside the tags.
|
229
|
+
return preg_replace( '/[\r\n\t]+/', ' ', $matches[0] );
|
230
|
+
}
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Adds image html to editor
|
234
|
+
*
|
235
|
+
* @since 2.5.0
|
236
|
+
*
|
237
|
+
* @param string $html
|
238
|
+
*/
|
239
|
+
function media_send_to_editor($html) {
|
240
|
+
?>
|
241
|
+
<script type="text/javascript">
|
242
|
+
/* <![CDATA[ */
|
243
|
+
var win = window.dialogArguments || opener || parent || top;
|
244
|
+
win.send_to_editor('<?php echo addslashes($html); ?>');
|
245
|
+
/* ]]> */
|
246
|
+
</script>
|
247
|
+
<?php
|
248
|
+
exit;
|
249
|
+
}
|
250
|
+
|
251
|
+
/**
|
252
|
+
* This handles the file upload POST itself, creating the attachment post.
|
253
|
+
*
|
254
|
+
* @since 2.5.0
|
255
|
+
*
|
256
|
+
* @param string $file_id Index into the {@link $_FILES} array of the upload
|
257
|
+
* @param int $post_id The post ID the media is associated with
|
258
|
+
* @param array $post_data allows you to overwrite some of the attachment
|
259
|
+
* @param array $overrides allows you to override the {@link wp_handle_upload()} behavior
|
260
|
+
* @return int|WP_Error ID of the attachment or a WP_Error object on failure.
|
261
|
+
*/
|
262
|
+
function media_handle_upload($file_id, $post_id, $post_data = array(), $overrides = array( 'test_form' => false )) {
|
263
|
+
|
264
|
+
$time = current_time('mysql');
|
265
|
+
if ( $post = get_post($post_id) ) {
|
266
|
+
if ( substr( $post->post_date, 0, 4 ) > 0 )
|
267
|
+
$time = $post->post_date;
|
268
|
+
}
|
269
|
+
|
270
|
+
$name = $_FILES[$file_id]['name'];
|
271
|
+
$file = wp_handle_upload($_FILES[$file_id], $overrides, $time);
|
272
|
+
|
273
|
+
if ( isset($file['error']) )
|
274
|
+
return new WP_Error( 'upload_error', $file['error'] );
|
275
|
+
|
276
|
+
$name_parts = pathinfo($name);
|
277
|
+
$name = trim( substr( $name, 0, -(1 + strlen($name_parts['extension'])) ) );
|
278
|
+
|
279
|
+
$url = $file['url'];
|
280
|
+
$type = $file['type'];
|
281
|
+
$file = $file['file'];
|
282
|
+
$title = $name;
|
283
|
+
$content = '';
|
284
|
+
|
285
|
+
if ( preg_match( '#^audio#', $type ) ) {
|
286
|
+
$meta = wp_read_audio_metadata( $file );
|
287
|
+
|
288
|
+
if ( ! empty( $meta['title'] ) )
|
289
|
+
$title = $meta['title'];
|
290
|
+
|
291
|
+
$content = '';
|
292
|
+
|
293
|
+
if ( ! empty( $title ) ) {
|
294
|
+
|
295
|
+
if ( ! empty( $meta['album'] ) && ! empty( $meta['artist'] ) ) {
|
296
|
+
/* translators: 1: audio track title, 2: album title, 3: artist name */
|
297
|
+
$content .= sprintf( __( '"%1$s" from %2$s by %3$s.' ), $title, $meta['album'], $meta['artist'] );
|
298
|
+
} else if ( ! empty( $meta['album'] ) ) {
|
299
|
+
/* translators: 1: audio track title, 2: album title */
|
300
|
+
$content .= sprintf( __( '"%1$s" from %2$s.' ), $title, $meta['album'] );
|
301
|
+
} else if ( ! empty( $meta['artist'] ) ) {
|
302
|
+
/* translators: 1: audio track title, 2: artist name */
|
303
|
+
$content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
|
304
|
+
} else {
|
305
|
+
$content .= sprintf( __( '"%s".' ), $title );
|
306
|
+
}
|
307
|
+
|
308
|
+
} else if ( ! empty( $meta['album'] ) ) {
|
309
|
+
|
310
|
+
if ( ! empty( $meta['artist'] ) ) {
|
311
|
+
/* translators: 1: audio album title, 2: artist name */
|
312
|
+
$content .= sprintf( __( '%1$s by %2$s.' ), $meta['album'], $meta['artist'] );
|
313
|
+
} else {
|
314
|
+
$content .= $meta['album'] . '.';
|
315
|
+
}
|
316
|
+
|
317
|
+
} else if ( ! empty( $meta['artist'] ) ) {
|
318
|
+
|
319
|
+
$content .= $meta['artist'] . '.';
|
320
|
+
|
321
|
+
}
|
322
|
+
|
323
|
+
if ( ! empty( $meta['year'] ) )
|
324
|
+
$content .= ' ' . sprintf( __( 'Released: %d.' ), $meta['year'] );
|
325
|
+
|
326
|
+
if ( ! empty( $meta['track_number'] ) ) {
|
327
|
+
$track_number = explode( '/', $meta['track_number'] );
|
328
|
+
if ( isset( $track_number[1] ) )
|
329
|
+
$content .= ' ' . sprintf( __( 'Track %1$s of %2$s.' ), number_format_i18n( $track_number[0] ), number_format_i18n( $track_number[1] ) );
|
330
|
+
else
|
331
|
+
$content .= ' ' . sprintf( __( 'Track %1$s.' ), number_format_i18n( $track_number[0] ) );
|
332
|
+
}
|
333
|
+
|
334
|
+
if ( ! empty( $meta['genre'] ) )
|
335
|
+
$content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] );
|
336
|
+
|
337
|
+
// Use image exif/iptc data for title and caption defaults if possible.
|
338
|
+
} elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) {
|
339
|
+
if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
|
340
|
+
$title = $image_meta['title'];
|
341
|
+
if ( trim( $image_meta['caption'] ) )
|
342
|
+
$content = $image_meta['caption'];
|
343
|
+
}
|
344
|
+
|
345
|
+
// Construct the attachment array
|
346
|
+
$attachment = array_merge( array(
|
347
|
+
'post_mime_type' => $type,
|
348
|
+
'guid' => $url,
|
349
|
+
'post_parent' => $post_id,
|
350
|
+
'post_title' => $title,
|
351
|
+
'post_content' => $content,
|
352
|
+
), $post_data );
|
353
|
+
|
354
|
+
// This should never be set as it would then overwrite an existing attachment.
|
355
|
+
if ( isset( $attachment['ID'] ) )
|
356
|
+
unset( $attachment['ID'] );
|
357
|
+
|
358
|
+
// Save the data
|
359
|
+
$id = wp_insert_attachment($attachment, $file, $post_id);
|
360
|
+
if ( !is_wp_error($id) ) {
|
361
|
+
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
|
362
|
+
}
|
363
|
+
|
364
|
+
return $id;
|
365
|
+
|
366
|
+
}
|
367
|
+
|
368
|
+
/**
|
369
|
+
* This handles a sideloaded file in the same way as an uploaded file is handled by {@link media_handle_upload()}
|
370
|
+
*
|
371
|
+
* @since 2.6.0
|
372
|
+
*
|
373
|
+
* @param array $file_array Array similar to a {@link $_FILES} upload array
|
374
|
+
* @param int $post_id The post ID the media is associated with
|
375
|
+
* @param string $desc Description of the sideloaded file
|
376
|
+
* @param array $post_data allows you to overwrite some of the attachment
|
377
|
+
* @return int|object The ID of the attachment or a WP_Error on failure
|
378
|
+
*/
|
379
|
+
function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
|
380
|
+
$overrides = array('test_form'=>false);
|
381
|
+
|
382
|
+
$time = current_time( 'mysql' );
|
383
|
+
if ( $post = get_post( $post_id ) ) {
|
384
|
+
if ( substr( $post->post_date, 0, 4 ) > 0 )
|
385
|
+
$time = $post->post_date;
|
386
|
+
}
|
387
|
+
|
388
|
+
$file = wp_handle_sideload( $file_array, $overrides, $time );
|
389
|
+
if ( isset($file['error']) )
|
390
|
+
return new WP_Error( 'upload_error', $file['error'] );
|
391
|
+
|
392
|
+
$url = $file['url'];
|
393
|
+
$type = $file['type'];
|
394
|
+
$file = $file['file'];
|
395
|
+
$title = preg_replace('/\.[^.]+$/', '', basename($file));
|
396
|
+
$content = '';
|
397
|
+
|
398
|
+
// Use image exif/iptc data for title and caption defaults if possible.
|
399
|
+
if ( $image_meta = @wp_read_image_metadata($file) ) {
|
400
|
+
if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
|
401
|
+
$title = $image_meta['title'];
|
402
|
+
if ( trim( $image_meta['caption'] ) )
|
403
|
+
$content = $image_meta['caption'];
|
404
|
+
}
|
405
|
+
|
406
|
+
if ( isset( $desc ) )
|
407
|
+
$title = $desc;
|
408
|
+
|
409
|
+
// Construct the attachment array.
|
410
|
+
$attachment = array_merge( array(
|
411
|
+
'post_mime_type' => $type,
|
412
|
+
'guid' => $url,
|
413
|
+
'post_parent' => $post_id,
|
414
|
+
'post_title' => $title,
|
415
|
+
'post_content' => $content,
|
416
|
+
), $post_data );
|
417
|
+
|
418
|
+
// This should never be set as it would then overwrite an existing attachment.
|
419
|
+
if ( isset( $attachment['ID'] ) )
|
420
|
+
unset( $attachment['ID'] );
|
421
|
+
|
422
|
+
// Save the attachment metadata
|
423
|
+
$id = wp_insert_attachment($attachment, $file, $post_id);
|
424
|
+
if ( !is_wp_error($id) )
|
425
|
+
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
|
426
|
+
|
427
|
+
return $id;
|
428
|
+
}
|
429
|
+
|
430
|
+
/**
|
431
|
+
* Adds the iframe to display content for the media upload page
|
432
|
+
*
|
433
|
+
* @since 2.5.0
|
434
|
+
*
|
435
|
+
* @param array $content_func
|
436
|
+
*/
|
437
|
+
function wp_iframe($content_func /* ... */) {
|
438
|
+
_wp_admin_html_begin();
|
439
|
+
?>
|
440
|
+
<title><?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — <?php _e('WordPress'); ?></title>
|
441
|
+
<?php
|
442
|
+
|
443
|
+
wp_enqueue_style( 'colors' );
|
444
|
+
// Check callback name for 'media'
|
445
|
+
if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) )
|
446
|
+
|| ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) ) )
|
447
|
+
wp_enqueue_style( 'media' );
|
448
|
+
wp_enqueue_style( 'ie' );
|
449
|
+
?>
|
450
|
+
<script type="text/javascript">
|
451
|
+
//<![CDATA[
|
452
|
+
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
|
453
|
+
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
|
454
|
+
isRtl = <?php echo (int) is_rtl(); ?>;
|
455
|
+
//]]>
|
456
|
+
</script>
|
457
|
+
<?php
|
458
|
+
/** This action is documented in wp-admin/admin-header.php */
|
459
|
+
do_action( 'admin_enqueue_scripts', 'media-upload-popup' );
|
460
|
+
|
461
|
+
/**
|
462
|
+
* Fires when admin styles enqueued for the legacy (pre-3.5.0) media upload popup are printed.
|
463
|
+
*
|
464
|
+
* @since 2.9.0
|
465
|
+
*/
|
466
|
+
do_action( 'admin_print_styles-media-upload-popup' );
|
467
|
+
|
468
|
+
/** This action is documented in wp-admin/admin-header.php */
|
469
|
+
do_action( 'admin_print_styles' );
|
470
|
+
|
471
|
+
/**
|
472
|
+
* Fires when admin scripts enqueued for the legacy (pre-3.5.0) media upload popup are printed.
|
473
|
+
*
|
474
|
+
* @since 2.9.0
|
475
|
+
*/
|
476
|
+
do_action( 'admin_print_scripts-media-upload-popup' );
|
477
|
+
|
478
|
+
/** This action is documented in wp-admin/admin-header.php */
|
479
|
+
do_action( 'admin_print_scripts' );
|
480
|
+
|
481
|
+
/**
|
482
|
+
* Fires when scripts enqueued for the admin header for the legacy (pre-3.5.0)
|
483
|
+
* media upload popup are printed.
|
484
|
+
*
|
485
|
+
* @since 2.9.0
|
486
|
+
*/
|
487
|
+
do_action( 'admin_head-media-upload-popup' );
|
488
|
+
|
489
|
+
/** This action is documented in wp-admin/admin-header.php */
|
490
|
+
do_action( 'admin_head' );
|
491
|
+
|
492
|
+
if ( is_string( $content_func ) ) {
|
493
|
+
/**
|
494
|
+
* Fires in the admin header for each specific form tab in the legacy
|
495
|
+
* (pre-3.5.0) media upload popup.
|
496
|
+
*
|
497
|
+
* The dynamic portion of the hook, $content_func, refers to the form
|
498
|
+
* callback for the media upload type. Possible values include
|
499
|
+
* 'media_upload_type_form', 'media_upload_type_url_form', and
|
500
|
+
* 'media_upload_library_form'.
|
501
|
+
*
|
502
|
+
* @since 2.5.0
|
503
|
+
*/
|
504
|
+
do_action( "admin_head_{$content_func}" );
|
505
|
+
}
|
506
|
+
?>
|
507
|
+
</head>
|
508
|
+
<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-core-ui no-js">
|
509
|
+
<script type="text/javascript">
|
510
|
+
document.body.className = document.body.className.replace('no-js', 'js');
|
511
|
+
</script>
|
512
|
+
<?php
|
513
|
+
$args = func_get_args();
|
514
|
+
$args = array_slice($args, 1);
|
515
|
+
call_user_func_array($content_func, $args);
|
516
|
+
|
517
|
+
/** This action is documented in wp-admin/admin-footer.php */
|
518
|
+
do_action( 'admin_print_footer_scripts' );
|
519
|
+
?>
|
520
|
+
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
|
521
|
+
</body>
|
522
|
+
</html>
|
523
|
+
<?php
|
524
|
+
}
|
525
|
+
|
526
|
+
/**
|
527
|
+
* Adds the media button to the editor
|
528
|
+
*
|
529
|
+
* @since 2.5.0
|
530
|
+
*
|
531
|
+
* @param string $editor_id
|
532
|
+
*/
|
533
|
+
function media_buttons($editor_id = 'content') {
|
534
|
+
static $instance = 0;
|
535
|
+
$instance++;
|
536
|
+
|
537
|
+
$post = get_post();
|
538
|
+
if ( ! $post && ! empty( $GLOBALS['post_ID'] ) )
|
539
|
+
$post = $GLOBALS['post_ID'];
|
540
|
+
|
541
|
+
wp_enqueue_media( array(
|
542
|
+
'post' => $post
|
543
|
+
) );
|
544
|
+
|
545
|
+
$img = '<span class="wp-media-buttons-icon"></span> ';
|
546
|
+
|
547
|
+
$id_attribute = $instance === 1 ? ' id="insert-media-button"' : '';
|
548
|
+
printf( '<a href="#"%s class="button insert-media add_media" data-editor="%s" title="%s">%s</a>',
|
549
|
+
$id_attribute,
|
550
|
+
esc_attr( $editor_id ),
|
551
|
+
esc_attr__( 'Add Media' ),
|
552
|
+
$img . __( 'Add Media' )
|
553
|
+
);
|
554
|
+
/**
|
555
|
+
* Filter the legacy (pre-3.5.0) media buttons.
|
556
|
+
*
|
557
|
+
* @since 2.5.0
|
558
|
+
* @deprecated 3.5.0 Use 'media_buttons' action instead.
|
559
|
+
*
|
560
|
+
* @param string $string Media buttons context. Default empty.
|
561
|
+
*/
|
562
|
+
$legacy_filter = apply_filters( 'media_buttons_context', '' );
|
563
|
+
|
564
|
+
if ( $legacy_filter ) {
|
565
|
+
// #WP22559. Close <a> if a plugin started by closing <a> to open their own <a> tag.
|
566
|
+
if ( 0 === stripos( trim( $legacy_filter ), '</a>' ) )
|
567
|
+
$legacy_filter .= '</a>';
|
568
|
+
echo $legacy_filter;
|
569
|
+
}
|
570
|
+
}
|
571
|
+
add_action( 'media_buttons', 'media_buttons' );
|
572
|
+
|
573
|
+
function get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) {
|
574
|
+
global $post_ID;
|
575
|
+
|
576
|
+
if ( empty( $post_id ) )
|
577
|
+
$post_id = $post_ID;
|
578
|
+
|
579
|
+
$upload_iframe_src = add_query_arg( 'post_id', (int) $post_id, admin_url('media-upload.php') );
|
580
|
+
|
581
|
+
if ( $type && 'media' != $type )
|
582
|
+
$upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src);
|
583
|
+
|
584
|
+
if ( ! empty( $tab ) )
|
585
|
+
$upload_iframe_src = add_query_arg('tab', $tab, $upload_iframe_src);
|
586
|
+
|
587
|
+
/**
|
588
|
+
* Filter the upload iframe source URL for a specific media type.
|
589
|
+
*
|
590
|
+
* The dynamic portion of the hook name, $type, refers to the type
|
591
|
+
* of media uploaded.
|
592
|
+
*
|
593
|
+
* @since 3.0.0
|
594
|
+
*
|
595
|
+
* @param string $upload_iframe_src The upload iframe source URL by type.
|
596
|
+
*/
|
597
|
+
$upload_iframe_src = apply_filters( $type . '_upload_iframe_src', $upload_iframe_src );
|
598
|
+
|
599
|
+
return add_query_arg('TB_iframe', true, $upload_iframe_src);
|
600
|
+
}
|
601
|
+
|
602
|
+
/**
|
603
|
+
* {@internal Missing Short Description}}
|
604
|
+
*
|
605
|
+
* @since 2.5.0
|
606
|
+
*
|
607
|
+
* @return mixed void|object WP_Error on failure
|
608
|
+
*/
|
609
|
+
function media_upload_form_handler() {
|
610
|
+
check_admin_referer('media-form');
|
611
|
+
|
612
|
+
$errors = null;
|
613
|
+
|
614
|
+
if ( isset($_POST['send']) ) {
|
615
|
+
$keys = array_keys($_POST['send']);
|
616
|
+
$send_id = (int) array_shift($keys);
|
617
|
+
}
|
618
|
+
|
619
|
+
if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
|
620
|
+
$post = $_post = get_post($attachment_id, ARRAY_A);
|
621
|
+
|
622
|
+
if ( !current_user_can( 'edit_post', $attachment_id ) )
|
623
|
+
continue;
|
624
|
+
|
625
|
+
if ( isset($attachment['post_content']) )
|
626
|
+
$post['post_content'] = $attachment['post_content'];
|
627
|
+
if ( isset($attachment['post_title']) )
|
628
|
+
$post['post_title'] = $attachment['post_title'];
|
629
|
+
if ( isset($attachment['post_excerpt']) )
|
630
|
+
$post['post_excerpt'] = $attachment['post_excerpt'];
|
631
|
+
if ( isset($attachment['menu_order']) )
|
632
|
+
$post['menu_order'] = $attachment['menu_order'];
|
633
|
+
|
634
|
+
if ( isset($send_id) && $attachment_id == $send_id ) {
|
635
|
+
if ( isset($attachment['post_parent']) )
|
636
|
+
$post['post_parent'] = $attachment['post_parent'];
|
637
|
+
}
|
638
|
+
|
639
|
+
/**
|
640
|
+
* Filter the attachment fields to be saved.
|
641
|
+
*
|
642
|
+
* @since 2.5.0
|
643
|
+
*
|
644
|
+
* @see wp_get_attachment_metadata()
|
645
|
+
*
|
646
|
+
* @param WP_Post $post The WP_Post object.
|
647
|
+
* @param array $attachment An array of attachment metadata.
|
648
|
+
*/
|
649
|
+
$post = apply_filters( 'attachment_fields_to_save', $post, $attachment );
|
650
|
+
|
651
|
+
if ( isset($attachment['image_alt']) ) {
|
652
|
+
$image_alt = wp_unslash( $attachment['image_alt'] );
|
653
|
+
if ( $image_alt != get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ) {
|
654
|
+
$image_alt = wp_strip_all_tags( $image_alt, true );
|
655
|
+
|
656
|
+
// Update_meta expects slashed.
|
657
|
+
update_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
|
658
|
+
}
|
659
|
+
}
|
660
|
+
|
661
|
+
if ( isset($post['errors']) ) {
|
662
|
+
$errors[$attachment_id] = $post['errors'];
|
663
|
+
unset($post['errors']);
|
664
|
+
}
|
665
|
+
|
666
|
+
if ( $post != $_post )
|
667
|
+
wp_update_post($post);
|
668
|
+
|
669
|
+
foreach ( get_attachment_taxonomies($post) as $t ) {
|
670
|
+
if ( isset($attachment[$t]) )
|
671
|
+
wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false);
|
672
|
+
}
|
673
|
+
}
|
674
|
+
|
675
|
+
if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?>
|
676
|
+
<script type="text/javascript">
|
677
|
+
/* <![CDATA[ */
|
678
|
+
var win = window.dialogArguments || opener || parent || top;
|
679
|
+
win.tb_remove();
|
680
|
+
/* ]]> */
|
681
|
+
</script>
|
682
|
+
<?php
|
683
|
+
exit;
|
684
|
+
}
|
685
|
+
|
686
|
+
if ( isset($send_id) ) {
|
687
|
+
$attachment = wp_unslash( $_POST['attachments'][$send_id] );
|
688
|
+
|
689
|
+
$html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
|
690
|
+
if ( !empty($attachment['url']) ) {
|
691
|
+
$rel = '';
|
692
|
+
if ( strpos($attachment['url'], 'attachment_id') || get_attachment_link($send_id) == $attachment['url'] )
|
693
|
+
$rel = " rel='attachment wp-att-" . esc_attr($send_id) . "'";
|
694
|
+
$html = "<a href='{$attachment['url']}'$rel>$html</a>";
|
695
|
+
}
|
696
|
+
|
697
|
+
/**
|
698
|
+
* Filter the HTML markup for a media item sent to the editor.
|
699
|
+
*
|
700
|
+
* @since 2.5.0
|
701
|
+
*
|
702
|
+
* @see wp_get_attachment_metadata()
|
703
|
+
*
|
704
|
+
* @param string $html HTML markup for a media item sent to the editor.
|
705
|
+
* @param int $send_id The first key from the $_POST['send'] data.
|
706
|
+
* @param array $attachment Array of attachment metadata.
|
707
|
+
*/
|
708
|
+
$html = apply_filters( 'media_send_to_editor', $html, $send_id, $attachment );
|
709
|
+
return media_send_to_editor($html);
|
710
|
+
}
|
711
|
+
|
712
|
+
return $errors;
|
713
|
+
}
|
714
|
+
|
715
|
+
/**
|
716
|
+
* {@internal Missing Short Description}}
|
717
|
+
*
|
718
|
+
* @since 2.5.0
|
719
|
+
*
|
720
|
+
* @return mixed
|
721
|
+
*/
|
722
|
+
function wp_media_upload_handler() {
|
723
|
+
$errors = array();
|
724
|
+
$id = 0;
|
725
|
+
|
726
|
+
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
|
727
|
+
check_admin_referer('media-form');
|
728
|
+
// Upload File button was clicked
|
729
|
+
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
|
730
|
+
unset($_FILES);
|
731
|
+
if ( is_wp_error($id) ) {
|
732
|
+
$errors['upload_error'] = $id;
|
733
|
+
$id = false;
|
734
|
+
}
|
735
|
+
}
|
736
|
+
|
737
|
+
if ( !empty($_POST['insertonlybutton']) ) {
|
738
|
+
$src = $_POST['src'];
|
739
|
+
if ( !empty($src) && !strpos($src, '://') )
|
740
|
+
$src = "http://$src";
|
741
|
+
|
742
|
+
if ( isset( $_POST['media_type'] ) && 'image' != $_POST['media_type'] ) {
|
743
|
+
$title = esc_html( wp_unslash( $_POST['title'] ) );
|
744
|
+
if ( empty( $title ) )
|
745
|
+
$title = esc_html( basename( $src ) );
|
746
|
+
|
747
|
+
if ( $title && $src )
|
748
|
+
$html = "<a href='" . esc_url($src) . "'>$title</a>";
|
749
|
+
|
750
|
+
$type = 'file';
|
751
|
+
if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) )
|
752
|
+
&& ( 'audio' == $ext_type || 'video' == $ext_type ) )
|
753
|
+
$type = $ext_type;
|
754
|
+
|
755
|
+
/**
|
756
|
+
* Filter the URL sent to the editor for a specific media type.
|
757
|
+
*
|
758
|
+
* The dynamic portion of the hook name, $type, refers to the type
|
759
|
+
* of media being sent.
|
760
|
+
*
|
761
|
+
* @since 3.3.0
|
762
|
+
*
|
763
|
+
* @param string $html HTML markup sent to the editor.
|
764
|
+
* @param string $src Media source URL.
|
765
|
+
* @param string $title Media title.
|
766
|
+
*/
|
767
|
+
$html = apply_filters( $type . '_send_to_editor_url', $html, esc_url_raw( $src ), $title );
|
768
|
+
} else {
|
769
|
+
$align = '';
|
770
|
+
$alt = esc_attr( wp_unslash( $_POST['alt'] ) );
|
771
|
+
if ( isset($_POST['align']) ) {
|
772
|
+
$align = esc_attr( wp_unslash( $_POST['align'] ) );
|
773
|
+
$class = " class='align$align'";
|
774
|
+
}
|
775
|
+
if ( !empty($src) )
|
776
|
+
$html = "<img src='" . esc_url($src) . "' alt='$alt'$class />";
|
777
|
+
|
778
|
+
/**
|
779
|
+
* Filter the image URL sent to the editor.
|
780
|
+
*
|
781
|
+
* @since 2.8.0
|
782
|
+
*
|
783
|
+
* @param string $html HTML markup sent to the editor for an image.
|
784
|
+
* @param string $src Image source URL.
|
785
|
+
* @param string $alt Image alternate, or alt, text.
|
786
|
+
* @param string $align The image alignment. Default 'alignnone'. Possible values include
|
787
|
+
* 'alignleft', 'aligncenter', 'alignright', 'alignnone'.
|
788
|
+
*/
|
789
|
+
$html = apply_filters( 'image_send_to_editor_url', $html, esc_url_raw( $src ), $alt, $align );
|
790
|
+
}
|
791
|
+
|
792
|
+
return media_send_to_editor($html);
|
793
|
+
}
|
794
|
+
|
795
|
+
if ( isset( $_POST['save'] ) ) {
|
796
|
+
$errors['upload_notice'] = __('Saved.');
|
797
|
+
return media_upload_gallery();
|
798
|
+
} elseif ( ! empty( $_POST ) ) {
|
799
|
+
$return = media_upload_form_handler();
|
800
|
+
|
801
|
+
if ( is_string($return) )
|
802
|
+
return $return;
|
803
|
+
if ( is_array($return) )
|
804
|
+
$errors = $return;
|
805
|
+
}
|
806
|
+
|
807
|
+
if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) {
|
808
|
+
$type = 'image';
|
809
|
+
if ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ) ) )
|
810
|
+
$type = $_GET['type'];
|
811
|
+
return wp_iframe( 'media_upload_type_url_form', $type, $errors, $id );
|
812
|
+
}
|
813
|
+
|
814
|
+
return wp_iframe( 'media_upload_type_form', 'image', $errors, $id );
|
815
|
+
}
|
816
|
+
|
817
|
+
/**
|
818
|
+
* Download an image from the specified URL and attach it to a post.
|
819
|
+
*
|
820
|
+
* @since 2.6.0
|
821
|
+
*
|
822
|
+
* @param string $file The URL of the image to download
|
823
|
+
* @param int $post_id The post ID the media is to be associated with
|
824
|
+
* @param string $desc Optional. Description of the image
|
825
|
+
* @return string|WP_Error Populated HTML img tag on success
|
826
|
+
*/
|
827
|
+
function media_sideload_image( $file, $post_id, $desc = null ) {
|
828
|
+
if ( ! empty( $file ) ) {
|
829
|
+
// Set variables for storage, fix file filename for query strings.
|
830
|
+
preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
|
831
|
+
$file_array = array();
|
832
|
+
$file_array['name'] = basename( $matches[0] );
|
833
|
+
|
834
|
+
// Download file to temp location.
|
835
|
+
$file_array['tmp_name'] = download_url( $file );
|
836
|
+
|
837
|
+
// If error storing temporarily, return the error.
|
838
|
+
if ( is_wp_error( $file_array['tmp_name'] ) ) {
|
839
|
+
return $file_array['tmp_name'];
|
840
|
+
}
|
841
|
+
|
842
|
+
// Do the validation and storage stuff.
|
843
|
+
$id = media_handle_sideload( $file_array, $post_id, $desc );
|
844
|
+
|
845
|
+
// If error storing permanently, unlink.
|
846
|
+
if ( is_wp_error( $id ) ) {
|
847
|
+
@unlink( $file_array['tmp_name'] );
|
848
|
+
return $id;
|
849
|
+
}
|
850
|
+
|
851
|
+
$src = wp_get_attachment_url( $id );
|
852
|
+
}
|
853
|
+
|
854
|
+
// Finally check to make sure the file has been saved, then return the HTML.
|
855
|
+
if ( ! empty( $src ) ) {
|
856
|
+
$alt = isset( $desc ) ? esc_attr( $desc ) : '';
|
857
|
+
$html = "<img src='$src' alt='$alt' />";
|
858
|
+
return $html;
|
859
|
+
}
|
860
|
+
}
|
861
|
+
|
862
|
+
/**
|
863
|
+
* {@internal Missing Short Description}}
|
864
|
+
*
|
865
|
+
* @since 2.5.0
|
866
|
+
*
|
867
|
+
* @return unknown
|
868
|
+
*/
|
869
|
+
function media_upload_gallery() {
|
870
|
+
$errors = array();
|
871
|
+
|
872
|
+
if ( !empty($_POST) ) {
|
873
|
+
$return = media_upload_form_handler();
|
874
|
+
|
875
|
+
if ( is_string($return) )
|
876
|
+
return $return;
|
877
|
+
if ( is_array($return) )
|
878
|
+
$errors = $return;
|
879
|
+
}
|
880
|
+
|
881
|
+
wp_enqueue_script('admin-gallery');
|
882
|
+
return wp_iframe( 'media_upload_gallery_form', $errors );
|
883
|
+
}
|
884
|
+
|
885
|
+
/**
|
886
|
+
* {@internal Missing Short Description}}
|
887
|
+
*
|
888
|
+
* @since 2.5.0
|
889
|
+
*
|
890
|
+
* @return unknown
|
891
|
+
*/
|
892
|
+
function media_upload_library() {
|
893
|
+
$errors = array();
|
894
|
+
if ( !empty($_POST) ) {
|
895
|
+
$return = media_upload_form_handler();
|
896
|
+
|
897
|
+
if ( is_string($return) )
|
898
|
+
return $return;
|
899
|
+
if ( is_array($return) )
|
900
|
+
$errors = $return;
|
901
|
+
}
|
902
|
+
|
903
|
+
return wp_iframe( 'media_upload_library_form', $errors );
|
904
|
+
}
|
905
|
+
|
906
|
+
/**
|
907
|
+
* Retrieve HTML for the image alignment radio buttons with the specified one checked.
|
908
|
+
*
|
909
|
+
* @since 2.7.0
|
910
|
+
*
|
911
|
+
* @param object $post
|
912
|
+
* @param string $checked
|
913
|
+
* @return string
|
914
|
+
*/
|
915
|
+
function image_align_input_fields( $post, $checked = '' ) {
|
916
|
+
|
917
|
+
if ( empty($checked) )
|
918
|
+
$checked = get_user_setting('align', 'none');
|
919
|
+
|
920
|
+
$alignments = array('none' => __('None'), 'left' => __('Left'), 'center' => __('Center'), 'right' => __('Right'));
|
921
|
+
if ( !array_key_exists( (string) $checked, $alignments ) )
|
922
|
+
$checked = 'none';
|
923
|
+
|
924
|
+
$out = array();
|
925
|
+
foreach ( $alignments as $name => $label ) {
|
926
|
+
$name = esc_attr($name);
|
927
|
+
$out[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'".
|
928
|
+
( $checked == $name ? " checked='checked'" : "" ) .
|
929
|
+
" /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>";
|
930
|
+
}
|
931
|
+
return join("\n", $out);
|
932
|
+
}
|
933
|
+
|
934
|
+
/**
|
935
|
+
* Retrieve HTML for the size radio buttons with the specified one checked.
|
936
|
+
*
|
937
|
+
* @since 2.7.0
|
938
|
+
*
|
939
|
+
* @param object $post
|
940
|
+
* @param bool|string $check
|
941
|
+
* @return array
|
942
|
+
*/
|
943
|
+
function image_size_input_fields( $post, $check = '' ) {
|
944
|
+
|
945
|
+
/**
|
946
|
+
* Filter the names and labels of the default image sizes.
|
947
|
+
*
|
948
|
+
* @since 3.3.0
|
949
|
+
*
|
950
|
+
* @param array $size_names Array of image sizes and their names. Default values
|
951
|
+
* include 'Thumbnail', 'Medium', 'Large', 'Full Size'.
|
952
|
+
*/
|
953
|
+
$size_names = apply_filters( 'image_size_names_choose', array(
|
954
|
+
'thumbnail' => __( 'Thumbnail' ),
|
955
|
+
'medium' => __( 'Medium' ),
|
956
|
+
'large' => __( 'Large' ),
|
957
|
+
'full' => __( 'Full Size' )
|
958
|
+
) );
|
959
|
+
|
960
|
+
if ( empty($check) )
|
961
|
+
$check = get_user_setting('imgsize', 'medium');
|
962
|
+
|
963
|
+
foreach ( $size_names as $size => $label ) {
|
964
|
+
$downsize = image_downsize($post->ID, $size);
|
965
|
+
$checked = '';
|
966
|
+
|
967
|
+
// Is this size selectable?
|
968
|
+
$enabled = ( $downsize[3] || 'full' == $size );
|
969
|
+
$css_id = "image-size-{$size}-{$post->ID}";
|
970
|
+
|
971
|
+
// If this size is the default but that's not available, don't select it.
|
972
|
+
if ( $size == $check ) {
|
973
|
+
if ( $enabled )
|
974
|
+
$checked = " checked='checked'";
|
975
|
+
else
|
976
|
+
$check = '';
|
977
|
+
} elseif ( !$check && $enabled && 'thumbnail' != $size ) {
|
978
|
+
/*
|
979
|
+
* If $check is not enabled, default to the first available size
|
980
|
+
* that's bigger than a thumbnail.
|
981
|
+
*/
|
982
|
+
$check = $size;
|
983
|
+
$checked = " checked='checked'";
|
984
|
+
}
|
985
|
+
|
986
|
+
$html = "<div class='image-size-item'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
|
987
|
+
|
988
|
+
$html .= "<label for='{$css_id}'>$label</label>";
|
989
|
+
|
990
|
+
// Only show the dimensions if that choice is available.
|
991
|
+
if ( $enabled )
|
992
|
+
$html .= " <label for='{$css_id}' class='help'>" . sprintf( "(%d × %d)", $downsize[1], $downsize[2] ). "</label>";
|
993
|
+
|
994
|
+
$html .= '</div>';
|
995
|
+
|
996
|
+
$out[] = $html;
|
997
|
+
}
|
998
|
+
|
999
|
+
return array(
|
1000
|
+
'label' => __('Size'),
|
1001
|
+
'input' => 'html',
|
1002
|
+
'html' => join("\n", $out),
|
1003
|
+
);
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
/**
|
1007
|
+
* Retrieve HTML for the Link URL buttons with the default link type as specified.
|
1008
|
+
*
|
1009
|
+
* @since 2.7.0
|
1010
|
+
*
|
1011
|
+
* @param object $post
|
1012
|
+
* @param string $url_type
|
1013
|
+
* @return string
|
1014
|
+
*/
|
1015
|
+
function image_link_input_fields($post, $url_type = '') {
|
1016
|
+
|
1017
|
+
$file = wp_get_attachment_url($post->ID);
|
1018
|
+
$link = get_attachment_link($post->ID);
|
1019
|
+
|
1020
|
+
if ( empty($url_type) )
|
1021
|
+
$url_type = get_user_setting('urlbutton', 'post');
|
1022
|
+
|
1023
|
+
$url = '';
|
1024
|
+
if ( $url_type == 'file' )
|
1025
|
+
$url = $file;
|
1026
|
+
elseif ( $url_type == 'post' )
|
1027
|
+
$url = $link;
|
1028
|
+
|
1029
|
+
return "
|
1030
|
+
<input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr($url) . "' /><br />
|
1031
|
+
<button type='button' class='button urlnone' data-link-url=''>" . __('None') . "</button>
|
1032
|
+
<button type='button' class='button urlfile' data-link-url='" . esc_attr($file) . "'>" . __('File URL') . "</button>
|
1033
|
+
<button type='button' class='button urlpost' data-link-url='" . esc_attr($link) . "'>" . __('Attachment Post URL') . "</button>
|
1034
|
+
";
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
function wp_caption_input_textarea($edit_post) {
|
1038
|
+
// Post data is already escaped.
|
1039
|
+
$name = "attachments[{$edit_post->ID}][post_excerpt]";
|
1040
|
+
|
1041
|
+
return '<textarea name="' . $name . '" id="' . $name . '">' . $edit_post->post_excerpt . '</textarea>';
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
/**
|
1045
|
+
* {@internal Missing Short Description}}
|
1046
|
+
*
|
1047
|
+
* @since 2.5.0
|
1048
|
+
*
|
1049
|
+
* @param array $form_fields
|
1050
|
+
* @param object $post
|
1051
|
+
* @return array
|
1052
|
+
*/
|
1053
|
+
function image_attachment_fields_to_edit($form_fields, $post) {
|
1054
|
+
return $form_fields;
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
/**
|
1058
|
+
* {@internal Missing Short Description}}
|
1059
|
+
*
|
1060
|
+
* @since 2.5.0
|
1061
|
+
*
|
1062
|
+
* @param array $form_fields An array of attachment form fields.
|
1063
|
+
* @param WP_Post $post The WP_Post attachment object.
|
1064
|
+
* @return array Filtered attachment form fields.
|
1065
|
+
*/
|
1066
|
+
function media_single_attachment_fields_to_edit( $form_fields, $post ) {
|
1067
|
+
unset($form_fields['url'], $form_fields['align'], $form_fields['image-size']);
|
1068
|
+
return $form_fields;
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
/**
|
1072
|
+
* {@internal Missing Short Description}}
|
1073
|
+
*
|
1074
|
+
* @since 2.8.0
|
1075
|
+
*
|
1076
|
+
* @param array $form_fields An array of attachment form fields.
|
1077
|
+
* @param WP_Post $post The WP_Post attachment object.
|
1078
|
+
* @return array Filtered attachment form fields.
|
1079
|
+
*/
|
1080
|
+
function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
|
1081
|
+
unset($form_fields['image_url']);
|
1082
|
+
return $form_fields;
|
1083
|
+
}
|
1084
|
+
|
1085
|
+
/**
|
1086
|
+
* Filters input from media_upload_form_handler() and assigns a default
|
1087
|
+
* post_title from the file name if none supplied.
|
1088
|
+
*
|
1089
|
+
* Illustrates the use of the attachment_fields_to_save filter
|
1090
|
+
* which can be used to add default values to any field before saving to DB.
|
1091
|
+
*
|
1092
|
+
* @since 2.5.0
|
1093
|
+
*
|
1094
|
+
* @param WP_Post $post The WP_Post attachment object.
|
1095
|
+
* @param array $attachment An array of attachment metadata.
|
1096
|
+
* @return array Filtered attachment post object.
|
1097
|
+
*/
|
1098
|
+
function image_attachment_fields_to_save( $post, $attachment ) {
|
1099
|
+
if ( substr( $post['post_mime_type'], 0, 5 ) == 'image' ) {
|
1100
|
+
if ( strlen( trim( $post['post_title'] ) ) == 0 ) {
|
1101
|
+
$attachment_url = ( isset( $post['attachment_url'] ) ) ? $post['attachment_url'] : $post['guid'];
|
1102
|
+
$post['post_title'] = preg_replace( '/\.\w+$/', '', wp_basename( $attachment_url ) );
|
1103
|
+
$post['errors']['post_title']['errors'][] = __( 'Empty Title filled from filename.' );
|
1104
|
+
}
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
return $post;
|
1108
|
+
}
|
1109
|
+
|
1110
|
+
add_filter( 'attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2 );
|
1111
|
+
|
1112
|
+
/**
|
1113
|
+
* {@internal Missing Short Description}}
|
1114
|
+
*
|
1115
|
+
* @since 2.5.0
|
1116
|
+
*
|
1117
|
+
* @param string $html
|
1118
|
+
* @param integer $attachment_id
|
1119
|
+
* @param array $attachment
|
1120
|
+
* @return array
|
1121
|
+
*/
|
1122
|
+
function image_media_send_to_editor($html, $attachment_id, $attachment) {
|
1123
|
+
$post = get_post($attachment_id);
|
1124
|
+
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
|
1125
|
+
$url = $attachment['url'];
|
1126
|
+
$align = !empty($attachment['align']) ? $attachment['align'] : 'none';
|
1127
|
+
$size = !empty($attachment['image-size']) ? $attachment['image-size'] : 'medium';
|
1128
|
+
$alt = !empty($attachment['image_alt']) ? $attachment['image_alt'] : '';
|
1129
|
+
$rel = ( $url == get_attachment_link($attachment_id) );
|
1130
|
+
|
1131
|
+
return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt);
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
return $html;
|
1135
|
+
}
|
1136
|
+
|
1137
|
+
add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3);
|
1138
|
+
|
1139
|
+
/**
|
1140
|
+
* {@internal Missing Short Description}}
|
1141
|
+
*
|
1142
|
+
* @since 2.5.0
|
1143
|
+
*
|
1144
|
+
* @param object $post
|
1145
|
+
* @param array $errors
|
1146
|
+
* @return array
|
1147
|
+
*/
|
1148
|
+
function get_attachment_fields_to_edit($post, $errors = null) {
|
1149
|
+
if ( is_int($post) )
|
1150
|
+
$post = get_post($post);
|
1151
|
+
if ( is_array($post) )
|
1152
|
+
$post = new WP_Post( (object) $post );
|
1153
|
+
|
1154
|
+
$image_url = wp_get_attachment_url($post->ID);
|
1155
|
+
|
1156
|
+
$edit_post = sanitize_post($post, 'edit');
|
1157
|
+
|
1158
|
+
$form_fields = array(
|
1159
|
+
'post_title' => array(
|
1160
|
+
'label' => __('Title'),
|
1161
|
+
'value' => $edit_post->post_title
|
1162
|
+
),
|
1163
|
+
'image_alt' => array(),
|
1164
|
+
'post_excerpt' => array(
|
1165
|
+
'label' => __('Caption'),
|
1166
|
+
'input' => 'html',
|
1167
|
+
'html' => wp_caption_input_textarea($edit_post)
|
1168
|
+
),
|
1169
|
+
'post_content' => array(
|
1170
|
+
'label' => __('Description'),
|
1171
|
+
'value' => $edit_post->post_content,
|
1172
|
+
'input' => 'textarea'
|
1173
|
+
),
|
1174
|
+
'url' => array(
|
1175
|
+
'label' => __('Link URL'),
|
1176
|
+
'input' => 'html',
|
1177
|
+
'html' => image_link_input_fields($post, get_option('image_default_link_type')),
|
1178
|
+
'helps' => __('Enter a link URL or click above for presets.')
|
1179
|
+
),
|
1180
|
+
'menu_order' => array(
|
1181
|
+
'label' => __('Order'),
|
1182
|
+
'value' => $edit_post->menu_order
|
1183
|
+
),
|
1184
|
+
'image_url' => array(
|
1185
|
+
'label' => __('File URL'),
|
1186
|
+
'input' => 'html',
|
1187
|
+
'html' => "<input type='text' class='text urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . esc_attr($image_url) . "' /><br />",
|
1188
|
+
'value' => wp_get_attachment_url($post->ID),
|
1189
|
+
'helps' => __('Location of the uploaded file.')
|
1190
|
+
)
|
1191
|
+
);
|
1192
|
+
|
1193
|
+
foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
|
1194
|
+
$t = (array) get_taxonomy($taxonomy);
|
1195
|
+
if ( ! $t['public'] || ! $t['show_ui'] )
|
1196
|
+
continue;
|
1197
|
+
if ( empty($t['label']) )
|
1198
|
+
$t['label'] = $taxonomy;
|
1199
|
+
if ( empty($t['args']) )
|
1200
|
+
$t['args'] = array();
|
1201
|
+
|
1202
|
+
$terms = get_object_term_cache($post->ID, $taxonomy);
|
1203
|
+
if ( false === $terms )
|
1204
|
+
$terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']);
|
1205
|
+
|
1206
|
+
$values = array();
|
1207
|
+
|
1208
|
+
foreach ( $terms as $term )
|
1209
|
+
$values[] = $term->slug;
|
1210
|
+
$t['value'] = join(', ', $values);
|
1211
|
+
|
1212
|
+
$form_fields[$taxonomy] = $t;
|
1213
|
+
}
|
1214
|
+
|
1215
|
+
// Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default
|
1216
|
+
// The recursive merge is easily traversed with array casting: foreach( (array) $things as $thing )
|
1217
|
+
$form_fields = array_merge_recursive($form_fields, (array) $errors);
|
1218
|
+
|
1219
|
+
// This was formerly in image_attachment_fields_to_edit().
|
1220
|
+
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
|
1221
|
+
$alt = get_post_meta($post->ID, '_wp_attachment_image_alt', true);
|
1222
|
+
if ( empty($alt) )
|
1223
|
+
$alt = '';
|
1224
|
+
|
1225
|
+
$form_fields['post_title']['required'] = true;
|
1226
|
+
|
1227
|
+
$form_fields['image_alt'] = array(
|
1228
|
+
'value' => $alt,
|
1229
|
+
'label' => __('Alternative Text'),
|
1230
|
+
'helps' => __('Alt text for the image, e.g. “The Mona Lisa”')
|
1231
|
+
);
|
1232
|
+
|
1233
|
+
$form_fields['align'] = array(
|
1234
|
+
'label' => __('Alignment'),
|
1235
|
+
'input' => 'html',
|
1236
|
+
'html' => image_align_input_fields($post, get_option('image_default_align')),
|
1237
|
+
);
|
1238
|
+
|
1239
|
+
$form_fields['image-size'] = image_size_input_fields( $post, get_option('image_default_size', 'medium') );
|
1240
|
+
|
1241
|
+
} else {
|
1242
|
+
unset( $form_fields['image_alt'] );
|
1243
|
+
}
|
1244
|
+
|
1245
|
+
/**
|
1246
|
+
* Filter the attachment fields to edit.
|
1247
|
+
*
|
1248
|
+
* @since 2.5.0
|
1249
|
+
*
|
1250
|
+
* @param array $form_fields An array of attachment form fields.
|
1251
|
+
* @param WP_Post $post The WP_Post attachment object.
|
1252
|
+
*/
|
1253
|
+
$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
|
1254
|
+
|
1255
|
+
return $form_fields;
|
1256
|
+
}
|
1257
|
+
|
1258
|
+
/**
|
1259
|
+
* Retrieve HTML for media items of post gallery.
|
1260
|
+
*
|
1261
|
+
* The HTML markup retrieved will be created for the progress of SWF Upload
|
1262
|
+
* component. Will also create link for showing and hiding the form to modify
|
1263
|
+
* the image attachment.
|
1264
|
+
*
|
1265
|
+
* @since 2.5.0
|
1266
|
+
*
|
1267
|
+
* @param int $post_id Optional. Post ID.
|
1268
|
+
* @param array $errors Errors for attachment, if any.
|
1269
|
+
* @return string
|
1270
|
+
*/
|
1271
|
+
function get_media_items( $post_id, $errors ) {
|
1272
|
+
$attachments = array();
|
1273
|
+
if ( $post_id ) {
|
1274
|
+
$post = get_post($post_id);
|
1275
|
+
if ( $post && $post->post_type == 'attachment' )
|
1276
|
+
$attachments = array($post->ID => $post);
|
1277
|
+
else
|
1278
|
+
$attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') );
|
1279
|
+
} else {
|
1280
|
+
if ( is_array($GLOBALS['wp_the_query']->posts) )
|
1281
|
+
foreach ( $GLOBALS['wp_the_query']->posts as $attachment )
|
1282
|
+
$attachments[$attachment->ID] = $attachment;
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
$output = '';
|
1286
|
+
foreach ( (array) $attachments as $id => $attachment ) {
|
1287
|
+
if ( $attachment->post_status == 'trash' )
|
1288
|
+
continue;
|
1289
|
+
if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) )
|
1290
|
+
$output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress hidden'><div class='bar'></div></div><div id='media-upload-error-$id' class='hidden'></div><div class='filename hidden'></div>$item\n</div>";
|
1291
|
+
}
|
1292
|
+
|
1293
|
+
return $output;
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
/**
|
1297
|
+
* Retrieve HTML form for modifying the image attachment.
|
1298
|
+
*
|
1299
|
+
* @since 2.5.0
|
1300
|
+
*
|
1301
|
+
* @param int $attachment_id Attachment ID for modification.
|
1302
|
+
* @param string|array $args Optional. Override defaults.
|
1303
|
+
* @return string HTML form for attachment.
|
1304
|
+
*/
|
1305
|
+
function get_media_item( $attachment_id, $args = null ) {
|
1306
|
+
global $redir_tab;
|
1307
|
+
|
1308
|
+
if ( ( $attachment_id = intval( $attachment_id ) ) && $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ) )
|
1309
|
+
$thumb_url = $thumb_url[0];
|
1310
|
+
else
|
1311
|
+
$thumb_url = false;
|
1312
|
+
|
1313
|
+
$post = get_post( $attachment_id );
|
1314
|
+
$current_post_id = !empty( $_GET['post_id'] ) ? (int) $_GET['post_id'] : 0;
|
1315
|
+
|
1316
|
+
$default_args = array(
|
1317
|
+
'errors' => null,
|
1318
|
+
'send' => $current_post_id ? post_type_supports( get_post_type( $current_post_id ), 'editor' ) : true,
|
1319
|
+
'delete' => true,
|
1320
|
+
'toggle' => true,
|
1321
|
+
'show_title' => true
|
1322
|
+
);
|
1323
|
+
$args = wp_parse_args( $args, $default_args );
|
1324
|
+
|
1325
|
+
/**
|
1326
|
+
* Filter the arguments used to retrieve an image for the edit image form.
|
1327
|
+
*
|
1328
|
+
* @since 3.1.0
|
1329
|
+
*
|
1330
|
+
* @see get_media_item
|
1331
|
+
*
|
1332
|
+
* @param array $args An array of arguments.
|
1333
|
+
*/
|
1334
|
+
$r = apply_filters( 'get_media_item_args', $args );
|
1335
|
+
|
1336
|
+
$toggle_on = __( 'Show' );
|
1337
|
+
$toggle_off = __( 'Hide' );
|
1338
|
+
|
1339
|
+
$filename = esc_html( wp_basename( $post->guid ) );
|
1340
|
+
$title = esc_attr( $post->post_title );
|
1341
|
+
|
1342
|
+
$post_mime_types = get_post_mime_types();
|
1343
|
+
$keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) );
|
1344
|
+
$type = array_shift( $keys );
|
1345
|
+
$type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
|
1346
|
+
|
1347
|
+
$form_fields = get_attachment_fields_to_edit( $post, $r['errors'] );
|
1348
|
+
|
1349
|
+
if ( $r['toggle'] ) {
|
1350
|
+
$class = empty( $r['errors'] ) ? 'startclosed' : 'startopen';
|
1351
|
+
$toggle_links = "
|
1352
|
+
<a class='toggle describe-toggle-on' href='#'>$toggle_on</a>
|
1353
|
+
<a class='toggle describe-toggle-off' href='#'>$toggle_off</a>";
|
1354
|
+
} else {
|
1355
|
+
$class = '';
|
1356
|
+
$toggle_links = '';
|
1357
|
+
}
|
1358
|
+
|
1359
|
+
$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
|
1360
|
+
$display_title = $r['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . "</span></div>" : '';
|
1361
|
+
|
1362
|
+
$gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) );
|
1363
|
+
$order = '';
|
1364
|
+
|
1365
|
+
foreach ( $form_fields as $key => $val ) {
|
1366
|
+
if ( 'menu_order' == $key ) {
|
1367
|
+
if ( $gallery )
|
1368
|
+
$order = "<div class='menu_order'> <input class='menu_order_input' type='text' id='attachments[$attachment_id][menu_order]' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ). "' /></div>";
|
1369
|
+
else
|
1370
|
+
$order = "<input type='hidden' name='attachments[$attachment_id][menu_order]' value='" . esc_attr( $val['value'] ) . "' />";
|
1371
|
+
|
1372
|
+
unset( $form_fields['menu_order'] );
|
1373
|
+
break;
|
1374
|
+
}
|
1375
|
+
}
|
1376
|
+
|
1377
|
+
$media_dims = '';
|
1378
|
+
$meta = wp_get_attachment_metadata( $post->ID );
|
1379
|
+
if ( isset( $meta['width'], $meta['height'] ) )
|
1380
|
+
$media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> ";
|
1381
|
+
|
1382
|
+
/**
|
1383
|
+
* Filter the media metadata.
|
1384
|
+
*
|
1385
|
+
* @since 2.5.0
|
1386
|
+
*
|
1387
|
+
* @param string $media_dims The HTML markup containing the media dimensions.
|
1388
|
+
* @param WP_Post $post The WP_Post attachment object.
|
1389
|
+
*/
|
1390
|
+
$media_dims = apply_filters( 'media_meta', $media_dims, $post );
|
1391
|
+
|
1392
|
+
$image_edit_button = '';
|
1393
|
+
if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
|
1394
|
+
$nonce = wp_create_nonce( "image_editor-$post->ID" );
|
1395
|
+
$image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
|
1396
|
+
}
|
1397
|
+
|
1398
|
+
$attachment_url = get_permalink( $attachment_id );
|
1399
|
+
|
1400
|
+
$item = "
|
1401
|
+
$type_html
|
1402
|
+
$toggle_links
|
1403
|
+
$order
|
1404
|
+
$display_title
|
1405
|
+
<table class='slidetoggle describe $class'>
|
1406
|
+
<thead class='media-item-info' id='media-head-$post->ID'>
|
1407
|
+
<tr>
|
1408
|
+
<td class='A1B1' id='thumbnail-head-$post->ID'>
|
1409
|
+
<p><a href='$attachment_url' target='_blank'><img class='thumbnail' src='$thumb_url' alt='' /></a></p>
|
1410
|
+
<p>$image_edit_button</p>
|
1411
|
+
</td>
|
1412
|
+
<td>
|
1413
|
+
<p><strong>" . __('File name:') . "</strong> $filename</p>
|
1414
|
+
<p><strong>" . __('File type:') . "</strong> $post->post_mime_type</p>
|
1415
|
+
<p><strong>" . __('Upload date:') . "</strong> " . mysql2date( get_option('date_format'), $post->post_date ). '</p>';
|
1416
|
+
if ( !empty( $media_dims ) )
|
1417
|
+
$item .= "<p><strong>" . __('Dimensions:') . "</strong> $media_dims</p>\n";
|
1418
|
+
|
1419
|
+
$item .= "</td></tr>\n";
|
1420
|
+
|
1421
|
+
$item .= "
|
1422
|
+
</thead>
|
1423
|
+
<tbody>
|
1424
|
+
<tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>
|
1425
|
+
<tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n";
|
1426
|
+
|
1427
|
+
$defaults = array(
|
1428
|
+
'input' => 'text',
|
1429
|
+
'required' => false,
|
1430
|
+
'value' => '',
|
1431
|
+
'extra_rows' => array(),
|
1432
|
+
);
|
1433
|
+
|
1434
|
+
if ( $r['send'] ) {
|
1435
|
+
$r['send'] = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false );
|
1436
|
+
}
|
1437
|
+
|
1438
|
+
$delete = empty( $r['delete'] ) ? '' : $r['delete'];
|
1439
|
+
if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {
|
1440
|
+
if ( !EMPTY_TRASH_DAYS ) {
|
1441
|
+
$delete = "<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete-permanently'>" . __( 'Delete Permanently' ) . '</a>';
|
1442
|
+
} elseif ( !MEDIA_TRASH ) {
|
1443
|
+
$delete = "<a href='#' class='del-link' onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __( 'Delete' ) . "</a>
|
1444
|
+
<div id='del_attachment_$attachment_id' class='del-attachment' style='display:none;'><p>" . sprintf( __( 'You are about to delete <strong>%s</strong>.' ), $filename ) . "</p>
|
1445
|
+
<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='button'>" . __( 'Continue' ) . "</a>
|
1446
|
+
<a href='#' class='button' onclick=\"this.parentNode.style.display='none';return false;\">" . __( 'Cancel' ) . "</a>
|
1447
|
+
</div>";
|
1448
|
+
} else {
|
1449
|
+
$delete = "<a href='" . wp_nonce_url( "post.php?action=trash&post=$attachment_id", 'trash-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Move to Trash' ) . "</a>
|
1450
|
+
<a href='" . wp_nonce_url( "post.php?action=untrash&post=$attachment_id", 'untrash-post_' . $attachment_id ) . "' id='undo[$attachment_id]' class='undo hidden'>" . __( 'Undo' ) . "</a>";
|
1451
|
+
}
|
1452
|
+
} else {
|
1453
|
+
$delete = '';
|
1454
|
+
}
|
1455
|
+
|
1456
|
+
$thumbnail = '';
|
1457
|
+
$calling_post_id = 0;
|
1458
|
+
if ( isset( $_GET['post_id'] ) ) {
|
1459
|
+
$calling_post_id = absint( $_GET['post_id'] );
|
1460
|
+
} elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set
|
1461
|
+
$calling_post_id = $post->post_parent;
|
1462
|
+
}
|
1463
|
+
if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
|
1464
|
+
&& post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
|
1465
|
+
$ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
|
1466
|
+
$thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html__( "Use as featured image" ) . "</a>";
|
1467
|
+
}
|
1468
|
+
|
1469
|
+
if ( ( $r['send'] || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) {
|
1470
|
+
$form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>" . $r['send'] . " $thumbnail $delete</td></tr>\n" );
|
1471
|
+
}
|
1472
|
+
$hidden_fields = array();
|
1473
|
+
|
1474
|
+
foreach ( $form_fields as $id => $field ) {
|
1475
|
+
if ( $id[0] == '_' )
|
1476
|
+
continue;
|
1477
|
+
|
1478
|
+
if ( !empty( $field['tr'] ) ) {
|
1479
|
+
$item .= $field['tr'];
|
1480
|
+
continue;
|
1481
|
+
}
|
1482
|
+
|
1483
|
+
$field = array_merge( $defaults, $field );
|
1484
|
+
$name = "attachments[$attachment_id][$id]";
|
1485
|
+
|
1486
|
+
if ( $field['input'] == 'hidden' ) {
|
1487
|
+
$hidden_fields[$name] = $field['value'];
|
1488
|
+
continue;
|
1489
|
+
}
|
1490
|
+
|
1491
|
+
$required = $field['required'] ? '<span class="alignright"><abbr title="required" class="required">*</abbr></span>' : '';
|
1492
|
+
$aria_required = $field['required'] ? " aria-required='true' " : '';
|
1493
|
+
$class = $id;
|
1494
|
+
$class .= $field['required'] ? ' form-required' : '';
|
1495
|
+
|
1496
|
+
$item .= "\t\t<tr class='$class'>\n\t\t\t<th scope='row' class='label'><label for='$name'><span class='alignleft'>{$field['label']}</span>$required<br class='clear' /></label></th>\n\t\t\t<td class='field'>";
|
1497
|
+
if ( !empty( $field[ $field['input'] ] ) )
|
1498
|
+
$item .= $field[ $field['input'] ];
|
1499
|
+
elseif ( $field['input'] == 'textarea' ) {
|
1500
|
+
if ( 'post_content' == $id && user_can_richedit() ) {
|
1501
|
+
// Sanitize_post() skips the post_content when user_can_richedit.
|
1502
|
+
$field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES );
|
1503
|
+
}
|
1504
|
+
// Post_excerpt is already escaped by sanitize_post() in get_attachment_fields_to_edit().
|
1505
|
+
$item .= "<textarea id='$name' name='$name' $aria_required>" . $field['value'] . '</textarea>';
|
1506
|
+
} else {
|
1507
|
+
$item .= "<input type='text' class='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "' $aria_required />";
|
1508
|
+
}
|
1509
|
+
if ( !empty( $field['helps'] ) )
|
1510
|
+
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
|
1511
|
+
$item .= "</td>\n\t\t</tr>\n";
|
1512
|
+
|
1513
|
+
$extra_rows = array();
|
1514
|
+
|
1515
|
+
if ( !empty( $field['errors'] ) )
|
1516
|
+
foreach ( array_unique( (array) $field['errors'] ) as $error )
|
1517
|
+
$extra_rows['error'][] = $error;
|
1518
|
+
|
1519
|
+
if ( !empty( $field['extra_rows'] ) )
|
1520
|
+
foreach ( $field['extra_rows'] as $class => $rows )
|
1521
|
+
foreach ( (array) $rows as $html )
|
1522
|
+
$extra_rows[$class][] = $html;
|
1523
|
+
|
1524
|
+
foreach ( $extra_rows as $class => $rows )
|
1525
|
+
foreach ( $rows as $html )
|
1526
|
+
$item .= "\t\t<tr><td></td><td class='$class'>$html</td></tr>\n";
|
1527
|
+
}
|
1528
|
+
|
1529
|
+
if ( !empty( $form_fields['_final'] ) )
|
1530
|
+
$item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n";
|
1531
|
+
$item .= "\t</tbody>\n";
|
1532
|
+
$item .= "\t</table>\n";
|
1533
|
+
|
1534
|
+
foreach ( $hidden_fields as $name => $value )
|
1535
|
+
$item .= "\t<input type='hidden' name='$name' id='$name' value='" . esc_attr( $value ) . "' />\n";
|
1536
|
+
|
1537
|
+
if ( $post->post_parent < 1 && isset( $_REQUEST['post_id'] ) ) {
|
1538
|
+
$parent = (int) $_REQUEST['post_id'];
|
1539
|
+
$parent_name = "attachments[$attachment_id][post_parent]";
|
1540
|
+
$item .= "\t<input type='hidden' name='$parent_name' id='$parent_name' value='$parent' />\n";
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
return $item;
|
1544
|
+
}
|
1545
|
+
|
1546
|
+
function get_compat_media_markup( $attachment_id, $args = null ) {
|
1547
|
+
$post = get_post( $attachment_id );
|
1548
|
+
|
1549
|
+
$default_args = array(
|
1550
|
+
'errors' => null,
|
1551
|
+
'in_modal' => false,
|
1552
|
+
);
|
1553
|
+
|
1554
|
+
$user_can_edit = current_user_can( 'edit_post', $attachment_id );
|
1555
|
+
|
1556
|
+
$args = wp_parse_args( $args, $default_args );
|
1557
|
+
|
1558
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
1559
|
+
$args = apply_filters( 'get_media_item_args', $args );
|
1560
|
+
|
1561
|
+
$form_fields = array();
|
1562
|
+
|
1563
|
+
if ( $args['in_modal'] ) {
|
1564
|
+
foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
|
1565
|
+
$t = (array) get_taxonomy($taxonomy);
|
1566
|
+
if ( ! $t['public'] || ! $t['show_ui'] )
|
1567
|
+
continue;
|
1568
|
+
if ( empty($t['label']) )
|
1569
|
+
$t['label'] = $taxonomy;
|
1570
|
+
if ( empty($t['args']) )
|
1571
|
+
$t['args'] = array();
|
1572
|
+
|
1573
|
+
$terms = get_object_term_cache($post->ID, $taxonomy);
|
1574
|
+
if ( false === $terms )
|
1575
|
+
$terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']);
|
1576
|
+
|
1577
|
+
$values = array();
|
1578
|
+
|
1579
|
+
foreach ( $terms as $term )
|
1580
|
+
$values[] = $term->slug;
|
1581
|
+
$t['value'] = join(', ', $values);
|
1582
|
+
$t['taxonomy'] = true;
|
1583
|
+
|
1584
|
+
$form_fields[$taxonomy] = $t;
|
1585
|
+
}
|
1586
|
+
}
|
1587
|
+
|
1588
|
+
// Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default
|
1589
|
+
// The recursive merge is easily traversed with array casting: foreach( (array) $things as $thing )
|
1590
|
+
$form_fields = array_merge_recursive($form_fields, (array) $args['errors'] );
|
1591
|
+
|
1592
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
1593
|
+
$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
|
1594
|
+
|
1595
|
+
unset( $form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'],
|
1596
|
+
$form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'],
|
1597
|
+
$form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] );
|
1598
|
+
|
1599
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
1600
|
+
$media_meta = apply_filters( 'media_meta', '', $post );
|
1601
|
+
|
1602
|
+
$defaults = array(
|
1603
|
+
'input' => 'text',
|
1604
|
+
'required' => false,
|
1605
|
+
'value' => '',
|
1606
|
+
'extra_rows' => array(),
|
1607
|
+
'show_in_edit' => true,
|
1608
|
+
'show_in_modal' => true,
|
1609
|
+
);
|
1610
|
+
|
1611
|
+
$hidden_fields = array();
|
1612
|
+
|
1613
|
+
$item = '';
|
1614
|
+
foreach ( $form_fields as $id => $field ) {
|
1615
|
+
if ( $id[0] == '_' )
|
1616
|
+
continue;
|
1617
|
+
|
1618
|
+
$name = "attachments[$attachment_id][$id]";
|
1619
|
+
$id_attr = "attachments-$attachment_id-$id";
|
1620
|
+
|
1621
|
+
if ( !empty( $field['tr'] ) ) {
|
1622
|
+
$item .= $field['tr'];
|
1623
|
+
continue;
|
1624
|
+
}
|
1625
|
+
|
1626
|
+
$field = array_merge( $defaults, $field );
|
1627
|
+
|
1628
|
+
if ( ( ! $field['show_in_edit'] && ! $args['in_modal'] ) || ( ! $field['show_in_modal'] && $args['in_modal'] ) )
|
1629
|
+
continue;
|
1630
|
+
|
1631
|
+
if ( $field['input'] == 'hidden' ) {
|
1632
|
+
$hidden_fields[$name] = $field['value'];
|
1633
|
+
continue;
|
1634
|
+
}
|
1635
|
+
|
1636
|
+
$readonly = ! $user_can_edit && ! empty( $field['taxonomy'] ) ? " readonly='readonly' " : '';
|
1637
|
+
$required = $field['required'] ? '<span class="alignright"><abbr title="required" class="required">*</abbr></span>' : '';
|
1638
|
+
$aria_required = $field['required'] ? " aria-required='true' " : '';
|
1639
|
+
$class = 'compat-field-' . $id;
|
1640
|
+
$class .= $field['required'] ? ' form-required' : '';
|
1641
|
+
|
1642
|
+
$item .= "\t\t<tr class='$class'>";
|
1643
|
+
$item .= "\t\t\t<th scope='row' class='label'><label for='$id_attr'><span class='alignleft'>{$field['label']}</span>$required<br class='clear' /></label>";
|
1644
|
+
$item .= "</th>\n\t\t\t<td class='field'>";
|
1645
|
+
|
1646
|
+
if ( !empty( $field[ $field['input'] ] ) )
|
1647
|
+
$item .= $field[ $field['input'] ];
|
1648
|
+
elseif ( $field['input'] == 'textarea' ) {
|
1649
|
+
if ( 'post_content' == $id && user_can_richedit() ) {
|
1650
|
+
// sanitize_post() skips the post_content when user_can_richedit.
|
1651
|
+
$field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES );
|
1652
|
+
}
|
1653
|
+
$item .= "<textarea id='$id_attr' name='$name' $aria_required>" . $field['value'] . '</textarea>';
|
1654
|
+
} else {
|
1655
|
+
$item .= "<input type='text' class='text' id='$id_attr' name='$name' value='" . esc_attr( $field['value'] ) . "' $readonly $aria_required />";
|
1656
|
+
}
|
1657
|
+
if ( !empty( $field['helps'] ) )
|
1658
|
+
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>';
|
1659
|
+
$item .= "</td>\n\t\t</tr>\n";
|
1660
|
+
|
1661
|
+
$extra_rows = array();
|
1662
|
+
|
1663
|
+
if ( !empty( $field['errors'] ) )
|
1664
|
+
foreach ( array_unique( (array) $field['errors'] ) as $error )
|
1665
|
+
$extra_rows['error'][] = $error;
|
1666
|
+
|
1667
|
+
if ( !empty( $field['extra_rows'] ) )
|
1668
|
+
foreach ( $field['extra_rows'] as $class => $rows )
|
1669
|
+
foreach ( (array) $rows as $html )
|
1670
|
+
$extra_rows[$class][] = $html;
|
1671
|
+
|
1672
|
+
foreach ( $extra_rows as $class => $rows )
|
1673
|
+
foreach ( $rows as $html )
|
1674
|
+
$item .= "\t\t<tr><td></td><td class='$class'>$html</td></tr>\n";
|
1675
|
+
}
|
1676
|
+
|
1677
|
+
if ( !empty( $form_fields['_final'] ) )
|
1678
|
+
$item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n";
|
1679
|
+
if ( $item )
|
1680
|
+
$item = '<table class="compat-attachment-fields">' . $item . '</table>';
|
1681
|
+
|
1682
|
+
foreach ( $hidden_fields as $hidden_field => $value ) {
|
1683
|
+
$item .= '<input type="hidden" name="' . esc_attr( $hidden_field ) . '" value="' . esc_attr( $value ) . '" />' . "\n";
|
1684
|
+
}
|
1685
|
+
|
1686
|
+
if ( $item )
|
1687
|
+
$item = '<input type="hidden" name="attachments[' . $attachment_id . '][menu_order]" value="' . esc_attr( $post->menu_order ) . '" />' . $item;
|
1688
|
+
|
1689
|
+
return array(
|
1690
|
+
'item' => $item,
|
1691
|
+
'meta' => $media_meta,
|
1692
|
+
);
|
1693
|
+
}
|
1694
|
+
|
1695
|
+
/**
|
1696
|
+
* {@internal Missing Short Description}}
|
1697
|
+
*
|
1698
|
+
* @since 2.5.0
|
1699
|
+
*/
|
1700
|
+
function media_upload_header() {
|
1701
|
+
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
|
1702
|
+
echo '<script type="text/javascript">post_id = ' . $post_id . ";</script>\n";
|
1703
|
+
if ( empty( $_GET['chromeless'] ) ) {
|
1704
|
+
echo '<div id="media-upload-header">';
|
1705
|
+
the_media_upload_tabs();
|
1706
|
+
echo '</div>';
|
1707
|
+
}
|
1708
|
+
}
|
1709
|
+
|
1710
|
+
/**
|
1711
|
+
* {@internal Missing Short Description}}
|
1712
|
+
*
|
1713
|
+
* @since 2.5.0
|
1714
|
+
*
|
1715
|
+
* @param unknown_type $errors
|
1716
|
+
*/
|
1717
|
+
function media_upload_form( $errors = null ) {
|
1718
|
+
global $type, $tab, $is_IE, $is_opera;
|
1719
|
+
|
1720
|
+
if ( ! _device_can_upload() ) {
|
1721
|
+
echo '<p>' . sprintf( __('The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.'), 'https://apps.wordpress.org/' ) . '</p>';
|
1722
|
+
return;
|
1723
|
+
}
|
1724
|
+
|
1725
|
+
$upload_action_url = admin_url('async-upload.php');
|
1726
|
+
$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
|
1727
|
+
$_type = isset($type) ? $type : '';
|
1728
|
+
$_tab = isset($tab) ? $tab : '';
|
1729
|
+
|
1730
|
+
$max_upload_size = wp_max_upload_size();
|
1731
|
+
if ( ! $max_upload_size ) {
|
1732
|
+
$max_upload_size = 0;
|
1733
|
+
}
|
1734
|
+
?>
|
1735
|
+
|
1736
|
+
<div id="media-upload-notice"><?php
|
1737
|
+
|
1738
|
+
if (isset($errors['upload_notice']) )
|
1739
|
+
echo $errors['upload_notice'];
|
1740
|
+
|
1741
|
+
?></div>
|
1742
|
+
<div id="media-upload-error"><?php
|
1743
|
+
|
1744
|
+
if (isset($errors['upload_error']) && is_wp_error($errors['upload_error']))
|
1745
|
+
echo $errors['upload_error']->get_error_message();
|
1746
|
+
|
1747
|
+
?></div>
|
1748
|
+
<?php
|
1749
|
+
if ( is_multisite() && !is_upload_space_available() ) {
|
1750
|
+
/**
|
1751
|
+
* Fires when an upload will exceed the defined upload space quota for a network site.
|
1752
|
+
*
|
1753
|
+
* @since 3.5.0
|
1754
|
+
*/
|
1755
|
+
do_action( 'upload_ui_over_quota' );
|
1756
|
+
return;
|
1757
|
+
}
|
1758
|
+
|
1759
|
+
/**
|
1760
|
+
* Fires just before the legacy (pre-3.5.0) upload interface is loaded.
|
1761
|
+
*
|
1762
|
+
* @since 2.6.0
|
1763
|
+
*/
|
1764
|
+
do_action( 'pre-upload-ui' );
|
1765
|
+
|
1766
|
+
$post_params = array(
|
1767
|
+
"post_id" => $post_id,
|
1768
|
+
"_wpnonce" => wp_create_nonce('media-form'),
|
1769
|
+
"type" => $_type,
|
1770
|
+
"tab" => $_tab,
|
1771
|
+
"short" => "1",
|
1772
|
+
);
|
1773
|
+
|
1774
|
+
/**
|
1775
|
+
* Filter the media upload post parameters.
|
1776
|
+
*
|
1777
|
+
* @since 3.1.0 As 'swfupload_post_params'
|
1778
|
+
* @since 3.3.0
|
1779
|
+
*
|
1780
|
+
* @param array $post_params An array of media upload parameters used by Plupload.
|
1781
|
+
*/
|
1782
|
+
$post_params = apply_filters( 'upload_post_params', $post_params );
|
1783
|
+
|
1784
|
+
$plupload_init = array(
|
1785
|
+
'runtimes' => 'html5,flash,silverlight,html4',
|
1786
|
+
'browse_button' => 'plupload-browse-button',
|
1787
|
+
'container' => 'plupload-upload-ui',
|
1788
|
+
'drop_element' => 'drag-drop-area',
|
1789
|
+
'file_data_name' => 'async-upload',
|
1790
|
+
'url' => $upload_action_url,
|
1791
|
+
'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
|
1792
|
+
'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
|
1793
|
+
'filters' => array(
|
1794
|
+
'max_file_size' => $max_upload_size . 'b',
|
1795
|
+
),
|
1796
|
+
'multipart_params' => $post_params,
|
1797
|
+
);
|
1798
|
+
|
1799
|
+
// Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos
|
1800
|
+
// when enabled. See #29602.
|
1801
|
+
if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&
|
1802
|
+
strpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) {
|
1803
|
+
|
1804
|
+
$plupload_init['multi_selection'] = false;
|
1805
|
+
}
|
1806
|
+
|
1807
|
+
/**
|
1808
|
+
* Filter the default Plupload settings.
|
1809
|
+
*
|
1810
|
+
* @since 3.3.0
|
1811
|
+
*
|
1812
|
+
* @param array $plupload_init An array of default settings used by Plupload.
|
1813
|
+
*/
|
1814
|
+
$plupload_init = apply_filters( 'plupload_init', $plupload_init );
|
1815
|
+
|
1816
|
+
?>
|
1817
|
+
|
1818
|
+
<script type="text/javascript">
|
1819
|
+
<?php
|
1820
|
+
// Verify size is an int. If not return default value.
|
1821
|
+
$large_size_h = absint( get_option('large_size_h') );
|
1822
|
+
if( !$large_size_h )
|
1823
|
+
$large_size_h = 1024;
|
1824
|
+
$large_size_w = absint( get_option('large_size_w') );
|
1825
|
+
if( !$large_size_w )
|
1826
|
+
$large_size_w = 1024;
|
1827
|
+
?>
|
1828
|
+
var resize_height = <?php echo $large_size_h; ?>, resize_width = <?php echo $large_size_w; ?>,
|
1829
|
+
wpUploaderInit = <?php echo json_encode($plupload_init); ?>;
|
1830
|
+
</script>
|
1831
|
+
|
1832
|
+
<div id="plupload-upload-ui" class="hide-if-no-js">
|
1833
|
+
<?php
|
1834
|
+
/**
|
1835
|
+
* Fires before the upload interface loads.
|
1836
|
+
*
|
1837
|
+
* @since 2.6.0 As 'pre-flash-upload-ui'
|
1838
|
+
* @since 3.3.0
|
1839
|
+
*/
|
1840
|
+
do_action( 'pre-plupload-upload-ui' ); ?>
|
1841
|
+
<div id="drag-drop-area">
|
1842
|
+
<div class="drag-drop-inside">
|
1843
|
+
<p class="drag-drop-info"><?php _e('Drop files here'); ?></p>
|
1844
|
+
<p><?php _ex('or', 'Uploader: Drop files here - or - Select Files'); ?></p>
|
1845
|
+
<p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
|
1846
|
+
</div>
|
1847
|
+
</div>
|
1848
|
+
<?php
|
1849
|
+
/**
|
1850
|
+
* Fires after the upload interface loads.
|
1851
|
+
*
|
1852
|
+
* @since 2.6.0 As 'post-flash-upload-ui'
|
1853
|
+
* @since 3.3.0
|
1854
|
+
*/
|
1855
|
+
do_action( 'post-plupload-upload-ui' ); ?>
|
1856
|
+
</div>
|
1857
|
+
|
1858
|
+
<div id="html-upload-ui" class="hide-if-js">
|
1859
|
+
<?php
|
1860
|
+
/**
|
1861
|
+
* Fires before the upload button in the media upload interface.
|
1862
|
+
*
|
1863
|
+
* @since 2.6.0
|
1864
|
+
*/
|
1865
|
+
do_action( 'pre-html-upload-ui' );
|
1866
|
+
?>
|
1867
|
+
<p id="async-upload-wrap">
|
1868
|
+
<label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
|
1869
|
+
<input type="file" name="async-upload" id="async-upload" />
|
1870
|
+
<?php submit_button( __( 'Upload' ), 'button', 'html-upload', false ); ?>
|
1871
|
+
<a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
|
1872
|
+
</p>
|
1873
|
+
<div class="clear"></div>
|
1874
|
+
<?php
|
1875
|
+
/**
|
1876
|
+
* Fires after the upload button in the media upload interface.
|
1877
|
+
*
|
1878
|
+
* @since 2.6.0
|
1879
|
+
*/
|
1880
|
+
do_action( 'post-html-upload-ui' );
|
1881
|
+
?>
|
1882
|
+
</div>
|
1883
|
+
|
1884
|
+
<p class="max-upload-size"><?php printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); ?></p>
|
1885
|
+
<?php
|
1886
|
+
|
1887
|
+
/**
|
1888
|
+
* Fires on the post upload UI screen.
|
1889
|
+
*
|
1890
|
+
* Legacy (pre-3.5.0) media workflow hook.
|
1891
|
+
*
|
1892
|
+
* @since 2.6.0
|
1893
|
+
*/
|
1894
|
+
do_action( 'post-upload-ui' );
|
1895
|
+
}
|
1896
|
+
|
1897
|
+
/**
|
1898
|
+
* {@internal Missing Short Description}}
|
1899
|
+
*
|
1900
|
+
* @since 2.5.0
|
1901
|
+
*
|
1902
|
+
* @param string $type
|
1903
|
+
* @param object $errors
|
1904
|
+
* @param integer $id
|
1905
|
+
*/
|
1906
|
+
function media_upload_type_form($type = 'file', $errors = null, $id = null) {
|
1907
|
+
|
1908
|
+
media_upload_header();
|
1909
|
+
|
1910
|
+
$post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0;
|
1911
|
+
|
1912
|
+
$form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
|
1913
|
+
|
1914
|
+
/**
|
1915
|
+
* Filter the media upload form action URL.
|
1916
|
+
*
|
1917
|
+
* @since 2.6.0
|
1918
|
+
*
|
1919
|
+
* @param string $form_action_url The media upload form action URL.
|
1920
|
+
* @param string $type The type of media. Default 'file'.
|
1921
|
+
*/
|
1922
|
+
$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
|
1923
|
+
$form_class = 'media-upload-form type-form validate';
|
1924
|
+
|
1925
|
+
if ( get_user_setting('uploader') )
|
1926
|
+
$form_class .= ' html-uploader';
|
1927
|
+
?>
|
1928
|
+
|
1929
|
+
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
|
1930
|
+
<?php submit_button( '', 'hidden', 'save', false ); ?>
|
1931
|
+
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
|
1932
|
+
<?php wp_nonce_field('media-form'); ?>
|
1933
|
+
|
1934
|
+
<h3 class="media-title"><?php _e('Add media files from your computer'); ?></h3>
|
1935
|
+
|
1936
|
+
<?php media_upload_form( $errors ); ?>
|
1937
|
+
|
1938
|
+
<script type="text/javascript">
|
1939
|
+
//<![CDATA[
|
1940
|
+
jQuery(function($){
|
1941
|
+
var preloaded = $(".media-item.preloaded");
|
1942
|
+
if ( preloaded.length > 0 ) {
|
1943
|
+
preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
|
1944
|
+
}
|
1945
|
+
updateMediaForm();
|
1946
|
+
});
|
1947
|
+
//]]>
|
1948
|
+
</script>
|
1949
|
+
<div id="media-items"><?php
|
1950
|
+
|
1951
|
+
if ( $id ) {
|
1952
|
+
if ( !is_wp_error($id) ) {
|
1953
|
+
add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2);
|
1954
|
+
echo get_media_items( $id, $errors );
|
1955
|
+
} else {
|
1956
|
+
echo '<div id="media-upload-error">'.esc_html($id->get_error_message()).'</div></div>';
|
1957
|
+
exit;
|
1958
|
+
}
|
1959
|
+
}
|
1960
|
+
?></div>
|
1961
|
+
|
1962
|
+
<p class="savebutton ml-submit">
|
1963
|
+
<?php submit_button( __( 'Save all changes' ), 'button', 'save', false ); ?>
|
1964
|
+
</p>
|
1965
|
+
</form>
|
1966
|
+
<?php
|
1967
|
+
}
|
1968
|
+
|
1969
|
+
/**
|
1970
|
+
* {@internal Missing Short Description}}
|
1971
|
+
*
|
1972
|
+
* @since 2.7.0
|
1973
|
+
*
|
1974
|
+
* @param string $type
|
1975
|
+
* @param object $errors
|
1976
|
+
* @param integer $id
|
1977
|
+
*/
|
1978
|
+
function media_upload_type_url_form($type = null, $errors = null, $id = null) {
|
1979
|
+
if ( null === $type )
|
1980
|
+
$type = 'image';
|
1981
|
+
|
1982
|
+
media_upload_header();
|
1983
|
+
|
1984
|
+
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
|
1985
|
+
|
1986
|
+
$form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
|
1987
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
1988
|
+
$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
|
1989
|
+
$form_class = 'media-upload-form type-form validate';
|
1990
|
+
|
1991
|
+
if ( get_user_setting('uploader') )
|
1992
|
+
$form_class .= ' html-uploader';
|
1993
|
+
?>
|
1994
|
+
|
1995
|
+
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
|
1996
|
+
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
|
1997
|
+
<?php wp_nonce_field('media-form'); ?>
|
1998
|
+
|
1999
|
+
<h3 class="media-title"><?php _e('Insert media from another website'); ?></h3>
|
2000
|
+
|
2001
|
+
<script type="text/javascript">
|
2002
|
+
//<![CDATA[
|
2003
|
+
var addExtImage = {
|
2004
|
+
|
2005
|
+
width : '',
|
2006
|
+
height : '',
|
2007
|
+
align : 'alignnone',
|
2008
|
+
|
2009
|
+
insert : function() {
|
2010
|
+
var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = '';
|
2011
|
+
|
2012
|
+
if ( '' == f.src.value || '' == t.width )
|
2013
|
+
return false;
|
2014
|
+
|
2015
|
+
if ( f.alt.value )
|
2016
|
+
alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
2017
|
+
|
2018
|
+
<?php
|
2019
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
2020
|
+
if ( ! apply_filters( 'disable_captions', '' ) ) {
|
2021
|
+
?>
|
2022
|
+
if ( f.caption.value ) {
|
2023
|
+
caption = f.caption.value.replace(/\r\n|\r/g, '\n');
|
2024
|
+
caption = caption.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(a){
|
2025
|
+
return a.replace(/[\r\n\t]+/, ' ');
|
2026
|
+
});
|
2027
|
+
|
2028
|
+
caption = caption.replace(/\s*\n\s*/g, '<br />');
|
2029
|
+
}
|
2030
|
+
<?php } ?>
|
2031
|
+
|
2032
|
+
cls = caption ? '' : ' class="'+t.align+'"';
|
2033
|
+
|
2034
|
+
html = '<img alt="'+alt+'" src="'+f.src.value+'"'+cls+' width="'+t.width+'" height="'+t.height+'" />';
|
2035
|
+
|
2036
|
+
if ( f.url.value ) {
|
2037
|
+
url = f.url.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
2038
|
+
html = '<a href="'+url+'">'+html+'</a>';
|
2039
|
+
}
|
2040
|
+
|
2041
|
+
if ( caption )
|
2042
|
+
html = '[caption id="" align="'+t.align+'" width="'+t.width+'"]'+html+caption+'[/caption]';
|
2043
|
+
|
2044
|
+
var win = window.dialogArguments || opener || parent || top;
|
2045
|
+
win.send_to_editor(html);
|
2046
|
+
return false;
|
2047
|
+
},
|
2048
|
+
|
2049
|
+
resetImageData : function() {
|
2050
|
+
var t = addExtImage;
|
2051
|
+
|
2052
|
+
t.width = t.height = '';
|
2053
|
+
document.getElementById('go_button').style.color = '#bbb';
|
2054
|
+
if ( ! document.forms[0].src.value )
|
2055
|
+
document.getElementById('status_img').innerHTML = '*';
|
2056
|
+
else document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/no.png' ) ); ?>" alt="" />';
|
2057
|
+
},
|
2058
|
+
|
2059
|
+
updateImageData : function() {
|
2060
|
+
var t = addExtImage;
|
2061
|
+
|
2062
|
+
t.width = t.preloadImg.width;
|
2063
|
+
t.height = t.preloadImg.height;
|
2064
|
+
document.getElementById('go_button').style.color = '#333';
|
2065
|
+
document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/yes.png' ) ); ?>" alt="" />';
|
2066
|
+
},
|
2067
|
+
|
2068
|
+
getImageData : function() {
|
2069
|
+
if ( jQuery('table.describe').hasClass('not-image') )
|
2070
|
+
return;
|
2071
|
+
|
2072
|
+
var t = addExtImage, src = document.forms[0].src.value;
|
2073
|
+
|
2074
|
+
if ( ! src ) {
|
2075
|
+
t.resetImageData();
|
2076
|
+
return false;
|
2077
|
+
}
|
2078
|
+
|
2079
|
+
document.getElementById('status_img').innerHTML = '<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" width="16" />';
|
2080
|
+
t.preloadImg = new Image();
|
2081
|
+
t.preloadImg.onload = t.updateImageData;
|
2082
|
+
t.preloadImg.onerror = t.resetImageData;
|
2083
|
+
t.preloadImg.src = src;
|
2084
|
+
}
|
2085
|
+
}
|
2086
|
+
|
2087
|
+
jQuery(document).ready( function($) {
|
2088
|
+
$('.media-types input').click( function() {
|
2089
|
+
$('table.describe').toggleClass('not-image', $('#not-image').prop('checked') );
|
2090
|
+
});
|
2091
|
+
});
|
2092
|
+
|
2093
|
+
//]]>
|
2094
|
+
</script>
|
2095
|
+
|
2096
|
+
<div id="media-items">
|
2097
|
+
<div class="media-item media-blank">
|
2098
|
+
<?php
|
2099
|
+
/**
|
2100
|
+
* Filter the insert media from URL form HTML.
|
2101
|
+
*
|
2102
|
+
* @since 3.3.0
|
2103
|
+
*
|
2104
|
+
* @param string $form_html The insert from URL form HTML.
|
2105
|
+
*/
|
2106
|
+
echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) );
|
2107
|
+
?>
|
2108
|
+
</div>
|
2109
|
+
</div>
|
2110
|
+
</form>
|
2111
|
+
<?php
|
2112
|
+
}
|
2113
|
+
|
2114
|
+
/**
|
2115
|
+
* Adds gallery form to upload iframe
|
2116
|
+
*
|
2117
|
+
* @since 2.5.0
|
2118
|
+
*
|
2119
|
+
* @param array $errors
|
2120
|
+
*/
|
2121
|
+
function media_upload_gallery_form($errors) {
|
2122
|
+
global $redir_tab, $type;
|
2123
|
+
|
2124
|
+
$redir_tab = 'gallery';
|
2125
|
+
media_upload_header();
|
2126
|
+
|
2127
|
+
$post_id = intval($_REQUEST['post_id']);
|
2128
|
+
$form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id");
|
2129
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
2130
|
+
$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
|
2131
|
+
$form_class = 'media-upload-form validate';
|
2132
|
+
|
2133
|
+
if ( get_user_setting('uploader') )
|
2134
|
+
$form_class .= ' html-uploader';
|
2135
|
+
?>
|
2136
|
+
|
2137
|
+
<script type="text/javascript">
|
2138
|
+
jQuery(function($){
|
2139
|
+
var preloaded = $(".media-item.preloaded");
|
2140
|
+
if ( preloaded.length > 0 ) {
|
2141
|
+
preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
|
2142
|
+
updateMediaForm();
|
2143
|
+
}
|
2144
|
+
});
|
2145
|
+
</script>
|
2146
|
+
<div id="sort-buttons" class="hide-if-no-js">
|
2147
|
+
<span>
|
2148
|
+
<?php _e('All Tabs:'); ?>
|
2149
|
+
<a href="#" id="showall"><?php _e('Show'); ?></a>
|
2150
|
+
<a href="#" id="hideall" style="display:none;"><?php _e('Hide'); ?></a>
|
2151
|
+
</span>
|
2152
|
+
<?php _e('Sort Order:'); ?>
|
2153
|
+
<a href="#" id="asc"><?php _e('Ascending'); ?></a> |
|
2154
|
+
<a href="#" id="desc"><?php _e('Descending'); ?></a> |
|
2155
|
+
<a href="#" id="clear"><?php _ex('Clear', 'verb'); ?></a>
|
2156
|
+
</div>
|
2157
|
+
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="gallery-form">
|
2158
|
+
<?php wp_nonce_field('media-form'); ?>
|
2159
|
+
<?php //media_upload_form( $errors ); ?>
|
2160
|
+
<table class="widefat">
|
2161
|
+
<thead><tr>
|
2162
|
+
<th><?php _e('Media'); ?></th>
|
2163
|
+
<th class="order-head"><?php _e('Order'); ?></th>
|
2164
|
+
<th class="actions-head"><?php _e('Actions'); ?></th>
|
2165
|
+
</tr></thead>
|
2166
|
+
</table>
|
2167
|
+
<div id="media-items">
|
2168
|
+
<?php add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2); ?>
|
2169
|
+
<?php echo get_media_items($post_id, $errors); ?>
|
2170
|
+
</div>
|
2171
|
+
|
2172
|
+
<p class="ml-submit">
|
2173
|
+
<?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false, array( 'id' => 'save-all', 'style' => 'display: none;' ) ); ?>
|
2174
|
+
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
|
2175
|
+
<input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
|
2176
|
+
<input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" />
|
2177
|
+
</p>
|
2178
|
+
|
2179
|
+
<div id="gallery-settings" style="display:none;">
|
2180
|
+
<div class="title"><?php _e('Gallery Settings'); ?></div>
|
2181
|
+
<table id="basic" class="describe"><tbody>
|
2182
|
+
<tr>
|
2183
|
+
<th scope="row" class="label">
|
2184
|
+
<label>
|
2185
|
+
<span class="alignleft"><?php _e('Link thumbnails to:'); ?></span>
|
2186
|
+
</label>
|
2187
|
+
</th>
|
2188
|
+
<td class="field">
|
2189
|
+
<input type="radio" name="linkto" id="linkto-file" value="file" />
|
2190
|
+
<label for="linkto-file" class="radio"><?php _e('Image File'); ?></label>
|
2191
|
+
|
2192
|
+
<input type="radio" checked="checked" name="linkto" id="linkto-post" value="post" />
|
2193
|
+
<label for="linkto-post" class="radio"><?php _e('Attachment Page'); ?></label>
|
2194
|
+
</td>
|
2195
|
+
</tr>
|
2196
|
+
|
2197
|
+
<tr>
|
2198
|
+
<th scope="row" class="label">
|
2199
|
+
<label>
|
2200
|
+
<span class="alignleft"><?php _e('Order images by:'); ?></span>
|
2201
|
+
</label>
|
2202
|
+
</th>
|
2203
|
+
<td class="field">
|
2204
|
+
<select id="orderby" name="orderby">
|
2205
|
+
<option value="menu_order" selected="selected"><?php _e('Menu order'); ?></option>
|
2206
|
+
<option value="title"><?php _e('Title'); ?></option>
|
2207
|
+
<option value="post_date"><?php _e('Date/Time'); ?></option>
|
2208
|
+
<option value="rand"><?php _e('Random'); ?></option>
|
2209
|
+
</select>
|
2210
|
+
</td>
|
2211
|
+
</tr>
|
2212
|
+
|
2213
|
+
<tr>
|
2214
|
+
<th scope="row" class="label">
|
2215
|
+
<label>
|
2216
|
+
<span class="alignleft"><?php _e('Order:'); ?></span>
|
2217
|
+
</label>
|
2218
|
+
</th>
|
2219
|
+
<td class="field">
|
2220
|
+
<input type="radio" checked="checked" name="order" id="order-asc" value="asc" />
|
2221
|
+
<label for="order-asc" class="radio"><?php _e('Ascending'); ?></label>
|
2222
|
+
|
2223
|
+
<input type="radio" name="order" id="order-desc" value="desc" />
|
2224
|
+
<label for="order-desc" class="radio"><?php _e('Descending'); ?></label>
|
2225
|
+
</td>
|
2226
|
+
</tr>
|
2227
|
+
|
2228
|
+
<tr>
|
2229
|
+
<th scope="row" class="label">
|
2230
|
+
<label>
|
2231
|
+
<span class="alignleft"><?php _e('Gallery columns:'); ?></span>
|
2232
|
+
</label>
|
2233
|
+
</th>
|
2234
|
+
<td class="field">
|
2235
|
+
<select id="columns" name="columns">
|
2236
|
+
<option value="1">1</option>
|
2237
|
+
<option value="2">2</option>
|
2238
|
+
<option value="3" selected="selected">3</option>
|
2239
|
+
<option value="4">4</option>
|
2240
|
+
<option value="5">5</option>
|
2241
|
+
<option value="6">6</option>
|
2242
|
+
<option value="7">7</option>
|
2243
|
+
<option value="8">8</option>
|
2244
|
+
<option value="9">9</option>
|
2245
|
+
</select>
|
2246
|
+
</td>
|
2247
|
+
</tr>
|
2248
|
+
</tbody></table>
|
2249
|
+
|
2250
|
+
<p class="ml-submit">
|
2251
|
+
<input type="button" class="button" style="display:none;" onMouseDown="wpgallery.update();" name="insert-gallery" id="insert-gallery" value="<?php esc_attr_e( 'Insert gallery' ); ?>" />
|
2252
|
+
<input type="button" class="button" style="display:none;" onMouseDown="wpgallery.update();" name="update-gallery" id="update-gallery" value="<?php esc_attr_e( 'Update gallery settings' ); ?>" />
|
2253
|
+
</p>
|
2254
|
+
</div>
|
2255
|
+
</form>
|
2256
|
+
<?php
|
2257
|
+
}
|
2258
|
+
|
2259
|
+
/**
|
2260
|
+
* {@internal Missing Short Description}}
|
2261
|
+
*
|
2262
|
+
* @since 2.5.0
|
2263
|
+
*
|
2264
|
+
* @param array $errors
|
2265
|
+
*/
|
2266
|
+
function media_upload_library_form($errors) {
|
2267
|
+
global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
|
2268
|
+
|
2269
|
+
media_upload_header();
|
2270
|
+
|
2271
|
+
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
|
2272
|
+
|
2273
|
+
$form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
|
2274
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
2275
|
+
$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
|
2276
|
+
$form_class = 'media-upload-form validate';
|
2277
|
+
|
2278
|
+
if ( get_user_setting('uploader') )
|
2279
|
+
$form_class .= ' html-uploader';
|
2280
|
+
|
2281
|
+
$q = $_GET;
|
2282
|
+
$q['posts_per_page'] = 10;
|
2283
|
+
$q['paged'] = isset( $q['paged'] ) ? intval( $q['paged'] ) : 0;
|
2284
|
+
if ( $q['paged'] < 1 ) {
|
2285
|
+
$q['paged'] = 1;
|
2286
|
+
}
|
2287
|
+
$q['offset'] = ( $q['paged'] - 1 ) * 10;
|
2288
|
+
if ( $q['offset'] < 1 ) {
|
2289
|
+
$q['offset'] = 0;
|
2290
|
+
}
|
2291
|
+
|
2292
|
+
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query( $q );
|
2293
|
+
|
2294
|
+
?>
|
2295
|
+
|
2296
|
+
<form id="filter" action="" method="get">
|
2297
|
+
<input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" />
|
2298
|
+
<input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" />
|
2299
|
+
<input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
|
2300
|
+
<input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>" />
|
2301
|
+
<input type="hidden" name="context" value="<?php echo isset( $_GET['context'] ) ? esc_attr( $_GET['context'] ) : ''; ?>" />
|
2302
|
+
|
2303
|
+
<p id="media-search" class="search-box">
|
2304
|
+
<label class="screen-reader-text" for="media-search-input"><?php _e('Search Media');?>:</label>
|
2305
|
+
<input type="search" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
|
2306
|
+
<?php submit_button( __( 'Search Media' ), 'button', '', false ); ?>
|
2307
|
+
</p>
|
2308
|
+
|
2309
|
+
<ul class="subsubsub">
|
2310
|
+
<?php
|
2311
|
+
$type_links = array();
|
2312
|
+
$_num_posts = (array) wp_count_attachments();
|
2313
|
+
$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
|
2314
|
+
foreach ( $matches as $_type => $reals )
|
2315
|
+
foreach ( $reals as $real )
|
2316
|
+
if ( isset($num_posts[$_type]) )
|
2317
|
+
$num_posts[$_type] += $_num_posts[$real];
|
2318
|
+
else
|
2319
|
+
$num_posts[$_type] = $_num_posts[$real];
|
2320
|
+
// If available type specified by media button clicked, filter by that type
|
2321
|
+
if ( empty($_GET['post_mime_type']) && !empty($num_posts[$type]) ) {
|
2322
|
+
$_GET['post_mime_type'] = $type;
|
2323
|
+
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
|
2324
|
+
}
|
2325
|
+
if ( empty($_GET['post_mime_type']) || $_GET['post_mime_type'] == 'all' )
|
2326
|
+
$class = ' class="current"';
|
2327
|
+
else
|
2328
|
+
$class = '';
|
2329
|
+
$type_links[] = '<li><a href="' . esc_url(add_query_arg(array('post_mime_type'=>'all', 'paged'=>false, 'm'=>false))) . '"' . $class . '>' . __('All Types') . '</a>';
|
2330
|
+
foreach ( $post_mime_types as $mime_type => $label ) {
|
2331
|
+
$class = '';
|
2332
|
+
|
2333
|
+
if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) )
|
2334
|
+
continue;
|
2335
|
+
|
2336
|
+
if ( isset($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
|
2337
|
+
$class = ' class="current"';
|
2338
|
+
|
2339
|
+
$type_links[] = '<li><a href="' . esc_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . '"' . $class . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), '<span id="' . $mime_type . '-counter">' . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
|
2340
|
+
}
|
2341
|
+
/**
|
2342
|
+
* Filter the media upload mime type list items.
|
2343
|
+
*
|
2344
|
+
* Returned values should begin with an <li> tag.
|
2345
|
+
*
|
2346
|
+
* @since 3.1.0
|
2347
|
+
*
|
2348
|
+
* @param array $type_links An array of list items containing mime type link HTML.
|
2349
|
+
*/
|
2350
|
+
echo implode(' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>';
|
2351
|
+
unset($type_links);
|
2352
|
+
?>
|
2353
|
+
</ul>
|
2354
|
+
|
2355
|
+
<div class="tablenav">
|
2356
|
+
|
2357
|
+
<?php
|
2358
|
+
$page_links = paginate_links( array(
|
2359
|
+
'base' => add_query_arg( 'paged', '%#%' ),
|
2360
|
+
'format' => '',
|
2361
|
+
'prev_text' => __('«'),
|
2362
|
+
'next_text' => __('»'),
|
2363
|
+
'total' => ceil($wp_query->found_posts / 10),
|
2364
|
+
'current' => $q['paged'],
|
2365
|
+
));
|
2366
|
+
|
2367
|
+
if ( $page_links )
|
2368
|
+
echo "<div class='tablenav-pages'>$page_links</div>";
|
2369
|
+
?>
|
2370
|
+
|
2371
|
+
<div class="alignleft actions">
|
2372
|
+
<?php
|
2373
|
+
|
2374
|
+
$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
|
2375
|
+
|
2376
|
+
$arc_result = $wpdb->get_results( $arc_query );
|
2377
|
+
|
2378
|
+
$month_count = count($arc_result);
|
2379
|
+
$selected_month = isset( $_GET['m'] ) ? $_GET['m'] : 0;
|
2380
|
+
|
2381
|
+
if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?>
|
2382
|
+
<select name='m'>
|
2383
|
+
<option<?php selected( $selected_month, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option>
|
2384
|
+
<?php
|
2385
|
+
foreach ($arc_result as $arc_row) {
|
2386
|
+
if ( $arc_row->yyear == 0 )
|
2387
|
+
continue;
|
2388
|
+
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
|
2389
|
+
|
2390
|
+
if ( $arc_row->yyear . $arc_row->mmonth == $selected_month )
|
2391
|
+
$default = ' selected="selected"';
|
2392
|
+
else
|
2393
|
+
$default = '';
|
2394
|
+
|
2395
|
+
echo "<option$default value='" . esc_attr( $arc_row->yyear . $arc_row->mmonth ) . "'>";
|
2396
|
+
echo esc_html( $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear" );
|
2397
|
+
echo "</option>\n";
|
2398
|
+
}
|
2399
|
+
?>
|
2400
|
+
</select>
|
2401
|
+
<?php } ?>
|
2402
|
+
|
2403
|
+
<?php submit_button( __( 'Filter »' ), 'button', 'post-query-submit', false ); ?>
|
2404
|
+
|
2405
|
+
</div>
|
2406
|
+
|
2407
|
+
<br class="clear" />
|
2408
|
+
</div>
|
2409
|
+
</form>
|
2410
|
+
|
2411
|
+
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="library-form">
|
2412
|
+
|
2413
|
+
<?php wp_nonce_field('media-form'); ?>
|
2414
|
+
<?php //media_upload_form( $errors ); ?>
|
2415
|
+
|
2416
|
+
<script type="text/javascript">
|
2417
|
+
<!--
|
2418
|
+
jQuery(function($){
|
2419
|
+
var preloaded = $(".media-item.preloaded");
|
2420
|
+
if ( preloaded.length > 0 ) {
|
2421
|
+
preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
|
2422
|
+
updateMediaForm();
|
2423
|
+
}
|
2424
|
+
});
|
2425
|
+
-->
|
2426
|
+
</script>
|
2427
|
+
|
2428
|
+
<div id="media-items">
|
2429
|
+
<?php add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2); ?>
|
2430
|
+
<?php echo get_media_items(null, $errors); ?>
|
2431
|
+
</div>
|
2432
|
+
<p class="ml-submit">
|
2433
|
+
<?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false ); ?>
|
2434
|
+
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
|
2435
|
+
</p>
|
2436
|
+
</form>
|
2437
|
+
<?php
|
2438
|
+
}
|
2439
|
+
|
2440
|
+
/**
|
2441
|
+
* Creates the form for external url
|
2442
|
+
*
|
2443
|
+
* @since 2.7.0
|
2444
|
+
*
|
2445
|
+
* @param string $default_view
|
2446
|
+
* @return string the form html
|
2447
|
+
*/
|
2448
|
+
function wp_media_insert_url_form( $default_view = 'image' ) {
|
2449
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
2450
|
+
if ( ! apply_filters( 'disable_captions', '' ) ) {
|
2451
|
+
$caption = '
|
2452
|
+
<tr class="image-only">
|
2453
|
+
<th scope="row" class="label">
|
2454
|
+
<label for="caption"><span class="alignleft">' . __('Image Caption') . '</span></label>
|
2455
|
+
</th>
|
2456
|
+
<td class="field"><textarea id="caption" name="caption"></textarea></td>
|
2457
|
+
</tr>
|
2458
|
+
';
|
2459
|
+
} else {
|
2460
|
+
$caption = '';
|
2461
|
+
}
|
2462
|
+
|
2463
|
+
$default_align = get_option('image_default_align');
|
2464
|
+
if ( empty($default_align) )
|
2465
|
+
$default_align = 'none';
|
2466
|
+
|
2467
|
+
if ( 'image' == $default_view ) {
|
2468
|
+
$view = 'image-only';
|
2469
|
+
$table_class = '';
|
2470
|
+
} else {
|
2471
|
+
$view = $table_class = 'not-image';
|
2472
|
+
}
|
2473
|
+
|
2474
|
+
return '
|
2475
|
+
<p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p>
|
2476
|
+
<table class="describe ' . $table_class . '"><tbody>
|
2477
|
+
<tr>
|
2478
|
+
<th scope="row" class="label" style="width:130px;">
|
2479
|
+
<label for="src"><span class="alignleft">' . __('URL') . '</span></label>
|
2480
|
+
<span class="alignright"><abbr id="status_img" title="required" class="required">*</abbr></span>
|
2481
|
+
</th>
|
2482
|
+
<td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td>
|
2483
|
+
</tr>
|
2484
|
+
|
2485
|
+
<tr>
|
2486
|
+
<th scope="row" class="label">
|
2487
|
+
<label for="title"><span class="alignleft">' . __('Title') . '</span></label>
|
2488
|
+
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
|
2489
|
+
</th>
|
2490
|
+
<td class="field"><input id="title" name="title" value="" type="text" aria-required="true" /></td>
|
2491
|
+
</tr>
|
2492
|
+
|
2493
|
+
<tr class="not-image"><td></td><td><p class="help">' . __('Link text, e.g. “Ransom Demands (PDF)”') . '</p></td></tr>
|
2494
|
+
|
2495
|
+
<tr class="image-only">
|
2496
|
+
<th scope="row" class="label">
|
2497
|
+
<label for="alt"><span class="alignleft">' . __('Alternative Text') . '</span></label>
|
2498
|
+
</th>
|
2499
|
+
<td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
|
2500
|
+
<p class="help">' . __('Alt text for the image, e.g. “The Mona Lisa”') . '</p></td>
|
2501
|
+
</tr>
|
2502
|
+
' . $caption . '
|
2503
|
+
<tr class="align image-only">
|
2504
|
+
<th scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
|
2505
|
+
<td class="field">
|
2506
|
+
<input name="align" id="align-none" value="none" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'none' ? ' checked="checked"' : '').' />
|
2507
|
+
<label for="align-none" class="align image-align-none-label">' . __('None') . '</label>
|
2508
|
+
<input name="align" id="align-left" value="left" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'left' ? ' checked="checked"' : '').' />
|
2509
|
+
<label for="align-left" class="align image-align-left-label">' . __('Left') . '</label>
|
2510
|
+
<input name="align" id="align-center" value="center" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'center' ? ' checked="checked"' : '').' />
|
2511
|
+
<label for="align-center" class="align image-align-center-label">' . __('Center') . '</label>
|
2512
|
+
<input name="align" id="align-right" value="right" onclick="addExtImage.align=\'align\'+this.value" type="radio"' . ($default_align == 'right' ? ' checked="checked"' : '').' />
|
2513
|
+
<label for="align-right" class="align image-align-right-label">' . __('Right') . '</label>
|
2514
|
+
</td>
|
2515
|
+
</tr>
|
2516
|
+
|
2517
|
+
<tr class="image-only">
|
2518
|
+
<th scope="row" class="label">
|
2519
|
+
<label for="url"><span class="alignleft">' . __('Link Image To:') . '</span></label>
|
2520
|
+
</th>
|
2521
|
+
<td class="field"><input id="url" name="url" value="" type="text" /><br />
|
2522
|
+
|
2523
|
+
<button type="button" class="button" value="" onclick="document.forms[0].url.value=null">' . __('None') . '</button>
|
2524
|
+
<button type="button" class="button" value="" onclick="document.forms[0].url.value=document.forms[0].src.value">' . __('Link to image') . '</button>
|
2525
|
+
<p class="help">' . __('Enter a link URL or click above for presets.') . '</p></td>
|
2526
|
+
</tr>
|
2527
|
+
<tr class="image-only">
|
2528
|
+
<td></td>
|
2529
|
+
<td>
|
2530
|
+
<input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__('Insert into Post') . '" />
|
2531
|
+
</td>
|
2532
|
+
</tr>
|
2533
|
+
<tr class="not-image">
|
2534
|
+
<td></td>
|
2535
|
+
<td>
|
2536
|
+
' . get_submit_button( __( 'Insert into Post' ), 'button', 'insertonlybutton', false ) . '
|
2537
|
+
</td>
|
2538
|
+
</tr>
|
2539
|
+
</tbody></table>
|
2540
|
+
';
|
2541
|
+
|
2542
|
+
}
|
2543
|
+
|
2544
|
+
/**
|
2545
|
+
* Displays the multi-file uploader message.
|
2546
|
+
*
|
2547
|
+
* @since 2.6.0
|
2548
|
+
*/
|
2549
|
+
function media_upload_flash_bypass() {
|
2550
|
+
$browser_uploader = admin_url( 'media-new.php?browser-uploader' );
|
2551
|
+
|
2552
|
+
if ( $post = get_post() )
|
2553
|
+
$browser_uploader .= '&post_id=' . intval( $post->ID );
|
2554
|
+
elseif ( ! empty( $GLOBALS['post_ID'] ) )
|
2555
|
+
$browser_uploader .= '&post_id=' . intval( $GLOBALS['post_ID'] );
|
2556
|
+
|
2557
|
+
?>
|
2558
|
+
<p class="upload-flash-bypass">
|
2559
|
+
<?php printf( __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" target="%2$s">browser uploader</a> instead.' ), $browser_uploader, '_blank' ); ?>
|
2560
|
+
</p>
|
2561
|
+
<?php
|
2562
|
+
}
|
2563
|
+
add_action('post-plupload-upload-ui', 'media_upload_flash_bypass');
|
2564
|
+
|
2565
|
+
/**
|
2566
|
+
* Displays the browser's built-in uploader message.
|
2567
|
+
*
|
2568
|
+
* @since 2.6.0
|
2569
|
+
*/
|
2570
|
+
function media_upload_html_bypass() {
|
2571
|
+
?>
|
2572
|
+
<p class="upload-html-bypass hide-if-no-js">
|
2573
|
+
<?php _e('You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.'); ?>
|
2574
|
+
</p>
|
2575
|
+
<?php
|
2576
|
+
}
|
2577
|
+
add_action('post-html-upload-ui', 'media_upload_html_bypass');
|
2578
|
+
|
2579
|
+
/**
|
2580
|
+
* Used to display a "After a file has been uploaded..." help message.
|
2581
|
+
*
|
2582
|
+
* @since 3.3.0
|
2583
|
+
*/
|
2584
|
+
function media_upload_text_after() {}
|
2585
|
+
|
2586
|
+
/**
|
2587
|
+
* Displays the checkbox to scale images.
|
2588
|
+
*
|
2589
|
+
* @since 3.3.0
|
2590
|
+
*/
|
2591
|
+
function media_upload_max_image_resize() {
|
2592
|
+
$checked = get_user_setting('upload_resize') ? ' checked="true"' : '';
|
2593
|
+
$a = $end = '';
|
2594
|
+
|
2595
|
+
if ( current_user_can( 'manage_options' ) ) {
|
2596
|
+
$a = '<a href="' . esc_url( admin_url( 'options-media.php' ) ) . '" target="_blank">';
|
2597
|
+
$end = '</a>';
|
2598
|
+
}
|
2599
|
+
?>
|
2600
|
+
<p class="hide-if-no-js"><label>
|
2601
|
+
<input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> />
|
2602
|
+
<?php
|
2603
|
+
/* translators: %1$s is link start tag, %2$s is link end tag, %3$d is width, %4$d is height*/
|
2604
|
+
printf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d × %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) );
|
2605
|
+
?>
|
2606
|
+
</label></p>
|
2607
|
+
<?php
|
2608
|
+
}
|
2609
|
+
|
2610
|
+
/**
|
2611
|
+
* Displays the out of storage quota message in Multisite.
|
2612
|
+
*
|
2613
|
+
* @since 3.5.0
|
2614
|
+
*/
|
2615
|
+
function multisite_over_quota_message() {
|
2616
|
+
echo '<p>' . sprintf( __( 'Sorry, you have used all of your storage quota of %s MB.' ), get_space_allowed() ) . '</p>';
|
2617
|
+
}
|
2618
|
+
|
2619
|
+
/**
|
2620
|
+
* Displays the image and editor in the post editor
|
2621
|
+
*
|
2622
|
+
* @since 3.5.0
|
2623
|
+
*/
|
2624
|
+
function edit_form_image_editor( $post ) {
|
2625
|
+
$open = isset( $_GET['image-editor'] );
|
2626
|
+
if ( $open )
|
2627
|
+
require_once ABSPATH . 'wp-admin/includes/image-edit.php';
|
2628
|
+
|
2629
|
+
$thumb_url = false;
|
2630
|
+
if ( $attachment_id = intval( $post->ID ) )
|
2631
|
+
$thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 450 ), true );
|
2632
|
+
|
2633
|
+
$alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
|
2634
|
+
|
2635
|
+
$att_url = wp_get_attachment_url( $post->ID ); ?>
|
2636
|
+
<div class="wp_attachment_holder">
|
2637
|
+
<?php
|
2638
|
+
if ( wp_attachment_is_image( $post->ID ) ) :
|
2639
|
+
$image_edit_button = '';
|
2640
|
+
if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
|
2641
|
+
$nonce = wp_create_nonce( "image_editor-$post->ID" );
|
2642
|
+
$image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
|
2643
|
+
}
|
2644
|
+
?>
|
2645
|
+
|
2646
|
+
<div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div>
|
2647
|
+
|
2648
|
+
<div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image" id="media-head-<?php echo $attachment_id; ?>">
|
2649
|
+
<p id="thumbnail-head-<?php echo $attachment_id; ?>"><img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" /></p>
|
2650
|
+
<p><?php echo $image_edit_button; ?></p>
|
2651
|
+
</div>
|
2652
|
+
<div<?php if ( ! $open ) echo ' style="display:none"'; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>">
|
2653
|
+
<?php if ( $open ) wp_image_editor( $attachment_id ); ?>
|
2654
|
+
</div>
|
2655
|
+
<?php
|
2656
|
+
elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'audio/' ) ):
|
2657
|
+
|
2658
|
+
wp_maybe_generate_attachment_metadata( $post );
|
2659
|
+
|
2660
|
+
echo wp_audio_shortcode( array( 'src' => $att_url ) );
|
2661
|
+
|
2662
|
+
elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'video/' ) ):
|
2663
|
+
|
2664
|
+
wp_maybe_generate_attachment_metadata( $post );
|
2665
|
+
|
2666
|
+
$meta = wp_get_attachment_metadata( $attachment_id );
|
2667
|
+
$w = ! empty( $meta['width'] ) ? min( $meta['width'], 640 ) : 0;
|
2668
|
+
$h = ! empty( $meta['height'] ) ? $meta['height'] : 0;
|
2669
|
+
if ( $h && $w < $meta['width'] ) {
|
2670
|
+
$h = round( ( $meta['height'] * $w ) / $meta['width'] );
|
2671
|
+
}
|
2672
|
+
|
2673
|
+
$attr = array( 'src' => $att_url );
|
2674
|
+
if ( ! empty( $w ) && ! empty( $h ) ) {
|
2675
|
+
$attr['width'] = $w;
|
2676
|
+
$attr['height'] = $h;
|
2677
|
+
}
|
2678
|
+
|
2679
|
+
$thumb_id = get_post_thumbnail_id( $attachment_id );
|
2680
|
+
if ( ! empty( $thumb_id ) ) {
|
2681
|
+
$attr['poster'] = wp_get_attachment_url( $thumb_id );
|
2682
|
+
}
|
2683
|
+
|
2684
|
+
echo wp_video_shortcode( $attr );
|
2685
|
+
|
2686
|
+
endif; ?>
|
2687
|
+
</div>
|
2688
|
+
<div class="wp_attachment_details edit-form-section">
|
2689
|
+
<p>
|
2690
|
+
<label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br />
|
2691
|
+
<textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea>
|
2692
|
+
</p>
|
2693
|
+
|
2694
|
+
|
2695
|
+
<?php if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) : ?>
|
2696
|
+
<p>
|
2697
|
+
<label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br />
|
2698
|
+
<input type="text" class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" value="<?php echo esc_attr( $alt_text ); ?>" />
|
2699
|
+
</p>
|
2700
|
+
<?php endif; ?>
|
2701
|
+
|
2702
|
+
<?php
|
2703
|
+
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
|
2704
|
+
$editor_args = array(
|
2705
|
+
'textarea_name' => 'content',
|
2706
|
+
'textarea_rows' => 5,
|
2707
|
+
'media_buttons' => false,
|
2708
|
+
'tinymce' => false,
|
2709
|
+
'quicktags' => $quicktags_settings,
|
2710
|
+
);
|
2711
|
+
?>
|
2712
|
+
|
2713
|
+
<label for="content"><strong><?php _e( 'Description' ); ?></strong><?php
|
2714
|
+
if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
|
2715
|
+
echo ': ' . __( 'Displayed on attachment pages.' );
|
2716
|
+
} ?></label>
|
2717
|
+
<?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?>
|
2718
|
+
|
2719
|
+
</div>
|
2720
|
+
<?php
|
2721
|
+
$extras = get_compat_media_markup( $post->ID );
|
2722
|
+
echo $extras['item'];
|
2723
|
+
echo '<input type="hidden" id="image-edit-context" value="edit-attachment" />' . "\n";
|
2724
|
+
}
|
2725
|
+
|
2726
|
+
/**
|
2727
|
+
* Displays non-editable attachment metadata in the publish metabox
|
2728
|
+
*
|
2729
|
+
* @since 3.5.0
|
2730
|
+
*/
|
2731
|
+
function attachment_submitbox_metadata() {
|
2732
|
+
$post = get_post();
|
2733
|
+
|
2734
|
+
$filename = esc_html( wp_basename( $post->guid ) );
|
2735
|
+
|
2736
|
+
$media_dims = '';
|
2737
|
+
$meta = wp_get_attachment_metadata( $post->ID );
|
2738
|
+
if ( isset( $meta['width'], $meta['height'] ) )
|
2739
|
+
$media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> ";
|
2740
|
+
/** This filter is documented in wp-admin/includes/media.php */
|
2741
|
+
$media_dims = apply_filters( 'media_meta', $media_dims, $post );
|
2742
|
+
|
2743
|
+
$att_url = wp_get_attachment_url( $post->ID );
|
2744
|
+
?>
|
2745
|
+
<div class="misc-pub-section misc-pub-attachment">
|
2746
|
+
<label for="attachment_url"><?php _e( 'File URL:' ); ?></label>
|
2747
|
+
<input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" value="<?php echo esc_attr($att_url); ?>" />
|
2748
|
+
</div>
|
2749
|
+
<div class="misc-pub-section misc-pub-filename">
|
2750
|
+
<?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong>
|
2751
|
+
</div>
|
2752
|
+
<div class="misc-pub-section misc-pub-filetype">
|
2753
|
+
<?php _e( 'File type:' ); ?> <strong><?php
|
2754
|
+
if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) ) {
|
2755
|
+
echo esc_html( strtoupper( $matches[1] ) );
|
2756
|
+
list( $mime_type ) = explode( '/', $post->post_mime_type );
|
2757
|
+
if ( $mime_type !== 'image' && ! empty( $meta['mime_type'] ) ) {
|
2758
|
+
if ( $meta['mime_type'] !== "$mime_type/" . strtolower( $matches[1] ) ) {
|
2759
|
+
echo ' (' . $meta['mime_type'] . ')';
|
2760
|
+
}
|
2761
|
+
}
|
2762
|
+
} else {
|
2763
|
+
echo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) );
|
2764
|
+
}
|
2765
|
+
?></strong>
|
2766
|
+
</div>
|
2767
|
+
|
2768
|
+
<?php
|
2769
|
+
$file = get_attached_file( $post->ID );
|
2770
|
+
$file_size = false;
|
2771
|
+
|
2772
|
+
if ( isset( $meta['filesize'] ) )
|
2773
|
+
$file_size = $meta['filesize'];
|
2774
|
+
elseif ( file_exists( $file ) )
|
2775
|
+
$file_size = filesize( $file );
|
2776
|
+
|
2777
|
+
if ( ! empty( $file_size ) ) : ?>
|
2778
|
+
<div class="misc-pub-section misc-pub-filesize">
|
2779
|
+
<?php _e( 'File size:' ); ?> <strong><?php echo size_format( $file_size ); ?></strong>
|
2780
|
+
</div>
|
2781
|
+
<?php
|
2782
|
+
endif;
|
2783
|
+
|
2784
|
+
if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
|
2785
|
+
|
2786
|
+
/**
|
2787
|
+
* Filter the audio and video metadata fields to be shown in the publish meta box.
|
2788
|
+
*
|
2789
|
+
* The key for each item in the array should correspond to an attachment
|
2790
|
+
* metadata key, and the value should be the desired label.
|
2791
|
+
*
|
2792
|
+
* @since 3.7.0
|
2793
|
+
*
|
2794
|
+
* @param array $fields An array of the attachment metadata keys and labels.
|
2795
|
+
*/
|
2796
|
+
$fields = apply_filters( 'media_submitbox_misc_sections', array(
|
2797
|
+
'length_formatted' => __( 'Length:' ),
|
2798
|
+
'bitrate' => __( 'Bitrate:' ),
|
2799
|
+
) );
|
2800
|
+
|
2801
|
+
foreach ( $fields as $key => $label ) {
|
2802
|
+
if ( empty( $meta[ $key ] ) ) {
|
2803
|
+
continue;
|
2804
|
+
}
|
2805
|
+
?>
|
2806
|
+
<div class="misc-pub-section misc-pub-mime-meta misc-pub-<?php echo sanitize_html_class( $key ); ?>">
|
2807
|
+
<?php echo $label ?> <strong><?php
|
2808
|
+
switch ( $key ) {
|
2809
|
+
case 'bitrate' :
|
2810
|
+
echo round( $meta['bitrate'] / 1000 ) . 'kb/s';
|
2811
|
+
if ( ! empty( $meta['bitrate_mode'] ) ) {
|
2812
|
+
echo ' ' . strtoupper( esc_html( $meta['bitrate_mode'] ) );
|
2813
|
+
}
|
2814
|
+
break;
|
2815
|
+
default:
|
2816
|
+
echo esc_html( $meta[ $key ] );
|
2817
|
+
break;
|
2818
|
+
}
|
2819
|
+
?></strong>
|
2820
|
+
</div>
|
2821
|
+
<?php
|
2822
|
+
}
|
2823
|
+
|
2824
|
+
/**
|
2825
|
+
* Filter the audio attachment metadata fields to be shown in the publish meta box.
|
2826
|
+
*
|
2827
|
+
* The key for each item in the array should correspond to an attachment
|
2828
|
+
* metadata key, and the value should be the desired label.
|
2829
|
+
*
|
2830
|
+
* @since 3.7.0
|
2831
|
+
*
|
2832
|
+
* @param array $fields An array of the attachment metadata keys and labels.
|
2833
|
+
*/
|
2834
|
+
$audio_fields = apply_filters( 'audio_submitbox_misc_sections', array(
|
2835
|
+
'dataformat' => __( 'Audio Format:' ),
|
2836
|
+
'codec' => __( 'Audio Codec:' )
|
2837
|
+
) );
|
2838
|
+
|
2839
|
+
foreach ( $audio_fields as $key => $label ) {
|
2840
|
+
if ( empty( $meta['audio'][ $key ] ) ) {
|
2841
|
+
continue;
|
2842
|
+
}
|
2843
|
+
?>
|
2844
|
+
<div class="misc-pub-section misc-pub-audio misc-pub-<?php echo sanitize_html_class( $key ); ?>">
|
2845
|
+
<?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][$key] ); ?></strong>
|
2846
|
+
</div>
|
2847
|
+
<?php
|
2848
|
+
}
|
2849
|
+
|
2850
|
+
}
|
2851
|
+
|
2852
|
+
if ( $media_dims ) : ?>
|
2853
|
+
<div class="misc-pub-section misc-pub-dimensions">
|
2854
|
+
<?php _e( 'Dimensions:' ); ?> <strong><?php echo $media_dims; ?></strong>
|
2855
|
+
</div>
|
2856
|
+
<?php
|
2857
|
+
endif;
|
2858
|
+
}
|
2859
|
+
|
2860
|
+
add_filter( 'async_upload_image', 'get_media_item', 10, 2 );
|
2861
|
+
add_filter( 'async_upload_audio', 'get_media_item', 10, 2 );
|
2862
|
+
add_filter( 'async_upload_video', 'get_media_item', 10, 2 );
|
2863
|
+
add_filter( 'async_upload_file', 'get_media_item', 10, 2 );
|
2864
|
+
|
2865
|
+
add_action( 'media_upload_image', 'wp_media_upload_handler' );
|
2866
|
+
add_action( 'media_upload_audio', 'wp_media_upload_handler' );
|
2867
|
+
add_action( 'media_upload_video', 'wp_media_upload_handler' );
|
2868
|
+
add_action( 'media_upload_file', 'wp_media_upload_handler' );
|
2869
|
+
|
2870
|
+
add_filter( 'media_upload_gallery', 'media_upload_gallery' );
|
2871
|
+
add_filter( 'media_upload_library', 'media_upload_library' );
|
2872
|
+
|
2873
|
+
add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );
|
2874
|
+
|
2875
|
+
/**
|
2876
|
+
* Parse ID3v2, ID3v1, and getID3 comments to extract usable data
|
2877
|
+
*
|
2878
|
+
* @since 3.6.0
|
2879
|
+
*
|
2880
|
+
* @param array $metadata An existing array with data
|
2881
|
+
* @param array $data Data supplied by ID3 tags
|
2882
|
+
*/
|
2883
|
+
function wp_add_id3_tag_data( &$metadata, $data ) {
|
2884
|
+
foreach ( array( 'id3v2', 'id3v1' ) as $version ) {
|
2885
|
+
if ( ! empty( $data[$version]['comments'] ) ) {
|
2886
|
+
foreach ( $data[$version]['comments'] as $key => $list ) {
|
2887
|
+
if ( 'length' !== $key && ! empty( $list ) ) {
|
2888
|
+
$metadata[$key] = reset( $list );
|
2889
|
+
// Fix bug in byte stream analysis.
|
2890
|
+
if ( 'terms_of_use' === $key && 0 === strpos( $metadata[$key], 'yright notice.' ) )
|
2891
|
+
$metadata[$key] = 'Cop' . $metadata[$key];
|
2892
|
+
}
|
2893
|
+
}
|
2894
|
+
break;
|
2895
|
+
}
|
2896
|
+
}
|
2897
|
+
|
2898
|
+
if ( ! empty( $data['id3v2']['APIC'] ) ) {
|
2899
|
+
$image = reset( $data['id3v2']['APIC']);
|
2900
|
+
if ( ! empty( $image['data'] ) ) {
|
2901
|
+
$metadata['image'] = array(
|
2902
|
+
'data' => $image['data'],
|
2903
|
+
'mime' => $image['image_mime'],
|
2904
|
+
'width' => $image['image_width'],
|
2905
|
+
'height' => $image['image_height']
|
2906
|
+
);
|
2907
|
+
}
|
2908
|
+
} elseif ( ! empty( $data['comments']['picture'] ) ) {
|
2909
|
+
$image = reset( $data['comments']['picture'] );
|
2910
|
+
if ( ! empty( $image['data'] ) ) {
|
2911
|
+
$metadata['image'] = array(
|
2912
|
+
'data' => $image['data'],
|
2913
|
+
'mime' => $image['image_mime']
|
2914
|
+
);
|
2915
|
+
}
|
2916
|
+
}
|
2917
|
+
}
|
2918
|
+
|
2919
|
+
/**
|
2920
|
+
* Retrieve metadata from a video file's ID3 tags
|
2921
|
+
*
|
2922
|
+
* @since 3.6.0
|
2923
|
+
*
|
2924
|
+
* @param string $file Path to file.
|
2925
|
+
* @return array|boolean Returns array of metadata, if found.
|
2926
|
+
*/
|
2927
|
+
function wp_read_video_metadata( $file ) {
|
2928
|
+
if ( ! file_exists( $file ) )
|
2929
|
+
return false;
|
2930
|
+
|
2931
|
+
$metadata = array();
|
2932
|
+
|
2933
|
+
if ( ! class_exists( 'getID3' ) )
|
2934
|
+
require( ABSPATH . WPINC . '/ID3/getid3.php' );
|
2935
|
+
$id3 = new getID3();
|
2936
|
+
$data = $id3->analyze( $file );
|
2937
|
+
|
2938
|
+
if ( isset( $data['video']['lossless'] ) )
|
2939
|
+
$metadata['lossless'] = $data['video']['lossless'];
|
2940
|
+
if ( ! empty( $data['video']['bitrate'] ) )
|
2941
|
+
$metadata['bitrate'] = (int) $data['video']['bitrate'];
|
2942
|
+
if ( ! empty( $data['video']['bitrate_mode'] ) )
|
2943
|
+
$metadata['bitrate_mode'] = $data['video']['bitrate_mode'];
|
2944
|
+
if ( ! empty( $data['filesize'] ) )
|
2945
|
+
$metadata['filesize'] = (int) $data['filesize'];
|
2946
|
+
if ( ! empty( $data['mime_type'] ) )
|
2947
|
+
$metadata['mime_type'] = $data['mime_type'];
|
2948
|
+
if ( ! empty( $data['playtime_seconds'] ) )
|
2949
|
+
$metadata['length'] = (int) round( $data['playtime_seconds'] );
|
2950
|
+
if ( ! empty( $data['playtime_string'] ) )
|
2951
|
+
$metadata['length_formatted'] = $data['playtime_string'];
|
2952
|
+
if ( ! empty( $data['video']['resolution_x'] ) )
|
2953
|
+
$metadata['width'] = (int) $data['video']['resolution_x'];
|
2954
|
+
if ( ! empty( $data['video']['resolution_y'] ) )
|
2955
|
+
$metadata['height'] = (int) $data['video']['resolution_y'];
|
2956
|
+
if ( ! empty( $data['fileformat'] ) )
|
2957
|
+
$metadata['fileformat'] = $data['fileformat'];
|
2958
|
+
if ( ! empty( $data['video']['dataformat'] ) )
|
2959
|
+
$metadata['dataformat'] = $data['video']['dataformat'];
|
2960
|
+
if ( ! empty( $data['video']['encoder'] ) )
|
2961
|
+
$metadata['encoder'] = $data['video']['encoder'];
|
2962
|
+
if ( ! empty( $data['video']['codec'] ) )
|
2963
|
+
$metadata['codec'] = $data['video']['codec'];
|
2964
|
+
|
2965
|
+
if ( ! empty( $data['audio'] ) ) {
|
2966
|
+
unset( $data['audio']['streams'] );
|
2967
|
+
$metadata['audio'] = $data['audio'];
|
2968
|
+
}
|
2969
|
+
|
2970
|
+
wp_add_id3_tag_data( $metadata, $data );
|
2971
|
+
|
2972
|
+
return $metadata;
|
2973
|
+
}
|
2974
|
+
|
2975
|
+
/**
|
2976
|
+
* Retrieve metadata from a audio file's ID3 tags
|
2977
|
+
*
|
2978
|
+
* @since 3.6.0
|
2979
|
+
*
|
2980
|
+
* @param string $file Path to file.
|
2981
|
+
* @return array|boolean Returns array of metadata, if found.
|
2982
|
+
*/
|
2983
|
+
function wp_read_audio_metadata( $file ) {
|
2984
|
+
if ( ! file_exists( $file ) )
|
2985
|
+
return false;
|
2986
|
+
$metadata = array();
|
2987
|
+
|
2988
|
+
if ( ! class_exists( 'getID3' ) )
|
2989
|
+
require( ABSPATH . WPINC . '/ID3/getid3.php' );
|
2990
|
+
$id3 = new getID3();
|
2991
|
+
$data = $id3->analyze( $file );
|
2992
|
+
|
2993
|
+
if ( ! empty( $data['audio'] ) ) {
|
2994
|
+
unset( $data['audio']['streams'] );
|
2995
|
+
$metadata = $data['audio'];
|
2996
|
+
}
|
2997
|
+
|
2998
|
+
if ( ! empty( $data['fileformat'] ) )
|
2999
|
+
$metadata['fileformat'] = $data['fileformat'];
|
3000
|
+
if ( ! empty( $data['filesize'] ) )
|
3001
|
+
$metadata['filesize'] = (int) $data['filesize'];
|
3002
|
+
if ( ! empty( $data['mime_type'] ) )
|
3003
|
+
$metadata['mime_type'] = $data['mime_type'];
|
3004
|
+
if ( ! empty( $data['playtime_seconds'] ) )
|
3005
|
+
$metadata['length'] = (int) round( $data['playtime_seconds'] );
|
3006
|
+
if ( ! empty( $data['playtime_string'] ) )
|
3007
|
+
$metadata['length_formatted'] = $data['playtime_string'];
|
3008
|
+
|
3009
|
+
wp_add_id3_tag_data( $metadata, $data );
|
3010
|
+
|
3011
|
+
return $metadata;
|
3012
|
+
}
|