Compare commits

..

610 Commits
2.5.1 ... 2.6.1

Author SHA1 Message Date
ryan
0608ca12bc 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/tags/2.6.1@8652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-15 03:09:39 +00:00
ryan
6539d7a7b0 Bump ver in readme.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-15 02:54:09 +00:00
ryan
26cc0c767e Bump
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-14 23:46:10 +00:00
ryan
8ef8a05cf0 Revert [8409] pending discussion. see #7341
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-14 23:11:30 +00:00
ryan
01a0c14a19 Make sure timestamps are not 0000 when publishing. Props techcookies. fixes #6527 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-13 19:15:26 +00:00
ryan
d1d5cab011 RTL CSS updates from Navid Kashani, RanYanivHartstein, mani_monaj, and the WP Persian team. see #7498
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-12 22:49:33 +00:00
ryan
fa17bbccf1 Don't redirect back to permalink after editing from Edit This link. fixes #7503 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-12 21:00:43 +00:00
ryan
bd0d60385d Don't redirect back to permalink after editing from Edit This link. fixes #7503 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-12 20:58:46 +00:00
ryan
9de212e19d Beta 2
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-12 05:04:10 +00:00
markjaquith
6513d822ab Do not prepend /archives/ et al to category/tag URLs unless category/tag slug is missing. fixes #7490 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-11 20:18:00 +00:00
azaozz
21ea451530 Fix img path in TinyMCE css. Props docwhat, fixes #7469 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-11 04:09:05 +00:00
azaozz
1076eec075 Prevent fatal error if plugin uses install-helper.php, fixes #6747 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-10 23:15:53 +00:00
azaozz
627cd82811 Gears: don't try to cache TinyMCE if it has been deleted, for 2.6.1 (already in 2.7)
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-10 21:53:40 +00:00
azaozz
56677ba068 Removes the disabling of captions, but leaves couple of hooks so a plugin can do it easily. For 2.6.1, see #6812
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-10 19:33:44 +00:00
azaozz
b08fd8141d Strip slashes when inserting media into the editor. Fixes #7488 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-10 02:12:18 +00:00
ryan
0ca99f4200 Fix tag duplication when saving posts with multiple tags that have custom slugs. Props mtekk and count_0. fixes #6593 see #6313
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-09 17:13:27 +00:00
markjaquith
b0d1bc2e55 Fix braces so user_trailingslashit gets the correct information passed in canonical redirect code. props xorax. fixes #7483 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-08 17:46:49 +00:00
ryan
909dea5998 RTL fixes from RanYanivHartstein. see #7482
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-08 17:24:16 +00:00
ryan
948ac9a0d8 Fix Text/Diff includes. Props codestyling. fixes #7391 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-07 21:03:11 +00:00
markjaquith
f154d68df7 Add private-checkbox ID to private checkbox wrapping paragraph so plugins can hide it with CSS
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-06 22:16:19 +00:00
ryan
27992458ad Fix variable name typo. Props ionfish. fixes #7471 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-06 17:24:28 +00:00
ryan
6330e6305c Strip tags from summary. Props dsader. fixes #7375 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-06 15:50:39 +00:00
azaozz
9e0388a32f Revert 8563
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-06 01:11:39 +00:00
azaozz
bebf5bca5a Stop fatal error in post revisions when setting the include path is disabled. Props santosj, for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-05 23:57:25 +00:00
ryan
2fb40c7033 Bump goes the version
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-05 22:28:35 +00:00
ryan
a009ff7b3a Check both slug and name when determining if is_term(). fixes #6593 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-05 22:05:53 +00:00
ryan
72bc979b6a Increase term name length. Props nbachiyski. fixes #7465 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-05 22:03:48 +00:00
ryan
c10af22f0b Allow merging of similarly named text domains. Props sambauers. fixes #7376 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-05 21:34:44 +00:00
ryan
3ab37a03d7 Press This: Fix image insert in IE7, set textarea height. Props noael and zamoose. fixes #7387 #7310 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-05 17:14:18 +00:00
ryan
facd76a124 Cast to array to avoid warning. Props santosj. fixes #7222 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-04 20:35:02 +00:00
ryan
e1dff9fcf4 Make sure meta is added to the post, not a revision.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-04 16:18:15 +00:00
azaozz
dc9db23f3d Type error when redirecting after post save, url_to_postid() may return the id as int or str, for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-04 05:16:26 +00:00
ryan
0810c6b4c8 Don't run get_plugins() on every admin page load. Use cron for async update plugin requests. see #7372 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-01 20:59:44 +00:00
azaozz
2fcbc91a2f When not using image captions, IE may add caption null, for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-01 04:49:38 +00:00
ryan
81dbcfd8f3 Add prohphylactic addlashes when evaling query. Props xknown.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-30 17:17:51 +00:00
azaozz
4fb5af289a Stop PHP warnings when $_GET[revision] is not set. Props DD32, see #7437, for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-30 12:33:29 +00:00
azaozz
79041e1fad Add "Page restored" message. Props Viper007Bond, fixes #7437 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-30 09:20:44 +00:00
azaozz
b7576812aa Allow comma-separated post_status values in WP_Query. Props markjaquith, fixes #7423 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-30 08:18:24 +00:00
westi
6da27e9b94 Include only valid plugins. Props guillep2k and xknown, fixes #6871 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-30 06:48:03 +00:00
ryan
c59a3a9398 Don't apply checkboxes to invisible comments.Props mdawaffe. fixes #7433 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-29 22:16:49 +00:00
ryan
654ba10a84 Fix gravatars for infinite comments. Props mdawaffe. fixes #7432 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-29 22:15:22 +00:00
ryan
abccdc8837 Allow dots in theme dirs when previewing. fixes #7482 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-29 17:03:28 +00:00
ryan
efbc17418d Store current user rather than original post author when saving revisions. Props mdawaffe. fixes #7317 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-28 23:58:46 +00:00
ryan
2c29cd1b66 Pass context to get_edit_post_link filter. Props mdawaffe. fixes #7424 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-28 23:39:37 +00:00
azaozz
1a56989da2 Press This: using trailing slash after $_SERVER['PHP_SELF'] breaks the image tab on some servers. For 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-28 23:09:12 +00:00
ryan
feb1e7d0a0 Use ORIG_PATH_INFO if PATH_INFO is not available. fixes #7058 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-28 16:27:17 +00:00
westi
6be605af8e Remove extra } from query. Fixes #7416 for 2.6.1. Props docwhat.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-27 08:51:01 +00:00
azaozz
2082b3c7f8 Fix typo in bookmark template. Props brianwhite, fixes #7414 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-26 19:58:04 +00:00
azaozz
04f70fdf43 Stay on the same page after moderating comments. Fixes #7412 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-26 03:54:06 +00:00
ryan
88a04b1d77 Add macFFBgHack.png. fixes #6573 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-25 22:43:04 +00:00
ryan
2747049c72 Don't try to translate empty role name. Props wasp. fixes #6554 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-25 15:37:16 +00:00
ryan
c668167e1c Make RSD links SSL aware by using site_url(). fixes #7401 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-24 22:08:18 +00:00
ryan
73b8a89c70 Work around fatal error caused by mbstring.func_overload = 2. Props codestyling . fixes #5599 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-23 18:56:42 +00:00
azaozz
8cdf6d9332 Use conditional for whole sentence. Fixes #7385 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-23 18:52:50 +00:00
ryan
eed92d51d3 Typo fix from filosofo. fixes #7389 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-23 18:35:55 +00:00
ryan
a81557b789 Don't concat translatable strings. Props msi08. fixes #7385 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-23 16:40:36 +00:00
ryan
0e9fc6677b Fix case. fixes #7344 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-23 16:36:37 +00:00
westi
248bc6d43c Advertise Atom 1.0 Feed in default theme. Fixes #7341 for 2.6.x props josephscott.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-23 06:59:48 +00:00
azaozz
1f9ed226d4 Small update to Gears info messages and simple Safari detection. Fixes #7380 for 2.6.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-23 05:14:18 +00:00
ryan
83b7e78b92 Use WP_LANG_DIR. fixes #7378 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-22 21:10:04 +00:00
ryan
5e41713960 Allow disabling password reset per user. Props axelseaa. fixes #7344 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-22 19:16:09 +00:00
ryan
7b811fb496 Update AtomPub? auth to use latest API for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-22 16:04:57 +00:00
ryan
f4a0f60a08 Eliminate unused var. Props tschai. fixes #7374 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-22 15:50:28 +00:00
azaozz
01b3ad2f64 Gears integration update in anticipation of Safari support. Fixes #7371
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-22 04:09:37 +00:00
ryan
2540ebccc1 Don't allow empty term names. Props scohoust. fixes #7336 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-21 21:54:16 +00:00
ryan
a99711e695 Check for WP_Error return from wp_update_term(). Props scohoust. fixes #7366 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-21 17:52:38 +00:00
ryan
582c3ec613 Fix assignment of links to the default category when a category is deleted. Props scohoust. fixes #7316 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-21 16:13:37 +00:00
azaozz
580cd63034 Take first attribute and ignore later duplicate attributes. Fixes #6602 for 2.6.1. Props schiller.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-21 01:15:49 +00:00
azaozz
c7a4e90f92 Prevent adjacent hyphens in a HTML/XML comment. Fixes #6642 for 2.6.1. Props schiller.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-21 00:47:08 +00:00
ryan
483682b3f1 Make get_edit_post_link() and get_edit_comment_link() SSL aware. Props robertaccettura. fixes #7359 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-20 04:47:35 +00:00
westi
45ab9ef3c0 Ensure that AtomPub does not auto-publish draft posts when they are edited. Fixes #7299 for 2.6.x props redsweater.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-19 15:31:55 +00:00
ryan
c53330f93d Don't return if is_string(). Proceed to check if is_serialized(). fixes #7347 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-18 16:43:49 +00:00
ryan
637f888eb2 Image sideload and wp_upload_dir() fixes from noel. fixes #7342 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-18 03:19:25 +00:00
markjaquith
d52be5ff39 Better solution for #4536. Slashless normalization of tag/category bases. fixes #7306 for 2.6.1. see #4536
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-17 19:45:26 +00:00
ryan
3759bf4dad Fix is_term query prepare() so that tag slugs that have percent signs in them don't break. fixes #6867 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-17 17:00:35 +00:00
azaozz
b8fbeba230 Fix invalid HTML and remove duplicate fields. Fixes #7293 for 2.6.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 22:12:34 +00:00
westi
4b1262339d Invalidate the plugin update cache if plugins are deleted. Fixes #7304 for trunk. Props DD32.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 21:56:43 +00:00
azaozz
416006cfa9 Improve compatibility when importing custom colors css, props caesarsgrunt. fixes #7311 for 2.6.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 20:58:44 +00:00
ryan
5b248b79a5 New location for akismet
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 18:58:22 +00:00
ryan
6d5f0ca73f Derive the upload url from the upload path if no url given. fixes #7308 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 16:49:53 +00:00
ryan
f3aec6d863 Restore fields removed in [7645]. Props rm53. fixes #7320 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 16:30:45 +00:00
ryan
53fb9c2dad set eol-style
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 16:18:37 +00:00
ryan
f6d89e9571 Add jquery dependency to admin-forms. Props 082net. fixes #7321 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 16:17:06 +00:00
ryan
5942d49368 Typo fix. Props paul@byte. fixes #7323 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 16:14:26 +00:00
westi
8320950d87 Update the version number for branches/2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-16 07:16:30 +00:00
ryan
bf660b66e2 Typo fix from robertdimarco. fixes #7297 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-15 16:22:31 +00:00
ryan
3a9762ecd4 2.6 branch
git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-15 03:05:51 +00:00
ryan
9ce9fec7c4 plugins_url()
git-svn-id: http://svn.automattic.com/wordpress/trunk@8334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-15 00:10:07 +00:00
ryan
4460d7efc9 phpdoc for site_url() and friends
git-svn-id: http://svn.automattic.com/wordpress/trunk@8333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-14 23:39:11 +00:00
ryan
7b7d5d8611 Image regex fixes from noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-14 17:59:06 +00:00
ryan
4f5aa3fa57 Bumpage
git-svn-id: http://svn.automattic.com/wordpress/trunk@8331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-14 17:27:19 +00:00
ryan
1e6bf47187 rlm entity not so Windows friendly. Use perios instead. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-14 17:26:30 +00:00
ryan
b1672442f8 RTL support for Press This. Props RanYanivHartstein. see #7289
git-svn-id: http://svn.automattic.com/wordpress/trunk@8328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-13 17:57:23 +00:00
ryan
b71746be10 RTL friendly fonts from RanYanivHartstein. fixes #6616
git-svn-id: http://svn.automattic.com/wordpress/trunk@8327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-13 16:40:25 +00:00
ryan
bc54bed035 RTL for Press This. Props RanYanivHartstein. see #7289 #6616
git-svn-id: http://svn.automattic.com/wordpress/trunk@8326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-13 16:26:16 +00:00
westi
7c340c19f1 Update readme to 2.6
git-svn-id: http://svn.automattic.com/wordpress/trunk@8325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-13 11:26:25 +00:00
ryan
8750ed2ea1 Workaround PHP parse_url() bug. Props azaozz. fixes #7288
git-svn-id: http://svn.automattic.com/wordpress/trunk@8324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-13 05:16:54 +00:00
ryan
4846338eeb Press This: properly add and load press-this-ie.css, cleanup of the bookmarklet code. Props azaozz. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-13 04:57:01 +00:00
ryan
91ffbd5d4d Bump
git-svn-id: http://svn.automattic.com/wordpress/trunk@8322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-12 18:04:41 +00:00
ryan
01cf8b5371 Denote CAPTIONS_OFF as temporary. see #6812
git-svn-id: http://svn.automattic.com/wordpress/trunk@8321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-12 18:02:29 +00:00
matt
b9b2d4d557 We need to clear floats so images don't run into the next post.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-12 17:53:23 +00:00
ryan
22781f8edc Performance improvements for page_rows(). Props hailin. fixes #7286
git-svn-id: http://svn.automattic.com/wordpress/trunk@8319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-12 15:40:57 +00:00
ryan
09f8519390 Press This: Switching to using our default content cleanup in the editor. Props azaozz. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 23:38:32 +00:00
ryan
e7e42b56d5 Run plugin checks both admin and blog side. Props DD32 and mdawaffe. fixes #7265
git-svn-id: http://svn.automattic.com/wordpress/trunk@8317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 22:04:03 +00:00
ryan
e027fac4f6 Press This: Fix inserting the selection in the editor and stripping of paragraphs when saving, IE CSS styling fixes, fix continuous linking in editor. Props noel and azaozz. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 20:27:50 +00:00
ryan
ecd98d1aff Generic POST handler. see #7283
git-svn-id: http://svn.automattic.com/wordpress/trunk@8315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 20:24:35 +00:00
ryan
8ae2545c47 Inline user_login focus JS and avoid JS error. Props azaozz. fixes #7282
git-svn-id: http://svn.automattic.com/wordpress/trunk@8314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 20:14:44 +00:00
ryan
752b0eb45b Rename wp_caption shortcode to caption. Allow themes to disable captioning. Use dashes instead of underscores in class names. Props azaozz. see #6812
git-svn-id: http://svn.automattic.com/wordpress/trunk@8313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 15:59:14 +00:00
ryan
35e593c3ab clean_url() for add_query_arg(). Props xnown. see #7281
git-svn-id: http://svn.automattic.com/wordpress/trunk@8312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 15:11:12 +00:00
ryan
72295536c2 Don't LIMIT updates to 1. Props hailin. fixes #7272
git-svn-id: http://svn.automattic.com/wordpress/trunk@8311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 01:49:06 +00:00
ryan
f9f960b1d0 Add flash uploader bypass toggle. Props tellyworth. fixes #7281
git-svn-id: http://svn.automattic.com/wordpress/trunk@8310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-11 01:45:41 +00:00
ryan
0728ecb254 Fix font sizes in the install/upgrade screens. Props azaozz. fixes #7276
git-svn-id: http://svn.automattic.com/wordpress/trunk@8309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-10 16:59:17 +00:00
ryan
6960418d18 Reduce size of Press This bookmarklet. see #7261
git-svn-id: http://svn.automattic.com/wordpress/trunk@8308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-10 16:54:32 +00:00
ryan
0022c2c510 Fix image resizing inside captions, add edit alt field to the advanced tab. Props azaozz. see #6812
git-svn-id: http://svn.automattic.com/wordpress/trunk@8307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-10 16:39:14 +00:00
matt
1527357b5e Javascriptify revision selections to deal elegantly while comparing.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-10 07:58:19 +00:00
matt
120abd8e17 Check for plugin updates more frequently, notify with double bubble trouble. Hat tip: mdawaffe. Fixes #7265.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-10 07:35:20 +00:00
ryan
642bd53a67 Media Uploader improvements from azaozz: Improves the insert external image dialog, redirects to the gallery tab after "Save all changes" is clicked, shows the "Order" fields on the closed tabs, where they are easier to use, and only in the Gallery. see #7274
git-svn-id: http://svn.automattic.com/wordpress/trunk@8304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-10 03:49:52 +00:00
ryan
10b433cce8 Press This: CSS cleanup, photo input newline breaks, fixes short_tags problem. Props noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-09 21:39:36 +00:00
ryan
bcbbb70170 Don't format_to_edit TinyMCE inserts. Don't turn selection into a link. Restore editor contents when switching back to text tab. see #7261 #7220
git-svn-id: http://svn.automattic.com/wordpress/trunk@8302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-09 19:51:53 +00:00
ryan
e2aa6d619c Introduce content_url(). Don't prepend base url to content url in script loader. see #6938 #7001
git-svn-id: http://svn.automattic.com/wordpress/trunk@8301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-09 17:24:36 +00:00
ryan
100ed8a62d Prevent category looping. Props tellyworth. fixes #7267
git-svn-id: http://svn.automattic.com/wordpress/trunk@8299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-09 04:57:18 +00:00
ryan
0cd103e2a2 Hands off pre tags. Props nbachiyski. fixes #7056
git-svn-id: http://svn.automattic.com/wordpress/trunk@8298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-09 04:52:27 +00:00
ryan
0283fc3717 Install styling from azaozz. fixes #7266
git-svn-id: http://svn.automattic.com/wordpress/trunk@8297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-09 04:33:31 +00:00
matt
80b1ebdbbf Ajax Deleting an object that's already been deleted should silently succeed. Hat tip: mdawaffe. Fixes #7264.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-09 02:00:21 +00:00
ryan
3b48af4a6d Fix quotes in captions. Props azaozz. see #6812
git-svn-id: http://svn.automattic.com/wordpress/trunk@8290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-08 23:38:53 +00:00
ryan
8a37dfa5b2 Use dash instead of underscore for CSS names. Props azaozz. see #6812
git-svn-id: http://svn.automattic.com/wordpress/trunk@8289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-08 23:37:56 +00:00
ryan
4cd0c96d03 Fix get_links_list deprecation doc. Props Otto42. fixes #6879
git-svn-id: http://svn.automattic.com/wordpress/trunk@8285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-08 17:38:12 +00:00
ryan
792b5dfd36 Don't replace spaces with nbsp. This breaks wrapping. Props MtDewVirus. fixes #7259
git-svn-id: http://svn.automattic.com/wordpress/trunk@8281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-08 00:14:06 +00:00
ryan
cf566ef990 Return base dir and url from wp_upload_dir(). Props DD32. fixes #6762
git-svn-id: http://svn.automattic.com/wordpress/trunk@8280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-07 23:53:54 +00:00
ryan
f605bcc3a3 gettext updates for cat2tag. Props msi08. fixes #7139
git-svn-id: http://svn.automattic.com/wordpress/trunk@8279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-07 23:49:22 +00:00
ryan
96c00ed1c3 Send 403 if publishing is disabled. Props AlanJCastonguay. see #7157
git-svn-id: http://svn.automattic.com/wordpress/trunk@8267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-07 19:19:47 +00:00
ryan
4957f5a4cc Notice fixes from jacobsantos. fixes #7255
git-svn-id: http://svn.automattic.com/wordpress/trunk@8266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-07 14:21:47 +00:00
ryan
79913b557b Excerpt long media titles. Props nbachiyski. fixes #7253
git-svn-id: http://svn.automattic.com/wordpress/trunk@8265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-06 21:15:38 +00:00
ryan
0f48fa0124 Don't split in the middle of a UTF-8 character. Props nbachiyski. fixes #7254
git-svn-id: http://svn.automattic.com/wordpress/trunk@8264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-06 21:14:47 +00:00
ryan
ffc0077745 Don't try to match rewrite rules against AtomPub requests. Props josephscott. fixes #7249
git-svn-id: http://svn.automattic.com/wordpress/trunk@8263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-06 17:33:39 +00:00
ryan
fac865a413 Bump version for gallery. Props nbachiyski. fixes #6988
git-svn-id: http://svn.automattic.com/wordpress/trunk@8262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-06 16:41:47 +00:00
ryan
cc829f5f96 Make sure attachment meta data is an array. Props nbachiyski. fixes #7252
git-svn-id: http://svn.automattic.com/wordpress/trunk@8261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-06 16:40:15 +00:00
ryan
e455091d0a Image caption fixes from azaozz: captions are properly created in tables and in lists, all tags are properly removed when deleting a caption, the align buttons can be used to align the captions. see #6812
git-svn-id: http://svn.automattic.com/wordpress/trunk@8260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-06 16:38:37 +00:00
ryan
7aa234ad58 Gallery sort fix from AaronCampbell. fixes #6988
git-svn-id: http://svn.automattic.com/wordpress/trunk@8259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-05 05:01:28 +00:00
ryan
c2814da3f1 Fix pass-by-ref error. Props DD32. fixes #7241
git-svn-id: http://svn.automattic.com/wordpress/trunk@8258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-04 16:16:25 +00:00
ryan
4ead38ccbb Fix wp_get_attachment_thumb_url() tumbnail back compat. Props DD32. fixes #7242
git-svn-id: http://svn.automattic.com/wordpress/trunk@8257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-04 16:15:29 +00:00
ryan
897fa5bf62 Gears and styling updates for Press This from azaozz. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-04 16:12:31 +00:00
ryan
14fc4d5981 Turn off verbose
git-svn-id: http://svn.automattic.com/wordpress/trunk@8255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-04 06:18:20 +00:00
ryan
e38b2bcaa8 Bumpage
git-svn-id: http://svn.automattic.com/wordpress/trunk@8254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-04 06:12:24 +00:00
ryan
40c67062cb Grammar fix
git-svn-id: http://svn.automattic.com/wordpress/trunk@8253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-04 00:28:18 +00:00
ryan
59beabd5dc Allow underscore and dash in theme dirs when previewing. fixes #7236
git-svn-id: http://svn.automattic.com/wordpress/trunk@8252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-03 23:10:28 +00:00
ryan
c3045dd2f8 Update sample config to use new cookie keys
git-svn-id: http://svn.automattic.com/wordpress/trunk@8251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-03 17:16:10 +00:00
ryan
3ceeaa6252 Use searchform.php for search widget, if available. Props ionfish. fixes #5567
git-svn-id: http://svn.automattic.com/wordpress/trunk@8250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-03 17:03:37 +00:00
ryan
9a7c30f64c Run display filters for blog title. Props jhodgdon. fixes #7234
git-svn-id: http://svn.automattic.com/wordpress/trunk@8249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-03 16:05:14 +00:00
ryan
48f963e437 Add med buttons to TinyMCE fullscreen. Props azaozz. fixes #7232
git-svn-id: http://svn.automattic.com/wordpress/trunk@8248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-03 15:55:45 +00:00
ryan
03932fa14f pre_update_option_* filter from DD32. fixes #7233
git-svn-id: http://svn.automattic.com/wordpress/trunk@8247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-03 15:51:53 +00:00
ryan
4cd88d665a phpdoc for feed.php from jacobsantos. fixes #5636
git-svn-id: http://svn.automattic.com/wordpress/trunk@8246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-03 15:23:22 +00:00
ryan
f79638378a Image caption fixes from azaozz. see #6812
git-svn-id: http://svn.automattic.com/wordpress/trunk@8245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-03 05:11:00 +00:00
ryan
ce365c94a4 Use true swfupload version
git-svn-id: http://svn.automattic.com/wordpress/trunk@8243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 23:16:39 +00:00
ryan
3497e63495 Unlink temporary file if sideload fails. see #7220
git-svn-id: http://svn.automattic.com/wordpress/trunk@8241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 22:56:57 +00:00
ryan
eb1f9d0b39 Clean image urls in get_images_from_uri(). see #7220
git-svn-id: http://svn.automattic.com/wordpress/trunk@8240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 22:40:52 +00:00
ryan
88ca7797d1 Image captions from azaozz. see #6812
git-svn-id: http://svn.automattic.com/wordpress/trunk@8239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 18:41:11 +00:00
ryan
ae010f2558 Define WP_CONTENT_DIR in setup-config.php. Props sambauers. fixes #7221
git-svn-id: http://svn.automattic.com/wordpress/trunk@8238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 17:03:55 +00:00
ryan
a2ed9c5f28 Don't match images with tags in them. Props noel. see #7220
git-svn-id: http://svn.automattic.com/wordpress/trunk@8237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 15:26:51 +00:00
ryan
0e91869c14 Make sure htaccess marker begins on a new line. Props johnbillion. fixes #7203
git-svn-id: http://svn.automattic.com/wordpress/trunk@8236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 03:17:53 +00:00
ryan
93bccf8773 Escaping for Press This. see #7220
git-svn-id: http://svn.automattic.com/wordpress/trunk@8235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 02:23:12 +00:00
markjaquith
9772330eb6 Pass AtomPub disabled messaged through translation. props josephscott. see #7157
git-svn-id: http://svn.automattic.com/wordpress/trunk@8234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-02 01:58:38 +00:00
ryan
270555de54 Account for term exclusion filter when creating cache key. Props filosofo. fixes #7213
git-svn-id: http://svn.automattic.com/wordpress/trunk@8225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-07-01 15:54:58 +00:00
ryan
2ea00f0380 Plugins page layout improvements from DD32. see #7091
git-svn-id: http://svn.automattic.com/wordpress/trunk@8218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-30 23:12:18 +00:00
ryan
3c6e74c8c1 comment_rows_actions filter from andy. fixes #7212
git-svn-id: http://svn.automattic.com/wordpress/trunk@8217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-30 20:46:39 +00:00
ryan
af9c3b8896 Use WP_CONTENT_URL in wp_upload_dir(). Props sambauers. fixes #7206
git-svn-id: http://svn.automattic.com/wordpress/trunk@8216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-30 03:33:05 +00:00
ryan
d3a532389d phpdoc updates from jacobsantos. see #5639
git-svn-id: http://svn.automattic.com/wordpress/trunk@8215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-30 03:23:44 +00:00
markjaquith
b45101a5d5 Enable tag auto-suggest for multiple tags at once (without having to hit enter and send each one "down below"). fixes #5580
git-svn-id: http://svn.automattic.com/wordpress/trunk@8214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-30 00:04:22 +00:00
markjaquith
eb3a3bae78 Silently add /index.php/ to category_base and tag_base for blogs using PATHINFO permalinks. fixes #4536
git-svn-id: http://svn.automattic.com/wordpress/trunk@8213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-29 08:20:25 +00:00
markjaquith
a8dd6cb845 make get_alloptions() consistent with get_option() WRT tag_base untrailingslashit()ing
git-svn-id: http://svn.automattic.com/wordpress/trunk@8212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-29 07:44:32 +00:00
ryan
c94918ca9f i18n fixes from nbachiyski. fixes #7195
git-svn-id: http://svn.automattic.com/wordpress/trunk@8211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-28 16:27:21 +00:00
ryan
ba56acc787 Typo fix. Props JeremyVisser. fixes #7196
git-svn-id: http://svn.automattic.com/wordpress/trunk@8210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-28 13:51:39 +00:00
ryan
775ea980f3 Set auth cookie for plugins directory to support direct load plugin files that call auth_redirect(). see #7001
git-svn-id: http://svn.automattic.com/wordpress/trunk@8209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-27 22:54:21 +00:00
ryan
216cdeedea Check fopen return value. Props Otto42 and pishmishy. fixes #4448
git-svn-id: http://svn.automattic.com/wordpress/trunk@8208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-27 20:14:50 +00:00
ryan
6ae5dbab86 Bumpity bump bump
git-svn-id: http://svn.automattic.com/wordpress/trunk@8207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-27 19:47:28 +00:00
ryan
c38fe7ecec Bump script loader versions for jQuery UI 1.5.1
git-svn-id: http://svn.automattic.com/wordpress/trunk@8206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-27 19:44:13 +00:00
ryan
cf447af2f0 jQuery UI 1.5.1
git-svn-id: http://svn.automattic.com/wordpress/trunk@8205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-27 19:41:56 +00:00
ryan
48b43595a6 TinyMCE 3.1.1 from azaozz. fixes #7191
git-svn-id: http://svn.automattic.com/wordpress/trunk@8204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-27 16:13:27 +00:00
ryan
f945453857 phpdoc updates for post.php from jacobsantos. fixes #3982
git-svn-id: http://svn.automattic.com/wordpress/trunk@8203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-27 15:32:57 +00:00
ryan
3f90dc2f58 More informative error message when remote publishing is disabled. Don't disable if upgrading. Props josephscott. see #7157
git-svn-id: http://svn.automattic.com/wordpress/trunk@8202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-26 22:39:57 +00:00
ryan
1fa06da55c Don't prepend http. Props noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-26 22:05:01 +00:00
ryan
78afb8f235 gettext for Press This from Txanny. fixes #7189
git-svn-id: http://svn.automattic.com/wordpress/trunk@8200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-26 20:13:32 +00:00
ryan
3489826131 Fix date() warning on Windows. Props ozh. fixes #7186
git-svn-id: http://svn.automattic.com/wordpress/trunk@8199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-26 18:34:28 +00:00
ryan
5360b75e83 Use number_format and change language. see #6471
git-svn-id: http://svn.automattic.com/wordpress/trunk@8198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-26 17:23:07 +00:00
ryan
63b5bd26fe Only use SSL for login POST links if SSL logins are forced. Clear old cookies. see #7001
git-svn-id: http://svn.automattic.com/wordpress/trunk@8197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-26 16:40:04 +00:00
ryan
f0935b49ae phpdoc for shortcodes from jacobsantos. fixes #7184
git-svn-id: http://svn.automattic.com/wordpress/trunk@8196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-26 15:55:33 +00:00
ryan
3f24ac2605 Fix users.php paging. Props DD32. fixes #4017
git-svn-id: http://svn.automattic.com/wordpress/trunk@8195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-25 17:02:17 +00:00
ryan
061e9c8097 Test for feature instead of browser to fix TB positioning for browsers pretending to be IE6. Props azaozz. fixes #6676
git-svn-id: http://svn.automattic.com/wordpress/trunk@8194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-25 16:58:27 +00:00
ryan
a16f47dc09 SSL touchups for tiny_mce_config. fixes #6759
git-svn-id: http://svn.automattic.com/wordpress/trunk@8193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-25 16:55:16 +00:00
ryan
b42b7b33a7 Image sideloader fix from noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-25 16:45:04 +00:00
ryan
55b0c88e2c Edit image fixes from azaozz: : new link not created if the image has class "aligncenter" in Safari; recalculates the demo image size properly and applies any inline styles to it; if relative link is added, it's converted to absolute; "Unknown error" in IE6. see #6811
git-svn-id: http://svn.automattic.com/wordpress/trunk@8191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-25 16:30:28 +00:00
ryan
636c562256 SSL fixes. see #7001
git-svn-id: http://svn.automattic.com/wordpress/trunk@8190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 22:19:27 +00:00
ryan
cdaefc84b8 Insert image fixes from azaozz. fixes #7177
git-svn-id: http://svn.automattic.com/wordpress/trunk@8189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 21:59:06 +00:00
markjaquith
bf9f2f1cc7 Don't call loop_end hook if we don't have any posts. props Denis-de-Bernardy and DD32. fixes #6769 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 19:58:54 +00:00
ryan
42a058e986 Typo fixes from mark8barnes and AndrewFrazier. fixes #7174
git-svn-id: http://svn.automattic.com/wordpress/trunk@8187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 18:52:52 +00:00
ryan
2a9a3a255d Stub wp_guess_url() for the manifest. Props azaozz. fixes #7015
git-svn-id: http://svn.automattic.com/wordpress/trunk@8186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 18:47:14 +00:00
ryan
f8cc400a40 Disambiguate column. Props voxpelli. fixes #7073
git-svn-id: http://svn.automattic.com/wordpress/trunk@8185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 17:49:24 +00:00
ryan
ad61789fa1 Grammar fix from Viper007Bond. fixes #7172
git-svn-id: http://svn.automattic.com/wordpress/trunk@8184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 17:45:33 +00:00
ryan
9e585b7c30 Add exclude_category argument to wp_list_bookmarks(). Props ionfish. fixes #6808
git-svn-id: http://svn.automattic.com/wordpress/trunk@8183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 17:44:30 +00:00
ryan
ce2ed91698 wp_guess_url() and install styling fixes from sambauers. fixes #7129 see #4732
git-svn-id: http://svn.automattic.com/wordpress/trunk@8182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 17:36:21 +00:00
matt
c64c4fbd63 Better wording for Gears.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 16:57:12 +00:00
ryan
128dfca5d0 Save enable_app and enable_xmlrpc settings. see #7157
git-svn-id: http://svn.automattic.com/wordpress/trunk@8180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 00:46:36 +00:00
ryan
34a726ae12 Remove default feed function when adding new function to hook. fixes #6970
git-svn-id: http://svn.automattic.com/wordpress/trunk@8179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-24 00:29:04 +00:00
ryan
316e26ee39 Respect post_ID update when doing multiple add meta AJAX requests. Props mdawaffe. fixes #7170 see #6457
git-svn-id: http://svn.automattic.com/wordpress/trunk@8177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 23:25:15 +00:00
ryan
4f77631dd4 better handling of comparing a revision to itself. Props mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@8176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 22:45:19 +00:00
ryan
88f779c343 don't show autosave message if post and autosave are 'identical'. Props mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@8175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 22:25:27 +00:00
ryan
36617f11b9 Remove colons from field names. Props thee17. fixes #7158
git-svn-id: http://svn.automattic.com/wordpress/trunk@8174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 21:51:47 +00:00
ryan
3a3c029662 Don't get post ancestors if post not found. Props Sam_a. fixes #6953
git-svn-id: http://svn.automattic.com/wordpress/trunk@8173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 21:50:19 +00:00
ryan
cdc53fcb86 Press This image linking fixes from noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 21:16:39 +00:00
ryan
94183a25cd widget_links_args filter from ionfish. fixes #7024
git-svn-id: http://svn.automattic.com/wordpress/trunk@8171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 17:21:14 +00:00
ryan
9e951d1505 Autosave when Preview is clicked. Props azaozz and DanCoulter. fixes #6682
git-svn-id: http://svn.automattic.com/wordpress/trunk@8170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 16:05:10 +00:00
ryan
9198dc7dbc Press This updates from noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 16:00:12 +00:00
ryan
f42b96cd5e Mark string that cannot be gettexted. Props nbachiyski. fixes #7074
git-svn-id: http://svn.automattic.com/wordpress/trunk@8168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 15:40:43 +00:00
ryan
16dbf2fb1e Edit image updates from azaozz. see #6811
git-svn-id: http://svn.automattic.com/wordpress/trunk@8167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-23 15:26:03 +00:00
ryan
dc6166785a Move separator inside conditional. see #6965
git-svn-id: http://svn.automattic.com/wordpress/trunk@8166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-22 22:48:45 +00:00
ryan
74353f9bcc Beta1
git-svn-id: http://svn.automattic.com/wordpress/trunk@8165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-22 20:45:07 +00:00
ryan
683acd8245 phpdoc updates from jacobsantos. see #7038
git-svn-id: http://svn.automattic.com/wordpress/trunk@8164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-22 20:23:23 +00:00
westi
e6e0954dbb Minor phpdoc fixups.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 20:56:40 +00:00
westi
55836a8b0e Fix a possible fatal error on the dashboard. Fixes #6833 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 17:08:31 +00:00
westi
2b0d5a7cab Allow enabling of remote publishing at install time. See #7157.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 16:35:45 +00:00
westi
a9e944fee6 Bump the db_version so people get the new options for #7157.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 16:15:21 +00:00
ryan
9d418f4cf2 Update blogsearch URL when home changes. Props andy. fixes #7159
git-svn-id: http://svn.automattic.com/wordpress/trunk@8137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 16:06:57 +00:00
ryan
f22abd7533 Disable remote publishing by default. Add options to turn them back on. Props josephscott. see #7157
git-svn-id: http://svn.automattic.com/wordpress/trunk@8136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 15:39:41 +00:00
westi
d76aec25dd Update nickname in display name dropdown dynamically. Fixes #5691 props hansengel.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 15:28:22 +00:00
westi
16126b67e4 Make the SAVEQUERIES define more flexible. Fixes #6764 props filosofo.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 15:17:09 +00:00
westi
f325f82a4d Show comment counts on the dashboard. Fixes #6471 props josephscott.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 14:33:52 +00:00
westi
829ac35bbe Add xoxo microformat markup to the blogroll. Fixes #4954 props Otto42.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 13:54:23 +00:00
westi
e3b575b617 Add new has_tag() template tag. Fixes #6590 props Otto42.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-20 13:52:18 +00:00
ryan
9f3313b115 Press This: Fixes for unicode/ascii/apostrophe problems. Upgrades to the Photo tab. Props noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-19 17:03:23 +00:00
ryan
9482b05698 TinyMCE 3.1.0.1 from azaozz. fixes #7153 #7148 #7128
git-svn-id: http://svn.automattic.com/wordpress/trunk@8127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-19 16:55:50 +00:00
ryan
f90fa97fb2 Always load RTL CSS in manifest. Props azaozz. fixes #7154
git-svn-id: http://svn.automattic.com/wordpress/trunk@8126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-19 16:52:52 +00:00
westi
27c4f3c987 Move another sizeof out of the loop. See #7147.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-18 06:48:48 +00:00
westi
14adf33381 Ensure we initialise the position variable. See #5599 props codestyling.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-18 06:38:30 +00:00
westi
c678502b3d Add XMLRPC options api. See #7123 props josephscott.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-17 20:41:13 +00:00
ryan
3e733d13e8 Press This changes from noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-17 19:36:29 +00:00
ryan
cd81760da2 Make the args for the category drop down query the same as the category table query so that the cache is used. Eliminates a query. see #7147
git-svn-id: http://svn.automattic.com/wordpress/trunk@8112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-17 05:45:21 +00:00
ryan
290dbc03e0 Don't do sizeof() in a loop. Props DD32. see #7147
git-svn-id: http://svn.automattic.com/wordpress/trunk@8111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-17 03:07:42 +00:00
ryan
aa70c022ce Update author link. Props JohnLamansky. fixes #7142
git-svn-id: http://svn.automattic.com/wordpress/trunk@8110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 22:30:46 +00:00
ryan
9b181f0973 previous_post_link and next_post_link filters. Props JohnLamansky. fixes #6985 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 22:27:07 +00:00
ryan
236eb02bee RTL fixes from RanYanivHartstein. fixes #6826 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 22:23:22 +00:00
ryan
d69adece5a category_name is not a valid arg. Use name__like. Props drdavid. fixes #6722 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 22:19:34 +00:00
ryan
7c878c14ad Don't trim strings in maybe_serialize(). Props hakre. fixes #7132 #7133 #4781 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 20:41:02 +00:00
ryan
f5e12d887b Handle cc and bcc. Props MattyRob. fixes #6899
git-svn-id: http://svn.automattic.com/wordpress/trunk@8098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 20:02:10 +00:00
ryan
1349203eed If only one incoming link, show it. Props synapsestudios and hansengel. fixes #7122
git-svn-id: http://svn.automattic.com/wordpress/trunk@8097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 18:44:13 +00:00
ryan
b2e75c5194 Don't decode slug in get_page_uri(). Props nbachiyski. fixes #6723
git-svn-id: http://svn.automattic.com/wordpress/trunk@8096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 18:40:47 +00:00
ryan
22e486c4f8 Delete plugin confirmation from DD32. see #7091
git-svn-id: http://svn.automattic.com/wordpress/trunk@8095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-16 18:35:48 +00:00
westi
84a93d7c65 Fix the phpdoc comments so we don't lose a function :-(. Fixes #7144 props johnhennmacc.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-15 19:11:15 +00:00
ryan
92bf0c6405 Press this updates from noel. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-15 18:05:01 +00:00
westi
d9d640809b PHPDoc updates for functions.php. See #5639 props jacobsantos.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-15 09:38:32 +00:00
westi
bf35dedced PHPDoc updates for comment.php. See #5578 props jacobsantos.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-15 09:34:00 +00:00
westi
c68af8c7db PHPDoc updates for category.php. Fixes #5633 props jacobsantos.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-15 09:32:19 +00:00
ryan
d1be6b2a32 Add paging to Manage->Pages. see #6561
git-svn-id: http://svn.automattic.com/wordpress/trunk@8089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-15 00:45:01 +00:00
ryan
d9d0a899db Add RTL stylesheet for edit image. Props azaozz. see #681!
git-svn-id: http://svn.automattic.com/wordpress/trunk@8088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 21:01:32 +00:00
westi
0dcd6e0e9c Make sure force_ssl_login and force_ssl_admin work as designed. Fixes #7140 props wet.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 20:58:43 +00:00
ryan
e707cb2ff0 Passing categories by ref screws up internal array pointer when recursing. fixes #7138 #7136
git-svn-id: http://svn.automattic.com/wordpress/trunk@8086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 17:22:52 +00:00
westi
437ba6e7b3 ** > *.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 16:57:20 +00:00
westi
b2dd3f0dc4 phpdoc updates for IXR. See #7038 props jacobsantos.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 16:50:55 +00:00
ryan
f8012b15fb Image popup improvements from azaozz. Added translation strings, RTL support, several layout improvements, image border, hspace and vspace can be used as shortcuts to add css styles, the preview is visible on both tabs, etc. see #6811
git-svn-id: http://svn.automattic.com/wordpress/trunk@8083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 16:38:08 +00:00
westi
f8a32e8d47 Updated phpdoc for external libs. See #7038 props jacobsantos.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 16:36:13 +00:00
westi
a9571e003a PHPdoc updates for wp-includes/post.php. See #7038 props jacobsantos.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 16:31:08 +00:00
westi
d367c296f1 Make the subject in "wp-cat2tag.php" translatable. Fixes #7137 props msi08.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 15:08:53 +00:00
ryan
fa01d74d51 Add paging to Manage->Categories. fixes #7136
git-svn-id: http://svn.automattic.com/wordpress/trunk@8079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-13 23:52:07 +00:00
ryan
b583b36cfa Add paging to Manage->Categories. fixes #7136
git-svn-id: http://svn.automattic.com/wordpress/trunk@8078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-13 23:22:29 +00:00
ryan
3189d5c197 Tag to cat converter improvements from azaozz. see #6909
git-svn-id: http://svn.automattic.com/wordpress/trunk@8077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-13 20:23:29 +00:00
ryan
c9b341d759 Update phpdoc comment for wp-load.php. Props sambauers and hansengel. fixes #7127
git-svn-id: http://svn.automattic.com/wordpress/trunk@8076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-13 19:39:04 +00:00
ryan
94eea943d6 wp.getUsersBlogs from josephscott. fixes #7130
git-svn-id: http://svn.automattic.com/wordpress/trunk@8075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-12 21:41:18 +00:00
ryan
6142025639 Encode < and > in wp_richedit_pre. Props azaozz. fixes #6449
git-svn-id: http://svn.automattic.com/wordpress/trunk@8073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-12 21:38:34 +00:00
ryan
830428b928 Press This UI changes and photo loading fixes from noel. fixes #7120 see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@8071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-11 17:45:50 +00:00
ryan
2787d1fde5 Suppress notices while loading config. fixes #6933 see #7087
git-svn-id: http://svn.automattic.com/wordpress/trunk@8070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-11 17:27:28 +00:00
ryan
6adcab8b27 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. see #7001
git-svn-id: http://svn.automattic.com/wordpress/trunk@8069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-11 17:25:55 +00:00
ryan
b666a1c910 Cache get_plugins() list. Props DD32. fixes #7113
git-svn-id: http://svn.automattic.com/wordpress/trunk@8068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-10 16:57:33 +00:00
ryan
7939970055 Press This improvements from noel. fixes #7117
git-svn-id: http://svn.automattic.com/wordpress/trunk@8067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-10 16:13:06 +00:00
ryan
2cc03f7d06 Unify TinyMCE image popup and insert image popup. Props azaozz. see #6811
git-svn-id: http://svn.automattic.com/wordpress/trunk@8066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-10 04:40:21 +00:00
ryan
0679f8501d Back compat fixes for load_plugin_textdomain() from nbachiyski. see #6938
git-svn-id: http://svn.automattic.com/wordpress/trunk@8065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-09 19:39:04 +00:00
ryan
39345ee61c jQuery UI 1.5
git-svn-id: http://svn.automattic.com/wordpress/trunk@8064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-09 19:37:55 +00:00
ryan
975a9c5120 Add php end tag. fixes #7111
git-svn-id: http://svn.automattic.com/wordpress/trunk@8063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-09 17:36:39 +00:00
ryan
eeca693b1e Fix the tag suggest drop-down list for Press This. Props azaozz. see #7066
git-svn-id: http://svn.automattic.com/wordpress/trunk@8062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-09 03:53:30 +00:00
ryan
d1e50738c7 Don't forget to echo. Props DD32. fixes #7107 see #7001
git-svn-id: http://svn.automattic.com/wordpress/trunk@8061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-08 16:56:00 +00:00
ryan
385d3d9500 Add delete_plugins and update_plugins caps. Props DD32. fixes #7096
git-svn-id: http://svn.automattic.com/wordpress/trunk@8060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-06 19:21:35 +00:00
ryan
5b1fffa322 Fix url encode/decode issues in Press This. Props noel. fixes #7105
git-svn-id: http://svn.automattic.com/wordpress/trunk@8059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-06 08:49:45 +00:00
ryan
c790febe36 More use of site_url(), admin_url(), and site_url(). Force login and admin links to be https if FORCE_SSL_LOGIN. see #7001
git-svn-id: http://svn.automattic.com/wordpress/trunk@8058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-06 07:39:11 +00:00
ryan
ab39b3b321 Revert [8056], didn't quite work
git-svn-id: http://svn.automattic.com/wordpress/trunk@8057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-06 07:34:30 +00:00
ryan
23cfaa55e9 Update to swfupload 2.1.0
git-svn-id: http://svn.automattic.com/wordpress/trunk@8056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-06 07:29:15 +00:00
ryan
220af4a96e Typo fix. fixes #7104
git-svn-id: http://svn.automattic.com/wordpress/trunk@8055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-06 01:45:58 +00:00
ryan
570cb5374c Strip shortcodes when making excerpts. Props hailin. fixes #7100
git-svn-id: http://svn.automattic.com/wordpress/trunk@8054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-05 20:11:38 +00:00
ryan
f3de02cca6 Use WP_CONTENT_DIR to fix theme editor file loading. Props ionfish. fixes #7097
git-svn-id: http://svn.automattic.com/wordpress/trunk@8053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-05 16:39:20 +00:00
ryan
f7f3005004 close the socket in discover_pingback_server_uri
git-svn-id: http://svn.automattic.com/wordpress/trunk@8052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 23:36:55 +00:00
ryan
06ec52753b Use WP_CONTENT_DIR in get_page_templates(). Props ionfish. see #7059
git-svn-id: http://svn.automattic.com/wordpress/trunk@8051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 23:15:55 +00:00
ryan
0c9006cc2d Typo fix
git-svn-id: http://svn.automattic.com/wordpress/trunk@8050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 20:21:02 +00:00
ryan
8377b52dc8 Bulk delete/activate/deactivate for plugins. Split plugins into active and available lists. Props DD32. see #7091
git-svn-id: http://svn.automattic.com/wordpress/trunk@8049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 18:09:31 +00:00
ryan
6aaddbee0a Press This enhancement from noel. see #7066
git-svn-id: http://svn.automattic.com/wordpress/trunk@8048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 16:13:55 +00:00
ryan
f1b8d9596a TinyMCE 3.0.9 from azaozz. fixes #7088
git-svn-id: http://svn.automattic.com/wordpress/trunk@8047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 15:31:14 +00:00
ryan
f9575ae66d Revert jQuery hack. see #7082
git-svn-id: http://svn.automattic.com/wordpress/trunk@8046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 05:31:56 +00:00
ryan
aec22e8e72 Replace ref to dimensions with jquery core
git-svn-id: http://svn.automattic.com/wordpress/trunk@8045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 05:19:23 +00:00
ryan
17c0d8910b Add missing semi. see #7082
git-svn-id: http://svn.automattic.com/wordpress/trunk@8044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 01:52:27 +00:00
ryan
151bfc3ab1 Hacked up version of jQuery to workaround Safari 2.0.4 bug. see #7082
git-svn-id: http://svn.automattic.com/wordpress/trunk@8043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 01:47:11 +00:00
ryan
b114864b84 Dimensions is now part of jquery core
git-svn-id: http://svn.automattic.com/wordpress/trunk@8042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-04 01:24:04 +00:00
ryan
4f3b306abe Make load_plugin_textdomain() work with WP_CONTENT_DIR. Props sambauers. see #6938
git-svn-id: http://svn.automattic.com/wordpress/trunk@8041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-03 17:19:47 +00:00
ryan
51591b778b Use WP_CONTENT_DIR and URL when linking to theme screenshots. Props sambauers. see #6938
git-svn-id: http://svn.automattic.com/wordpress/trunk@8040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-03 17:17:45 +00:00
ryan
6e6f0e753a Bump jQuery to latest svn.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-03 16:44:51 +00:00
ryan
f67c15ad9c Remove thickbox enqueueing. Props azaozz. fixes #7078
git-svn-id: http://svn.automattic.com/wordpress/trunk@8038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-03 15:39:20 +00:00
ryan
dbeefeb210 Enable autosave for fullscreen mode. Props azaozz. fixes #7069
git-svn-id: http://svn.automattic.com/wordpress/trunk@8037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-03 08:15:39 +00:00
ryan
8ef3a7f4d2 Gears instead of Google Gears. Props azaozz. fixes #6965
git-svn-id: http://svn.automattic.com/wordpress/trunk@8036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-03 08:14:38 +00:00
ryan
ed30026ce8 Word count fix from azaozz. fixes #6991
git-svn-id: http://svn.automattic.com/wordpress/trunk@8035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-03 08:13:33 +00:00
ryan
e455106cdf Don't unpublish pages when a user who can edit publised pages but not publish new pages edits a page. Props jeremyclarke. see #6943 #7070 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-03 06:44:40 +00:00
ryan
3b7179f50e Add thickbox to pages that use media uploader.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-02 21:46:25 +00:00
ryan
4bb7f1c0c4 Don't unpublish posts when a user edit who can edit publised posts but not publih new posts edits a post. Props jeremyclarke. see #7070 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-02 21:01:42 +00:00
ryan
282cb020ea Use ORIG_PATH_INFO, if available. Props singpolyma. fixes #6995
git-svn-id: http://svn.automattic.com/wordpress/trunk@8031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-02 20:38:39 +00:00
ryan
f657d4cb64 New filter and phpdoc for get_image_tag(). Props jacobsantos. fixes #7065 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-31 19:12:55 +00:00
matt
727379047b Don't prepend the host if it's already a full URL.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-31 10:51:50 +00:00
ryan
2e51769171 Close link postboxes
git-svn-id: http://svn.automattic.com/wordpress/trunk@8026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 21:16:33 +00:00
ryan
1c60b9e2d6 add_meta_box() for edit link form. fixes #6964
git-svn-id: http://svn.automattic.com/wordpress/trunk@8025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 21:16:15 +00:00
ryan
5ad5715af7 Add some noncing. Props andy.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 20:43:36 +00:00
ryan
a5336482b1 Add charset to async-upload content-type header. Props duncanmc. fixes #6873 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 20:42:28 +00:00
ryan
e7c4a9de85 get_post_ancestors() fixes. fixes #7029 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 20:31:45 +00:00
ryan
d1d186cd35 WP_Filesystem updates from DD32. See #7059
git-svn-id: http://svn.automattic.com/wordpress/trunk@8018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 16:14:05 +00:00
ryan
9b1e23680a Add label associations to press this. Props MarcoZ. fixes #7067
git-svn-id: http://svn.automattic.com/wordpress/trunk@8017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 16:00:37 +00:00
ryan
8d7b9c3a08 Dashboard validation fixes from Viper007Bond and mdawaffe. fixes #7064
git-svn-id: http://svn.automattic.com/wordpress/trunk@8016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 15:59:14 +00:00
ryan
d1073bd67d Write Post h2 positioning fix from azaozz. fixes #7063
git-svn-id: http://svn.automattic.com/wordpress/trunk@8015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-30 00:07:26 +00:00
ryan
90731cb5eb Gears validation fixes. Props mdawaffe. see #6965
git-svn-id: http://svn.automattic.com/wordpress/trunk@8014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-29 23:36:26 +00:00
ryan
ed5eba0909 Make some of the color CSS selectors more specific so that the category tabs on the Write page don't get messed up. Props mdawaffe. see #6998
git-svn-id: http://svn.automattic.com/wordpress/trunk@8013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-29 23:30:28 +00:00
ryan
18fb540124 Validation fixes for post revisions. Props mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@8012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-29 23:16:11 +00:00
ryan
0db872b5a1 Post revisions API cleanup from mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@8011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-29 22:21:36 +00:00
ryan
9a21aad36a Typo fixes from azaozz. see #7059
git-svn-id: http://svn.automattic.com/wordpress/trunk@8010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-29 19:06:27 +00:00
ryan
ffd63e3b33 Make WP_Filesystem work with new directory constants. Props DD32. fixes #7059
git-svn-id: http://svn.automattic.com/wordpress/trunk@8009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-29 17:29:32 +00:00
ryan
f3511b048c styles should come before scripts should come before head. Props mdawaffe
git-svn-id: http://svn.automattic.com/wordpress/trunk@8008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-28 22:15:46 +00:00
ryan
2b4f2fd621 Press this reorg. Remove old bookmarklet. Props noel. see #7049
git-svn-id: http://svn.automattic.com/wordpress/trunk@8007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-28 18:18:44 +00:00
ryan
995fe002be Use siteurl instead of home. Props msi08. fixes #7050
git-svn-id: http://svn.automattic.com/wordpress/trunk@8006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-28 16:53:29 +00:00
ryan
f57354bf63 Fix duplicate comment notifications. Props MtDewVirus. fixes #6892 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-28 15:37:59 +00:00
ryan
eb60fb288d Always hide gears popup. Props azaozz. see #6965
git-svn-id: http://svn.automattic.com/wordpress/trunk@8003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-28 00:09:19 +00:00
ryan
f804d1fa66 Stub site_url() and admin_url() for manifest. Props azaozz. see #6965
git-svn-id: http://svn.automattic.com/wordpress/trunk@8002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-27 20:35:14 +00:00
ryan
af2c9dd301 Fix slashing in tag feed link. fixes #7044 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-27 17:56:46 +00:00
ryan
6c8d35de32 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
git-svn-id: http://svn.automattic.com/wordpress/trunk@7999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-27 17:55:24 +00:00
ryan
9771ec5110 First cut and better admin SSL support. see #7001
git-svn-id: http://svn.automattic.com/wordpress/trunk@7998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-27 17:46:01 +00:00
ryan
67c2a2aced Better random email addresses. Props nbachiyski. fixes #7020
git-svn-id: http://svn.automattic.com/wordpress/trunk@7997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-27 11:48:07 +00:00
ryan
c85f779dbb gettext fix from thenlich. fixes #6993 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-27 11:42:32 +00:00
ryan
7996d826e3 Fix serialization when adding meta via update_post_meta(). Props azaozz. fixes #7018
git-svn-id: http://svn.automattic.com/wordpress/trunk@7995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-27 11:33:11 +00:00
ryan
0aeb94233d inline docs for wp_admin_css(). Props mdawaffe. see #7033
git-svn-id: http://svn.automattic.com/wordpress/trunk@7994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-25 21:23:22 +00:00
ryan
5564bccc32 Press This: Obey color scheme. Props azaozz. see #6998
git-svn-id: http://svn.automattic.com/wordpress/trunk@7993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-25 20:39:16 +00:00
ryan
5322be300a File file level phpdoc from jacobsantos. see #7037
git-svn-id: http://svn.automattic.com/wordpress/trunk@7992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-25 20:33:13 +00:00
ryan
a6a1522a8d File file level phpdoc from jacobsantos. see #7037
git-svn-id: http://svn.automattic.com/wordpress/trunk@7991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-25 15:50:15 +00:00
ryan
62784a594f phpdoc updates from jacobsantos. see #7038
git-svn-id: http://svn.automattic.com/wordpress/trunk@7990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-25 15:45:05 +00:00
ryan
fba6b2415c Fixes timing issue in IE6 in the TB mod scripts. Reorders css files to load before js in the admin head. Props azaozz. fixes #7032
git-svn-id: http://svn.automattic.com/wordpress/trunk@7989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-24 17:06:26 +00:00
ryan
b70d3b2028 Few css fixes for the media uploader, confirm delete of attachments from the library tab. Props azaozz. fixes #7033
git-svn-id: http://svn.automattic.com/wordpress/trunk@7988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-24 17:03:51 +00:00
ryan
81a8e065c6 Allow defining the number of revisions to save. Props mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@7987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-23 15:27:56 +00:00
ryan
58e47dcb4a wp_cache_add_global_groups() and wp_cache_add_non_persistent_groups(). fixes #6740
git-svn-id: http://svn.automattic.com/wordpress/trunk@7986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 17:28:54 +00:00
ryan
53ecaddb5f Remove unnecessary checks for the existence of post meta data. Props filosofo. fixes #7018
git-svn-id: http://svn.automattic.com/wordpress/trunk@7985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 16:33:06 +00:00
ryan
a3d971bd3e gettext for Press This. Props SteveAgl. fixes #702!
git-svn-id: http://svn.automattic.com/wordpress/trunk@7984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 15:48:32 +00:00
ryan
7d4065182b Press This fixes from noel. see #6998
git-svn-id: http://svn.automattic.com/wordpress/trunk@7983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 15:47:37 +00:00
ryan
087c490eab Version bump, still bleeding.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 15:45:50 +00:00
ryan
526476fbcf Use style loader for gears manifest. Props azaozz. fixes #7015
git-svn-id: http://svn.automattic.com/wordpress/trunk@7981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 15:27:28 +00:00
ryan
05f229cef0 Don't double escape. fixes #7018
git-svn-id: http://svn.automattic.com/wordpress/trunk@7980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 00:12:17 +00:00
ryan
68a874a4dd wp_admin_css() improvements. Props mdawaffe. see #7011
git-svn-id: http://svn.automattic.com/wordpress/trunk@7979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 00:06:41 +00:00
ryan
3846bff484 Add non-existent values instead of returning g false in update_post_meta(). Props filosofo. fixes #7018
git-svn-id: http://svn.automattic.com/wordpress/trunk@7978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-22 00:01:00 +00:00
ryan
631665ffe5 Remove colors from widgets.css, use colors css. Props johnhennmacc. fixes #7017
git-svn-id: http://svn.automattic.com/wordpress/trunk@7977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-21 23:36:06 +00:00
ryan
9178934544 Add wp_default_styles(), convert wp_admin_css(). Props mdawaffe. see #7011
git-svn-id: http://svn.automattic.com/wordpress/trunk@7976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-21 23:24:23 +00:00
ryan
1519e51f89 wp-ajax.js is no longer used
git-svn-id: http://svn.automattic.com/wordpress/trunk@7975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-21 20:27:36 +00:00
ryan
8f2a589e21 Add sorting to gallery. Props AaronCampbell. fixes #6988
git-svn-id: http://svn.automattic.com/wordpress/trunk@7974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-21 18:29:46 +00:00
ryan
5f8d0313a8 jQuery update
git-svn-id: http://svn.automattic.com/wordpress/trunk@7973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-21 18:19:44 +00:00
ryan
f0be83149e Add theme paging for those who can't bear to pare down their huge theme collection. You know who you are. see #5486
git-svn-id: http://svn.automattic.com/wordpress/trunk@7972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-21 17:36:41 +00:00
ryan
5b8113578d Allow wp-config.php to exist one level up from WordPress root directory. Props sambauers. fixes #6933
git-svn-id: http://svn.automattic.com/wordpress/trunk@7971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-21 05:59:27 +00:00
ryan
e9aa24cffb Style loader from mdawaffe. see #7011
git-svn-id: http://svn.automattic.com/wordpress/trunk@7970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-21 05:56:04 +00:00
ryan
d0e696c185 Allow lang and xml:lang for span. Props MtDewVirus. fixes #7003
git-svn-id: http://svn.automattic.com/wordpress/trunk@7969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 23:56:28 +00:00
ryan
ae3cca9951 Add space. Props MtDewVirus. fixes #6972
git-svn-id: http://svn.automattic.com/wordpress/trunk@7968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 23:50:29 +00:00
ryan
f08f975835 Fix trackback meta box. Props mdawaffe. fixes #7010
git-svn-id: http://svn.automattic.com/wordpress/trunk@7967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 23:46:31 +00:00
ryan
41c7bca7d0 Don't use php 5 only component parameter to parse_url. Props azaozz. see #6998
git-svn-id: http://svn.automattic.com/wordpress/trunk@7966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 22:26:20 +00:00
ryan
47e6a79b98 Export and import post excerpts. Props kartik_subbarao. fixes #5555
git-svn-id: http://svn.automattic.com/wordpress/trunk@7965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 22:22:21 +00:00
ryan
a54eb08d09 Widget edit link layout fixes from mdawaffe. fixes #6371
git-svn-id: http://svn.automattic.com/wordpress/trunk@7964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 19:57:38 +00:00
ryan
74f878d040 Some URL cleaning
git-svn-id: http://svn.automattic.com/wordpress/trunk@7962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 18:01:43 +00:00
ryan
bc07ef1efe Theme preview and thickbox CSS cleanup. Props azaozz. see #5486
git-svn-id: http://svn.automattic.com/wordpress/trunk@7961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 17:19:33 +00:00
ryan
e9ea1ab0ef get_archives_link filter. Props codealsatian. fixes #5530 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 16:43:44 +00:00
ryan
d917ddc2f5 Relocate signon to the top. Props AaronCampbell. fixes #7002
git-svn-id: http://svn.automattic.com/wordpress/trunk@7958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 16:40:49 +00:00
ryan
60e440142e Press This styling updates from noel. fixes #6998
git-svn-id: http://svn.automattic.com/wordpress/trunk@7957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-20 16:37:54 +00:00
ryan
01acf41355 Put checked categories at the top of the checlist. Props mdawaffe. fixes #7000 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-19 21:35:18 +00:00
ryan
3ce00adc38 Use user_trailingslashit. Props Sam_a. fixes #6996 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-19 18:51:28 +00:00
ryan
96c73cc917 Make sure taxonomy args are set before using. Props Sam_a. fixes #6960 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-19 18:47:33 +00:00
ryan
9e4e87d975 Gears update from azaozz. see #6965
git-svn-id: http://svn.automattic.com/wordpress/trunk@7951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-19 15:41:31 +00:00
ryan
c72356b0b4 Fix FTP SSL setting. Props DD32. fixes #6986 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-18 20:09:52 +00:00
ryan
78bad5259d add_meta_box() for edit page form. Props DD32. see #6964
git-svn-id: http://svn.automattic.com/wordpress/trunk@7948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-18 20:08:18 +00:00
ryan
b8654e4cdf Check WP_INSTALLING when setting cookiehash. Props DD32. fixes #6990
git-svn-id: http://svn.automattic.com/wordpress/trunk@7947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-18 20:06:31 +00:00
ryan
0a0216a765 Trailing whitespace cleanup.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-17 18:50:54 +00:00
ryan
2ed0873cd2 Some escaping. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@7945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-16 23:20:56 +00:00
ryan
85df87de5a Init array. Props DD32. fixes #6981
git-svn-id: http://svn.automattic.com/wordpress/trunk@7944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-16 16:33:11 +00:00
ryan
4e1a352771 Streamline manifest includes. Props azaozz. see #6965
git-svn-id: http://svn.automattic.com/wordpress/trunk@7943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-16 16:25:33 +00:00
ryan
dc6fa76e51 Remove old #your-profile fieldset CSS. fixes #6982
git-svn-id: http://svn.automattic.com/wordpress/trunk@7942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-16 16:18:23 +00:00
matt
2d8fa9ee21 get_queried_object should not return an array of terms, and wp_title should check is_tax. Hat tip: andy
git-svn-id: http://svn.automattic.com/wordpress/trunk@7941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-16 03:57:09 +00:00
matt
7b0c0703f5 Fix default taxonomy query var. Populate taxonomy and term query vars ASAP. Fixes template fall-through. Hat tip: andy
git-svn-id: http://svn.automattic.com/wordpress/trunk@7940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-16 02:35:24 +00:00
matt
691eccf400 Use TT ids instead of term ids. Hat tip: andy.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-16 01:43:35 +00:00
ryan
e9c054e143 Support for Google Gears managed offline storage. Props azaozz. see #6965
git-svn-id: http://svn.automattic.com/wordpress/trunk@7938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-15 22:57:14 +00:00
ryan
4bf3397cb9 Clear out bad activation keys from 2.5.1. fixes #6842 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-15 20:07:54 +00:00
ryan
0553790ede jQuery UI core and tabs 1.5b4
git-svn-id: http://svn.automattic.com/wordpress/trunk@7935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-15 03:45:42 +00:00
ryan
6762f6169e Press This: Fetch offsite images, fix slashing. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@7934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-15 00:20:27 +00:00
ryan
36badd926e Only img src. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@7933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-14 23:21:28 +00:00
ryan
7ce984281f Press This: AJAX load all tabs, add tag UI, make category list scrollable.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-14 20:01:09 +00:00
ryan
aa927d3859 Brand as Press This. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@7931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-14 16:59:07 +00:00
ryan
c46da4e0f5 Add default edit post meta boxes via API. see #6964
git-svn-id: http://svn.automattic.com/wordpress/trunk@7930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-14 08:22:01 +00:00
ryan
b76608029b Word count detection fix from ramenboy. fixes #6967
git-svn-id: http://svn.automattic.com/wordpress/trunk@7929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-14 04:07:42 +00:00
ryan
90973154fe Add spinner
git-svn-id: http://svn.automattic.com/wordpress/trunk@7928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-13 22:17:29 +00:00
ryan
967ee06a32 Don't pass image list via GET. Fetch images remotely. Load photo tab via AJAX. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@7927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-13 22:12:52 +00:00
ryan
7b1e56dc06 default is a valid page template. see #6098
git-svn-id: http://svn.automattic.com/wordpress/trunk@7925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-13 21:03:10 +00:00
ryan
9b7daff0b4 Quick post updates: More gettext, escaping, compress bookmarklet JS. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@7924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-13 16:02:12 +00:00
ryan
f6d1274333 Quick post TMCE improvements: add new theme, languages, support for Safari, modal dialogs, changed some settings to be the same like the write page, small css fixes. Props azaozz. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@7923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-13 15:22:52 +00:00
ryan
e44fe50107 Some cleaning
git-svn-id: http://svn.automattic.com/wordpress/trunk@7922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-13 00:03:11 +00:00
ryan
dcf35ab2ed Add some page template validation
git-svn-id: http://svn.automattic.com/wordpress/trunk@7921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-12 23:51:54 +00:00
ryan
9830ab988c Quick post bookmarklet. First cut. see #6813
git-svn-id: http://svn.automattic.com/wordpress/trunk@7919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-12 19:08:39 +00:00
ryan
359601b720 Resurrect comment approval notification. Props chmac. fixes #6892 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-12 16:14:15 +00:00
markjaquith
61881c0e82 Do not use the "home"-supplied host for canonical redirects if no host is there specified. props thenlich. fixes #6890
git-svn-id: http://svn.automattic.com/wordpress/trunk@7916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-09 18:23:05 +00:00
ryan
6d3c98a56f strtolower widget id. Props filosofo. fixes #6949
git-svn-id: http://svn.automattic.com/wordpress/trunk@7915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-09 16:29:17 +00:00
ryan
94eb7224bb Use wp_count_comments() in wp.getCommentCount. Props josephscott. fixes #6941
git-svn-id: http://svn.automattic.com/wordpress/trunk@7914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-09 16:02:44 +00:00
ryan
3c8cb2b079 Revisioning for pages from mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@7913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-09 15:59:17 +00:00
markjaquith
25b49b2ceb Remove last remaining user level checks in favor of capabilities checks. props filosofo. fixes #6940
git-svn-id: http://svn.automattic.com/wordpress/trunk@7912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-09 00:45:17 +00:00
ryan
938f29414f Use array calling style. see #6647
git-svn-id: http://svn.automattic.com/wordpress/trunk@7911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-08 19:19:58 +00:00
ryan
2abe38c548 number_format_i18n() for comments_number()
git-svn-id: http://svn.automattic.com/wordpress/trunk@7910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-08 17:54:40 +00:00
ryan
0ddd511f36 global-rtl.css from mdawaffe. fixes #6931 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-08 17:46:46 +00:00
ryan
129d030c20 Move autosave to post revisions. Props mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@7907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-08 17:25:07 +00:00
ryan
7a0f94ffa3 Query cleanups. Use absint, concat where instead of overwrite, make post_parent independent, sanitize post__in and post__not_in. Props mdawaffe. see #6772
git-svn-id: http://svn.automattic.com/wordpress/trunk@7906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-08 05:17:27 +00:00
ryan
c25a6fe381 Fix page 404 when page_for_posts is empty. see #6539
git-svn-id: http://svn.automattic.com/wordpress/trunk@7905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-07 19:57:15 +00:00
ryan
d8ee8494be [7064] introduces an extra query for each call to in_category(). Avoid the query if an int is passed.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-07 19:12:44 +00:00
ryan
87db175abe Add current_category option to wp_list_categories(). Props filosofo. fixes #6928
git-svn-id: http://svn.automattic.com/wordpress/trunk@7903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-07 19:10:36 +00:00
ryan
5a9d1d9c8d Add arg as array. Props MtDewVirus. fixes #6924
git-svn-id: http://svn.automattic.com/wordpress/trunk@7902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-06 17:28:24 +00:00
ryan
5d69e51c86 Expose page template functionality via XML-RPC. Props josephscott. fixes #6098
git-svn-id: http://svn.automattic.com/wordpress/trunk@7901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-06 16:49:42 +00:00
ryan
15a9bac5ad wp_insert_post() -- Validate page template, check return of insert and update queries, add option to return WP_Error. fixes #6227 see #6098
git-svn-id: http://svn.automattic.com/wordpress/trunk@7900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 23:19:27 +00:00
ryan
ecc6151966 Get color option for user being edited, not current user. Props regulatethis. fixes #6911 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 20:06:37 +00:00
ryan
04b03a7906 Show when a term is both a category and a tag, also when a child category is converted to a tag and then converted back, restore the child status, if the parent still exists. Props azaozz. fixes #6909
git-svn-id: http://svn.automattic.com/wordpress/trunk@7897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 17:15:35 +00:00
ryan
0b05038ebb Add editable_slug filter. Props nbachiyski. see #6915
git-svn-id: http://svn.automattic.com/wordpress/trunk@7896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 17:08:13 +00:00
ryan
742f09dbc7 Use full path to fs abstraction class. Props DD32. fixes #6912
git-svn-id: http://svn.automattic.com/wordpress/trunk@7895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 17:06:29 +00:00
ryan
a3bc5f60da Use array calling style. Props DD32. see #6647
git-svn-id: http://svn.automattic.com/wordpress/trunk@7894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 16:03:27 +00:00
ryan
34314a54e5 Add definite article. Props filosofo. fixes #5986
git-svn-id: http://svn.automattic.com/wordpress/trunk@7893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 15:55:00 +00:00
ryan
3d5a874774 get_posts fixes from DD32 and filosofo. see #6772
git-svn-id: http://svn.automattic.com/wordpress/trunk@7892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 15:46:32 +00:00
westi
26529c1423 Revert [7887] see #6915.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-05 08:15:54 +00:00
westi
a5dc032654 Add missing form end tag.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-04 21:31:29 +00:00
westi
7759f1672f Add ARIA markup for required fields. Fixes #6914 props MarcoZ.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-04 21:28:12 +00:00
westi
ae998b8a76 Make international slugs easier to edit. Fixes #6915 props options.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-04 21:13:42 +00:00
ryan
76dfbdfb11 Add blank to default avatars. Rename default to Mystery Man. see #6802
git-svn-id: http://svn.automattic.com/wordpress/trunk@7886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-04 18:05:20 +00:00
westi
9962fa1f0b Always set the locale to something. Fixes #6872 props MarcoZ.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-04 17:28:42 +00:00
westi
38ebc1a0ee Fix _deprecated_function() and _deprecated_file() so that they work correctly. Props JonathanRogers and DD32.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-04 10:44:44 +00:00
westi
3cbcbbbfb4 Associate lables with form fields. Fixes #6859 props MarcoZ.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-04 10:37:06 +00:00
ryan
7623315990 Widget arrangement fix from azaozz. fixes #6876 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-04 02:05:18 +00:00
ryan
d9fd98601e Use WP_query in get_posts(). Props filosofo. fixes #6772
git-svn-id: http://svn.automattic.com/wordpress/trunk@7880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-03 20:08:32 +00:00
ryan
fbcbedc4f0 Default avatar selector. Props Viper007Bond. see #6802
git-svn-id: http://svn.automattic.com/wordpress/trunk@7879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-03 00:56:16 +00:00
ryan
63d12e0b39 Use 'counts' cache group. see #6884
git-svn-id: http://svn.automattic.com/wordpress/trunk@7878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-02 19:42:44 +00:00
ryan
c75f6c7695 Fix post name check prepare. Props westi. see #6894
git-svn-id: http://svn.automattic.com/wordpress/trunk@7876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-02 17:28:19 +00:00
ryan
b9e595d3a5 Fix send_to_editor escaping. Props Glotzfisch. fixes #6898 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-02 17:25:54 +00:00
ryan
90f52c0fc3 Use array calling style. Props guillep2k for the find. fixes #6637 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-02 16:59:49 +00:00
ryan
2fd45c2192 Don't redirect robots. Props thenlich and DD32. fixes #6891
git-svn-id: http://svn.automattic.com/wordpress/trunk@7871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-01 21:38:40 +00:00
ryan
4a19108aaf Classic theme navigation fix from Otto42. fixes #6513 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-01 21:35:57 +00:00
ryan
8c59e943d4 Add per post counting to wp_count_comments(). Props josephscott. fixes #6884
git-svn-id: http://svn.automattic.com/wordpress/trunk@7868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-01 16:52:48 +00:00
ryan
43fc7beb08 Refresh thickbox css. Props azaozz. fixes #6843 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-05-01 16:51:28 +00:00
ryan
8cabdbc588 Bump script vers. see #6843
git-svn-id: http://svn.automattic.com/wordpress/trunk@7864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-30 23:33:57 +00:00
ryan
020eb02ef0 thickbox and media upload fixes from azaozz. fixes #6843
git-svn-id: http://svn.automattic.com/wordpress/trunk@7862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-30 20:21:09 +00:00
ryan
96cdf5c7a7 send_to_editor fix for FF. Props azaozz. fixes #6864 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-30 20:12:39 +00:00
ryan
0f13be9815 Add comments_per_page filter
git-svn-id: http://svn.automattic.com/wordpress/trunk@7859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-30 20:05:25 +00:00
ryan
7750cc0d90 Use number_format_i18n on Awaiting Moderation count. fixes #6700 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-29 23:19:31 +00:00
ryan
ef4c69fcfd Use number_format_i18n on Awaiting Moderation count. fixes #6700 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-29 23:02:15 +00:00
ryan
123a6091fb Word count from azaozz. see #4807
git-svn-id: http://svn.automattic.com/wordpress/trunk@7854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-29 19:17:23 +00:00
ryan
ca284189fb Typo fix
git-svn-id: http://svn.automattic.com/wordpress/trunk@7852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-29 18:35:04 +00:00
ryan
f97c96fde0 Use wp_count_comments() instead of direct query.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-29 18:30:45 +00:00
ryan
88b23960fb widget_title filters from jhodgdon. fixes #6684
git-svn-id: http://svn.automattic.com/wordpress/trunk@7850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-29 16:08:19 +00:00
ryan
499ac46099 Multi-widget pattern documentation typo fixes from Jaymin Patel. fixes #6866
git-svn-id: http://svn.automattic.com/wordpress/trunk@7849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-28 20:08:23 +00:00
ryan
45302a3d9a Add populate_options action. Props RanYanivHartstein. fixes #6854
git-svn-id: http://svn.automattic.com/wordpress/trunk@7848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-28 19:55:00 +00:00
ryan
ded2d7929d Handle enclosures in xmlrpc. Props josephscott. fixes #3405
git-svn-id: http://svn.automattic.com/wordpress/trunk@7847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-28 16:15:23 +00:00
ryan
a2220d1659 Consolidate class attributes. Props robertaccettura. fixes #6853 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-28 15:17:55 +00:00
westi
b119ab7003 Bump the db version so [7841] has an affect.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-28 06:19:33 +00:00
westi
5a375132ac Make sure the direct feed files work when siteurl == homeurl. Fixes #6460 for trunk props DD32.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-28 06:17:01 +00:00
ryan
2a8733a159 tempnam workarounds from DD32. see #6465
git-svn-id: http://svn.automattic.com/wordpress/trunk@7840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 21:34:54 +00:00
ryan
7564d59d47 Don't reuse image_send_to_editor filter in get_image_tag(). Props AaronCampbell. fixes #6806 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 17:58:38 +00:00
ryan
87b1154989 Add arg to make special chars optional when generating passwords. fixes #6842 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 17:12:25 +00:00
ryan
cbf1aed77d Allow editing of attachmentts with no titles. Props mdawaffe. fixes #6839 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 15:28:08 +00:00
ryan
2fc180fa45 Move cap check up. Props mdawaffe. fixes #6838 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 15:23:11 +00:00
ryan
77087fe6fa Add cap checks. see #6838
git-svn-id: http://svn.automattic.com/wordpress/trunk@7827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 15:01:02 +00:00
markjaquith
4b2959f55b fix typo in [7820] for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 06:40:12 +00:00
ryan
76a87862bf Add some sanity checks
git-svn-id: http://svn.automattic.com/wordpress/trunk@7821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 06:20:18 +00:00
markjaquith
08f237c227 attribute_escape() and int-casting paranoia for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 06:15:17 +00:00
markjaquith
6d0ac532e3 attribute_escape() type in the media-uploder. props Alex Concha. for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 05:55:01 +00:00
markjaquith
60aab00ba1 Fix typo in wp_save_revision(). props Andy. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@7817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 04:41:41 +00:00
markjaquith
ca6bd9ebd5 Don't wpautop()-wrap shortcodes that stand alone. fixes #6444 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 00:45:31 +00:00
markjaquith
6930439dfe Revert [7700] from trunk in preparation for a different #6444 solution
git-svn-id: http://svn.automattic.com/wordpress/trunk@7814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 00:43:44 +00:00
ryan
f3d3b700f5 Bump the autosave re-enable delay to 5 seconds, makes sure we manually re-enable the buttons on ajax success, and visually dim the disabled buttons for some UI feedback. Props mdawaffe. fixes #6707 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-25 00:32:29 +00:00
ryan
31f09d0b85 Typo fix
git-svn-id: http://svn.automattic.com/wordpress/trunk@7810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-24 17:33:58 +00:00
ryan
b67cfee094 Document new secret-key API in sample config.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-24 17:26:36 +00:00
ryan
123cd6550a Discard buffers. Props azaozz. fixes #6794 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-24 01:25:33 +00:00
ryan
0101f8809d strlen - 1. Props mdawaffe. see #6146
git-svn-id: http://svn.automattic.com/wordpress/trunk@7802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-24 01:13:35 +00:00
ryan
cad2447ddc Don't query for checked categories for new posts.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-24 00:54:27 +00:00
ryan
eb9c8420db hash_hmac is always available. Drop function_exists check
git-svn-id: http://svn.automattic.com/wordpress/trunk@7797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-24 00:30:49 +00:00
ryan
4680f8f084 Add length arg to wp_generate_password() and lengthen secret. Props tellyworth. fixes #6146 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-24 00:19:09 +00:00
markjaquith
1e811e8742 Fix redirect issue with null post_ID equaling null url_to_postid(). fixes #6674 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-23 22:58:36 +00:00
ryan
eaf44137c6 Reverting [7729]. Breaks listing of categories with posts that have parents with no posts.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-23 22:00:31 +00:00
ryan
8709169ef9 Disable buttons until autosave completes. Props mdawaffe. fixes #6707 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-23 02:22:55 +00:00
ryan
b82f47cc97 Disable buttons until autosave completes. Props mdawaffe. fixes #6707 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-23 01:55:58 +00:00
ryan
4a31dc117f Fix reveresed logic. see #6805
git-svn-id: http://svn.automattic.com/wordpress/trunk@7787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-23 01:25:01 +00:00
ryan
5ea7b64496 Typo fixes from DD32. fixes #6818 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-23 01:14:26 +00:00
ryan
5d839715d5 don't get or set post_lock if you can't edit the post/page. Props mdawaffe
git-svn-id: http://svn.automattic.com/wordpress/trunk@7781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-22 23:54:13 +00:00
ryan
fe4cab3d1f Fix text widget cropping in IE6. Props mdawaffe. fixes #6792 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-22 23:48:28 +00:00
ryan
6e23bed1fd wp_category_checklist() fixes from mdawaffe. fixes #6810 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-22 22:45:53 +00:00
ryan
444391eaff Consolidate get_pending_comments_num() queries. see #6770
git-svn-id: http://svn.automattic.com/wordpress/trunk@7775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-22 21:26:01 +00:00
ryan
bf40169710 Silence ini_get warnings. fixes #6787 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-22 21:24:34 +00:00
ryan
4bcb8222b5 Typo fix from peaceablewhale. fixes #6579 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-22 21:16:42 +00:00
ryan
c77c239754 Normalize whitespace when parsing shortcodes. Props azaozz. fixes #6562 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-22 20:54:51 +00:00
ryan
779ff029f6 Comment query fix from MtDewVirus. fixes #6805 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-22 20:51:35 +00:00
ryan
d95ea6777b Convert Walker classes to pass as reference. Props mdawaffe. fixes #6796 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-21 19:30:54 +00:00
ryan
23fd331b4a Post and page edit redirect fixes. fixes #6720 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-21 17:54:56 +00:00
ryan
8d6d1af393 Check if PATH_INFO is set to avoid undefined index errors. see #5160
git-svn-id: http://svn.automattic.com/wordpress/trunk@7757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-21 17:35:20 +00:00
ryan
8aa8fbfd28 Redirect back to original referer when deleting a comment from the edit comment page. fixes #6458 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-21 16:45:48 +00:00
matt
6943482d3b For some reason taxonomy pages also return is_home, so we need to put this check first.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-21 06:28:50 +00:00
ryan
5889755c66 Don't include perm as part of cache key if perm is not used in the query.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-20 21:26:10 +00:00
ryan
5ecd57c4de Check publish_pages capability, not publish_posts. Props matthijs. fixes #6777 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-20 06:48:00 +00:00
ryan
8591767741 Fix pass by ref error. Props DD32. fixes #6776 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-20 06:45:13 +00:00
ryan
35086b850f Post revisions from mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@7747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 23:38:21 +00:00
ryan
17deb910aa Fix meta_key and meta_value queries in get_pages(). Props filosofo. fixes #6773 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 22:29:43 +00:00
ryan
fbe04fbf90 Shift-click to select a range of checkboxes. Props mdawaffe. fixes #6541 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 22:23:02 +00:00
ryan
38d7abdfea Move cache cleaning of children to clean_post_cache(). see #6702
git-svn-id: http://svn.automattic.com/wordpress/trunk@7743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 20:23:50 +00:00
ryan
14ed05e98b Remove debug cruft
git-svn-id: http://svn.automattic.com/wordpress/trunk@7742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 20:06:46 +00:00
ryan
80fbb3b27d Consult the cached user object in get_usermeta to avoid queries.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 19:00:07 +00:00
ryan
2ca92d8905 Don't run url_to_postid on admin pages.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 18:22:33 +00:00
ryan
65e4ddc684 Don't query post cats if no post. see #2621
git-svn-id: http://svn.automattic.com/wordpress/trunk@7739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 18:12:04 +00:00
ryan
3495bf80e0 Only use the args defined in defaults to compute the cache key in get_terms. Props mdawaffe.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 17:42:13 +00:00
ryan
1fdbde921b wp_category_checklist() and wp_link_category_checklist() to replace the nested cats code. see #2621
git-svn-id: http://svn.automattic.com/wordpress/trunk@7737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 17:41:10 +00:00
ryan
926754275c If widget ID not found, scan the entire registered widgets array looking for legacy IDs. Props Denis-de-Bernardy. fixes #6605 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-18 02:19:45 +00:00
ryan
019e456c4c Checking for 0 and 1 instead of != spam is faster.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 22:33:35 +00:00
ryan
f42f78b3b1 Typo fix. see #6578
git-svn-id: http://svn.automattic.com/wordpress/trunk@7730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 22:00:39 +00:00
ryan
84bd7d6a00 We don't need get_categories() to do a hierarchical sort anymore. The walker takes care of it.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 21:21:13 +00:00
ryan
3389df53f2 don't cache during title extraction. Props mdawaffe. fixes #6694 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 20:42:47 +00:00
ryan
3821189be8 Tweak unused widgets interface. Make widget titles less repetitive. fixes #6349 #5823 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 20:36:59 +00:00
ryan
baba01caff Make link widget IDs unique. Props docwhat. fixes #4287 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 20:32:13 +00:00
ryan
66ad98c078 Verify widget option sanity. Props Viper007Bond. fixes #6578 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 20:14:07 +00:00
ryan
d5f5f07270 Revert [7689], gonna try another approach. see #6677
git-svn-id: http://svn.automattic.com/wordpress/trunk@7720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 19:32:38 +00:00
ryan
35f17e4dea Key meta box array by id. Props Denis-de-Bernardy. fixes #6192 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 19:20:15 +00:00
ryan
26fd2097a0 Protect the <pre> and <script> tags when switching editors. Props azaozz. fixes #6610 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-17 19:11:21 +00:00
ryan
e399f6ad54 Cache comment count and use count API in menu.php
git-svn-id: http://svn.automattic.com/wordpress/trunk@7714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 23:45:39 +00:00
ryan
957a61318b array_shift() error fixes from DD32. fixes #6499 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 23:09:51 +00:00
ryan
7387154152 Bump script loader ver. see #6753
git-svn-id: http://svn.automattic.com/wordpress/trunk@7710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 22:58:15 +00:00
ryan
d18e3f9d4a Preserve author during autosave. fixes #6753 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 22:56:37 +00:00
ryan
a5f480ebec Legacy uploader fix from tellyworth. fixes #6629 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 22:03:44 +00:00
ryan
5748fbb486 Make profile fields wider. Props tellyworth. fixes #6581 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 22:01:32 +00:00
ryan
3b95476f1c image_make_intermediate_size filter from tellyworth. fixes #6580 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 21:59:23 +00:00
ryan
4e74faa972 Default cap arg should be an empty array. Props tellyworth. fixes #5520
git-svn-id: http://svn.automattic.com/wordpress/trunk@7701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 21:56:03 +00:00
markjaquith
9df4077f95 Allow shortcodes to run before or after wpautop()/texturize() formatting. Default to before for WP 2.5 compat. Props AaronCampbell
git-svn-id: http://svn.automattic.com/wordpress/trunk@7699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 21:07:04 +00:00
ryan
7f5548e55b Custom header and color picker fixes from mdawaffe. fixes #6577 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 20:58:03 +00:00
ryan
62d5105c5b Fix usermeta escaping. fixes #6750
git-svn-id: http://svn.automattic.com/wordpress/trunk@7696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 18:23:48 +00:00
ryan
a60abc0904 Add post ancestors to the cache for the post object. see #6702 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 17:23:17 +00:00
ryan
d814986be2 Strip slashes before preparing link for insert. see #6644
git-svn-id: http://svn.automattic.com/wordpress/trunk@7693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 05:55:27 +00:00
ryan
82fd123c91 Relocate wp_authenticate action to fix back compat and make it more useful. fixes #6675 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-16 04:49:19 +00:00
ryan
ce1fed1a02 Strip slashes before preparing comment insert to avoid double-slashing. Props filosofo. fixes #6738
git-svn-id: http://svn.automattic.com/wordpress/trunk@7690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-15 18:05:08 +00:00
ryan
47a695049e Demand load the category list. Props mdawaffe. see #6677
git-svn-id: http://svn.automattic.com/wordpress/trunk@7689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-15 18:00:52 +00:00
ryan
f8cea0117c Add or remove class=aligncenter when aligning images in TinyMCE. Props azaozz. fixes #6645 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-15 16:03:24 +00:00
ryan
c92c2be2af Fix menu_order ordering. Props torfason. fixes #6731 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-15 01:39:33 +00:00
ryan
cab4206406 Workaround response truncation by reducing size of response after uploading with flash uploader. Props tellyworth. fixes #6713
git-svn-id: http://svn.automattic.com/wordpress/trunk@7682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 23:09:14 +00:00
ryan
6ec2c0877b tiny_mce_gzip.php no longer needed
git-svn-id: http://svn.automattic.com/wordpress/trunk@7681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 22:30:16 +00:00
ryan
713a705b52 TinyMCE 3.0.7 from azaozz. fixes #6726 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 22:19:04 +00:00
ryan
b97e7fa82b Fix IE6 overlap and remove unnecessary markup. Props tellyworth. fixes #6661 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 20:48:11 +00:00
ryan
47c6ee0e09 Suppress exif_read_data() errors. Props tellyworth. fixes #6571 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 20:19:15 +00:00
ryan
02e0c889f7 Pass size to image_send_to_editor filter. fies #6691 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 19:47:07 +00:00
ryan
8eff77e82d More efficient category and list JS from mdawaffe. fixes #6677 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 19:31:20 +00:00
ryan
7d2a7755a3 Fix category exclusion when getting adjacent posts. Props filosofo. fixes #6551 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 17:56:58 +00:00
ryan
1a41abe289 Handle pathinfo structures when determining if verbose page rules should be used. Props dlo. fixes #6650 #6570 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 17:18:53 +00:00
ryan
6e662d708b Move define of AUTOSAVE_INTERVAL to wp-settings so that it is available earlier. Props simonwheatley. fixes #6668 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 17:07:34 +00:00
ryan
b7c7f9d1c2 CSS typo fixes from spirit55555. fixes #6653 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 17:05:24 +00:00
ryan
4c9d2e9dfa Check create_users cap instead of edit_users wgen adding/inserting users. Props imwebgefunden. fixes #6662 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:57:29 +00:00
ryan
b9b5291c18 Typo fixes. see #6644
git-svn-id: http://svn.automattic.com/wordpress/trunk@7658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:49:17 +00:00
ryan
56f15cb1bf Add missing comma. see #6644
git-svn-id: http://svn.automattic.com/wordpress/trunk@7657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:45:12 +00:00
ryan
ab7af57751 Use input instead of button to work around IE6 bug. Props tellyworth. fixes #6660 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:38:25 +00:00
ryan
1d67896b70 Validation fixes for uploader. Props sambauers. fixes #6659 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:33:37 +00:00
ryan
b83563f368 Add some actions and filters to the media uploader. Props tellyworth. fixes #6658 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:32:04 +00:00
ryan
030a8b9b33 Fix image fetching in get_media_items(). Props tellyworth. fixes #6657 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:30:27 +00:00
ryan
d943a8252a Make MT post status lower case when importing. Props jgbishop. fixes #6656 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:26:21 +00:00
ryan
972851a755 Make get_posts args optional. Props karlkatzke and Otto42. fixes #6608 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:23:29 +00:00
ryan
248a0c06e2 Prepare DB queries in more places. Props filosofo. see #6644
git-svn-id: http://svn.automattic.com/wordpress/trunk@7645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:13:25 +00:00
ryan
796ae7104e Use error handler instead of die when moving files to upload dir fails. Props simonwheatley. fixes #6450 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 16:01:59 +00:00
ryan
36c9588f08 phpdoc typo fix from filosofo. fixes #6712 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-14 15:53:09 +00:00
matt
43c3c8ef36 Direct file system manip fixes, should fix .svn upgrade problem. Hat tip: DD32.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-13 04:04:57 +00:00
ryan
81370476f4 Add post_date_column_time filter for easy time customization.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-10 18:59:17 +00:00
ryan
132ac51a5a Use wp_count_posts() to determine availabel statuses for get_available_post_statuses(). fixes #6654 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-09 20:09:45 +00:00
ryan
5b1208ebc3 Don't send content length for tinymce config. Props azaozz. fixes #6524 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-09 19:02:13 +00:00
ryan
77be80f02c Change get_the_time filter to get_post_time for the get_post_time() function. Props filosofo. fixes #6641 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-08 17:33:42 +00:00
ryan
79e2e8fa76 Use DB prepare on login queries. Props filosofo. fixes #6640 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-08 17:30:14 +00:00
ryan
4a33d268ab Strip percent signs when sanitizing filenames so the server doesn't try to decode entities. Props filosofo. fixes #5587 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-08 17:22:20 +00:00
ryan
3fffac7d5d Disambiguate default slugs. Props RanYanivHartstein. fixes #6614 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-08 17:14:18 +00:00
ryan
9714b08b71 Move category query to get category case of get_permalink to avoid unnecessary queries. Props mdawaffe. fixes #6638 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-08 01:55:04 +00:00
ryan
9ffa66c56c Show all categories in category filter. Don't show misleading counts. see #6439
git-svn-id: http://svn.automattic.com/wordpress/trunk@7625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-08 01:53:53 +00:00
ryan
c3e32dcd4e Revert [7605]. It breaks setting posts page. see #6539
git-svn-id: http://svn.automattic.com/wordpress/trunk@7622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-08 01:05:45 +00:00
ryan
3794dc04b4 Avoid data-loss when editing multi-widgets. Props mdawaffe. fixes #6636 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-07 21:40:32 +00:00
ryan
92fe7fcad0 Fix add_users_page() when current user does not have edit_users cap. Props mattyrob. fixes #6621 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-07 21:25:31 +00:00
ryan
4e1465b8d9 Remove unused starify function. Props josephscott. fixes #6634 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-07 21:13:48 +00:00
ryan
27167db9c3 Escape faultString in IXR. Props josephscott. fixes #5666 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-07 18:30:51 +00:00
ryan
aeb2b5bf9f Update timestamp when only the minute value is changed. fixes #6456 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-07 17:19:43 +00:00
ryan
aad4350fb1 upload_file_glob filter from tellyworth. fixes #6628 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-07 17:10:00 +00:00
ryan
90952804da Update timestamp when only the minute value is changed. fixes #6456 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-07 17:06:56 +00:00
ryan
82f01c5c79 Fix RTL alignment for delete button. Props RanYanivHartstein. fixes #6617 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/trunk@7607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-06 23:26:25 +00:00
ryan
81d1b488a9 Explicit ID check so we don't fall through for empties. Props natecook. fixes #6539 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/trunk@7605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-06 23:23:05 +00:00
ryan
f83ca8ec0d Order cats by name. Props MtDewVirus. fixes #6623 for 2.6
git-svn-id: http://svn.automattic.com/wordpress/trunk@7603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-06 22:29:18 +00:00
matt
6099258ff9 Allow TinyMCE to work under SSL. Fixes #6544. Hat tip: blenjee, azaozz.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-06 21:29:36 +00:00
matt
ad1c6ea083 The child should not have to pay for the sins of his father. Caching for children needs to be cleared when parent is edited; if we check for empty and not isset, it never gets better for empty results.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-05 05:54:08 +00:00
matt
70dae93a6a Deal more elegantly with blogs with blank titles. (Which is apparently pretty common.)
git-svn-id: http://svn.automattic.com/wordpress/trunk@7600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-05 00:54:56 +00:00
westi
fd890d1fb4 Don't add new lines around the <!--more--> tag when posting over xmlrpc. Fixes #6016 props josephscott and redsweater.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-03 20:56:48 +00:00
westi
ca41e227ad Select the link in the link popup again. Fixes #6521 for trunk props azaozz.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-03 20:14:37 +00:00
markjaquith
aff9f47646 Don't show delete checkbox for default category. HTML validation. props johnbillion. fixes #6560 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-03 05:02:19 +00:00
markjaquith
6a41b549d0 Fix gallery shortcode orderby param for all SQL setups. Sanitize orderby. fixes #6476 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-03 03:05:49 +00:00
westi
9a15c3a960 Ensure we only fire off ajax requests for the dashboard widgets when the cache has expired. Fixes #6533 for trunk props mdawaffe.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-02 16:22:53 +00:00
westi
3eee635513 Replace the last usage of ctype_digit with is_numeric. Fixes #6534 for trunk props mtekk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-02 16:18:11 +00:00
markjaquith
29a551d786 Sanitize "cat" query var and cast to int before looking for a category template
git-svn-id: http://svn.automattic.com/wordpress/trunk@7586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-02 13:15:21 +00:00
westi
8ca58c943e Rearrange the media uploader view so the filename is visible. Fixes #6517 for trunk props andy.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-04-01 21:12:35 +00:00
markjaquith
e0e2dedba5 Do not hyperlink the "Edit this entry" period. props phocks. fixes #6488
git-svn-id: http://svn.automattic.com/wordpress/trunk@7582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-31 17:02:41 +00:00
markjaquith
359fb2aced Parse shortcodes AFTER wpautop() to avoid mangling. Have wptexturize() ignore shortcodes so quotes stay straight. fixes #6444 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-31 07:56:58 +00:00
westi
74a7fc7923 Specify collation as well when connecting to the database if it is provided. See #6410 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-30 17:56:27 +00:00
markjaquith
6e9a44bd99 Move user search </form> to correct position. props Nazgul and bl968. fixes #6462 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-30 16:48:31 +00:00
markjaquith
5ab9ee6a8f Gallery XHTML validation fixes. props shelleyp. fixes #6461 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-30 16:41:43 +00:00
westi
88cbd04406 Make sure the rewrite rules for the feed files match when WordPress is installed in a subdirectory. See #6460 this is for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-30 13:42:03 +00:00
markjaquith
9eeb25a302 Remove errant commas to prevent file uploader script errors in IE7. props tsimmons. fixes #6443 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-30 06:11:30 +00:00
markjaquith
1e668ea293 Update timestamp when only the minute value is changed. props johnconners. fixes #6456 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-30 06:00:59 +00:00
westi
9e849cc2ec Trunk is for 2.6 development now.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-29 16:47:16 +00:00
287 changed files with 16608 additions and 6179 deletions

View File

@@ -1,5 +1,18 @@
<?php
/* Short and sweet */
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
?>

View File

@@ -8,7 +8,7 @@
<body>
<h1 id="logo" style="text-align: center">
<img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
<br /> Version 2.5
<br /> Version 2.6.1
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
@@ -29,7 +29,7 @@
<h1>Upgrading</h1>
<p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p>
<h2>Upgrading from any previous WordPress to 2.5:</h2>
<h2>Upgrading from any previous WordPress to 2.6.1:</h2>
<ol>
<li>Delete your old WP files, saving ones you've modified.</li>
<li>Upload the new files.</li>

View File

@@ -1,7 +1,7 @@
<?php
define('DOING_AJAX', true);
require_once('../wp-config.php');
require_once('../wp-load.php');
require_once('includes/admin.php');
if ( !is_user_logged_in() )
@@ -13,9 +13,14 @@ if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
$s = $_GET['q']; // is this slashed already?
if ( strstr( $s, ',' ) )
die; // it's a multiple tag insert, we won't find anything
$results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%$s%')" );
if ( strstr( $s, ',' ) ) {
$s = explode( ',', $s );
$s = $s[count( $s ) - 1];
}
$s = trim( $s );
if ( strlen( $s ) < 2 )
die; // require 2 chars for matching
$results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" );
echo join( $results, "\n" );
die;
}
@@ -25,14 +30,17 @@ switch ( $action = $_POST['action'] ) :
case 'delete-comment' :
check_ajax_referer( "delete-comment_$id" );
if ( !$comment = get_comment( $id ) )
die('0');
die('1');
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
die('-1');
if ( isset($_POST['spam']) && 1 == $_POST['spam'] )
if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) )
die('1');
$r = wp_set_comment_status( $comment->comment_ID, 'spam' );
else
} else {
$r = wp_delete_comment( $comment->comment_ID );
}
die( $r ? '1' : '0' );
break;
@@ -41,24 +49,38 @@ case 'delete-cat' :
if ( !current_user_can( 'manage_categories' ) )
die('-1');
$cat = get_category( $id );
if ( !$cat || is_wp_error( $cat ) )
die('1');
if ( wp_delete_category( $id ) )
die('1');
else die('0');
else
die('0');
break;
case 'delete-tag' :
check_ajax_referer( "delete-tag_$id" );
if ( !current_user_can( 'manage_categories' ) )
die('-1');
$tag = get_term( $id, 'post_tag' );
if ( !$tag || is_wp_error( $tag ) )
die('1');
if ( wp_delete_term($id, 'post_tag'))
die('1');
else die('0');
else
die('0');
break;
case 'delete-link-cat' :
check_ajax_referer( "delete-link-category_$id" );
if ( !current_user_can( 'manage_categories' ) )
die('-1');
$cat = get_term( $id, 'link_category' );
if ( !$cat || is_wp_error( $cat ) )
die('1');
$cat_name = get_term_field('name', $id, 'link_category');
// Don't delete the default cats.
@@ -89,14 +111,20 @@ case 'delete-link' :
if ( !current_user_can( 'manage_links' ) )
die('-1');
$link = get_bookmark( $id );
if ( !$link || is_wp_error( $link ) )
die('1');
if ( wp_delete_link( $id ) )
die('1');
else die('0');
else
die('0');
break;
case 'delete-meta' :
check_ajax_referer( "delete-meta_$id" );
if ( !$meta = get_post_meta_by_id( $id ) )
die('0');
die('1');
if ( !current_user_can( 'edit_post', $meta->post_id ) )
die('-1');
if ( delete_meta( $meta->meta_id ) )
@@ -108,6 +136,9 @@ case 'delete-post' :
if ( !current_user_can( 'delete_post', $id ) )
die('-1');
if ( !get_post( $id ) )
die('1');
if ( wp_delete_post( $id ) )
die('1');
else
@@ -118,19 +149,28 @@ case 'delete-page' :
if ( !current_user_can( 'delete_page', $id ) )
die('-1');
if ( !get_page( $id ) )
die('1');
if ( wp_delete_post( $id ) )
die('1');
else die('0');
else
die('0');
break;
case 'dim-comment' :
if ( !$comment = get_comment( $id ) )
die('0');
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
die('-1');
if ( !current_user_can( 'moderate_comments' ) )
die('-1');
if ( 'unapproved' == wp_get_comment_status($comment->comment_ID) ) {
$current = wp_get_comment_status( $comment->comment_ID );
if ( $_POST['new'] == $current )
die('1');
if ( 'unapproved' == $current ) {
check_ajax_referer( "approve-comment_$id" );
if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) )
die('1');
@@ -150,6 +190,9 @@ case 'add-category' : // On the Fly
$parent = 0;
$post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array();
$checked_categories = array_map( 'absint', (array) $post_category );
$popular_ids = isset( $_POST['popular_ids'] ) ?
array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) :
false;
$x = new WP_Ajax_Response();
foreach ( $names as $cat_name ) {
@@ -163,7 +206,7 @@ case 'add-category' : // On the Fly
continue;
$category = get_category( $cat_id );
ob_start();
wp_category_checklist( 0, $cat_id, $checked_categories );
wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids );
$data = ob_get_contents();
ob_end_clean();
$x->add( array(
@@ -349,13 +392,16 @@ case 'add-comment' :
list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1 );
if ( get_option('show_avatars') )
add_filter( 'comment_author', 'floated_admin_avatar' );
if ( !$comments )
die('1');
$x = new WP_Ajax_Response();
foreach ( (array) $comments as $comment ) {
get_comment( $comment );
ob_start();
_wp_comment_row( $comment->comment_ID, $mode, false );
_wp_comment_row( $comment->comment_ID, $mode, $status );
$comment_list_item = ob_get_contents();
ob_end_clean();
$x->add( array(
@@ -459,10 +505,11 @@ case 'add-user' :
$x->send();
break;
case 'autosave' : // The name of this action is hardcoded in edit_post()
$nonce_age = check_ajax_referer( 'autosave', 'autosavenonce');
define( 'DOING_AUTOSAVE', true );
$nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' );
global $current_user;
$_POST['post_status'] = 'draft';
$_POST['post_category'] = explode(",", $_POST['catslist']);
$_POST['tags_input'] = explode(",", $_POST['tags_input']);
if($_POST['post_type'] == 'page' || empty($_POST['post_category']))
@@ -476,8 +523,9 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
$supplemental = array();
$id = 0;
$id = $revision_id = 0;
if($_POST['post_ID'] < 0) {
$_POST['post_status'] = 'draft';
$_POST['temp_ID'] = $_POST['post_ID'];
if ( $do_autosave ) {
$id = wp_write_post();
@@ -508,8 +556,18 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
if ( !current_user_can('edit_post', $post_ID) )
die(__('You are not allowed to edit this post.'));
}
if ( $do_autosave ) {
$id = edit_post();
// Drafts are just overwritten by autosave
if ( 'draft' == $post->post_status ) {
$id = edit_post();
} else { // Non drafts are not overwritten. The autosave is stored in a special post revision.
$revision_id = wp_create_post_autosave( $post->ID );
if ( is_wp_error($revision_id) )
$id = $revision_id;
else
$id = $post->ID;
}
$data = $message;
} else {
$id = $post->ID;

View File

@@ -5,6 +5,7 @@ if ( $editing ) {
if ( user_can_richedit() )
wp_enqueue_script( 'wp_tiny_mce' );
}
wp_enqueue_script( 'wp-gears' );
$min_width_pages = array( 'post.php', 'post-new.php', 'page.php', 'page-new.php', 'widgets.php', 'comment.php', 'link.php' );
$the_current_page = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
@@ -28,14 +29,13 @@ get_admin_page_title();
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title>
<?php
wp_admin_css( 'css/global' );
wp_admin_css();
wp_admin_css( 'css/colors' );
wp_admin_css( 'css/ie' );
?>
<!--[if gte IE 6]>
<?php wp_admin_css( 'css/ie' );
?>
<![endif]-->
<script type="text/javascript">
//<![CDATA[
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();}}};
@@ -44,26 +44,83 @@ addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document
<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') && $ie6_no_scrollbar ) : ?>
<style type="text/css">* html { overflow-x: hidden; }</style>
<?php endif;
if ( isset($page_hook) )
do_action('admin_print_scripts-' . $page_hook);
else if ( isset($plugin_page) )
do_action('admin_print_scripts-' . $plugin_page);
do_action('admin_print_scripts');
$hook_suffixes = array();
if ( isset($page_hook) )
do_action('admin_head-' . $page_hook);
$hook_suffixes[] = "-$page_hook";
else if ( isset($plugin_page) )
do_action('admin_head-' . $plugin_page);
do_action('admin_head');
$hook_suffixes[] = "-$plugin_page";
else if ( isset($pagenow) )
$hook_suffixes[] = "-$pagenow";
$hook_suffixes[] = '';
foreach ( $hook_suffixes as $hook_suffix )
do_action("admin_print_styles$hook_suffix"); // do_action( 'admin_print_styles-XXX' ); do_action( 'admin_print_styles' );
foreach ( $hook_suffixes as $hook_suffix )
do_action("admin_print_scripts$hook_suffix"); // do_action( 'admin_print_scripts-XXX' ); do_action( 'admin_print_scripts' );
foreach ( $hook_suffixes as $hook_suffix )
do_action("admin_head$hook_suffix"); // do_action( 'admin_head-XXX' ); do_action( 'admin_head' );
unset($hook_suffixes, $hook_suffix);
?>
</head>
<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
<div id="wpwrap">
<div id="wpcontent">
<div id="wphead">
<h1><?php bloginfo('name'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1>
<h1><?php if ( '' == get_bloginfo('name', 'display') ) echo '&nbsp;'; else echo get_bloginfo('name', 'display'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1>
</div>
<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>') ?></p></div>
<?php
if ( ! $is_opera ) {
?>
<div id="gears-info-box" class="info-box" style="display:none;">
<img src="images/gear.png" title="Gear" alt="" class="gears-img" />
<div id="gears-msg1">
<h3 class="info-box-title"><?php _e('Speed up WordPress'); ?></h3>
<p><?php _e('WordPress now has support for Gears, which adds new features to your web browser.'); ?><br />
<a href="http://gears.google.com/" target="_blank" style="font-weight:normal;"><?php _e('More information...'); ?></a></p>
<p><?php _e('After you install and enable Gears most of WordPress&#8217; images, scripts, and CSS files will be stored locally on your computer. This speeds up page load time.'); ?></p>
<p><strong><?php _e('Don&#8217;t install on a public or shared computer.'); ?></strong></p> <div class="submit"><button onclick="window.location = 'http://gears.google.com/?action=install&amp;return=<?php echo urlencode( admin_url() ); ?>';" class="button"><?php _e('Install Now'); ?></button>
<button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
</div>
<div id="gears-msg2" style="display:none;">
<h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
<p><?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?></p>
<p><?php
if ( $is_safari )
_e('To enable it, make sure this web site is not on the denied list in Gears Settings under the Safari menu, then click the button below.');
else
_e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser Tools menu, then click the button below.');
?></p>
<p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p>
<div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button>
<button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
</div>
<div id="gears-msg3" style="display:none;">
<h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
<p><?php
if ( $is_safari )
_e('Gears is installed and enabled on this computer. You can disable it from the Safari menu.');
else
_e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.');
?></p>
<p><?php _e('If there are any errors, try disabling Gears, then reload the page and enable it again.'); ?></p>
<p><?php _e('Local storage status:'); ?> <span id="gears-wait"><span style="color:#f00;"><?php _e('Please wait! Updating files:'); ?></span> <span id="gears-upd-number"></span></span></p>
<div class="submit"><button class="button" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Close'); ?></button></div>
</div>
</div>
<?php } ?>
<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>'); if ( ! $is_opera ) { ?> | <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Turbo') ?></a></span><?php } ?></p></div>
<?php
require(ABSPATH . 'wp-admin/menu-header.php');

24
wp-admin/admin-post.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
define('WP_ADMIN', TRUE);
if ( defined('ABSPATH') )
require_once(ABSPATH . 'wp-load.php');
else
require_once('../wp-load.php');
require_once(ABSPATH . 'wp-admin/includes/admin.php');
if ( !wp_validate_auth_cookie() )
wp_die(__('Cheatin&#8217; uh?'));
nocache_headers();
do_action('admin_init');
$action = 'admin_post';
if ( !empty($_REQUEST['action']) )
$action .= '_' . $_REQUEST['action'];
do_action($action);
?>

View File

@@ -2,12 +2,12 @@
define('WP_ADMIN', TRUE);
if ( defined('ABSPATH') )
require_once( ABSPATH . 'wp-config.php');
require_once(ABSPATH . 'wp-load.php');
else
require_once('../wp-config.php');
require_once('../wp-load.php');
if ( get_option('db_version') != $wp_db_version ) {
wp_redirect(get_option('siteurl') . '/wp-admin/upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI'])));
wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
exit;
}
@@ -26,8 +26,8 @@ $time_format = get_option('time_format');
wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
wp_admin_css_color('classic', __('Classic'), get_option( 'siteurl' ) . "/wp-admin/css/colors-classic.css", array('#07273E', '#14568A', '#D54E21', '#2683AE'));
wp_admin_css_color('fresh', __('Fresh'), get_option( 'siteurl' ) . "/wp-admin/css/colors-fresh.css", array('#464646', '#CEE1EF', '#D54E21', '#2683AE'));
wp_admin_css_color('classic', __('Classic'), admin_url("css/colors-classic.css"), array('#07273E', '#14568A', '#D54E21', '#2683AE'));
wp_admin_css_color('fresh', __('Fresh'), admin_url("css/colors-fresh.css"), array('#464646', '#CEE1EF', '#D54E21', '#2683AE'));
wp_enqueue_script( 'common' );
wp_enqueue_script( 'jquery-color' );
@@ -58,7 +58,7 @@ if (isset($plugin_page)) {
wp_die(__('Invalid plugin page'));
}
if (! ( file_exists(ABSPATH . PLUGINDIR . "/$plugin_page") && is_file( ABSPATH . PLUGINDIR . "/$plugin_page") ) )
if (! ( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) )
wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
do_action('load-' . $plugin_page);
@@ -66,7 +66,7 @@ if (isset($plugin_page)) {
if (! isset($_GET['noheader']))
require_once(ABSPATH . 'wp-admin/admin-header.php');
include(ABSPATH . PLUGINDIR . "/$plugin_page");
include(WP_PLUGIN_DIR . "/$plugin_page");
}
include(ABSPATH . 'wp-admin/admin-footer.php');
@@ -113,4 +113,7 @@ if (isset($plugin_page)) {
do_action("load-$pagenow");
}
if ( !empty($_REQUEST['action']) )
do_action('admin_action_' . $_REQUEST['action']);
?>

View File

@@ -5,17 +5,19 @@
*/
if ( defined('ABSPATH') )
require_once( ABSPATH . 'wp-config.php');
require_once(ABSPATH . 'wp-load.php');
else
require_once('../wp-config.php');
require_once('../wp-load.php');
// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
$_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
unset($current_user);
require_once('admin.php');
header('Content-Type: text/plain');
header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
if ( !current_user_can('upload_files') )
wp_die(__('You do not have permission to upload files.'));
@@ -26,6 +28,8 @@ if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {
exit;
}
check_admin_referer('media-form');
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
if (is_wp_error($id)) {
echo '<div id="media-upload-error">'.wp_specialchars($id->get_error_message()).'</div>';

View File

@@ -1,107 +0,0 @@
<?php
$mode = 'bookmarklet';
require_once('admin.php');
if ( ! current_user_can('edit_posts') )
wp_die(__('Cheatin&#8217; uh?'));
if ('b' == $a):
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<!--
window.close()
-->
</script>
</head>
<body></body>
</html>
<?php
exit;
endif;
$post = get_default_post_to_edit();
$popuptitle = wp_specialchars(stripslashes($popuptitle));
$text = wp_specialchars(stripslashes(urldecode($text)));
$popuptitle = funky_javascript_fix($popuptitle);
$text = funky_javascript_fix($text);
$post_title = wp_specialchars($_REQUEST['post_title']);
if (!empty($post_title))
$post->post_title = stripslashes($post_title);
else
$post->post_title = $popuptitle;
$content = wp_specialchars($_REQUEST['content']);
$popupurl = clean_url($_REQUEST['popupurl']);
if ( !empty($content) ) {
$post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
} else {
$post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
}
/* /big funky fixes */
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php bloginfo('name') ?> &rsaquo; Bookmarklet &#8212; WordPress</title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<?php
wp_admin_css( 'css/global' );
wp_admin_css();
?>
<style type="text/css">
<!--
#wpbookmarklet textarea,input,select {
border-width: 1px;
border-color: #cccccc;
border-style: solid;
padding: 2px;
margin: 1px;
}
#wpbookmarklet .checkbox {
background-color: #ffffff;
border-width: 0px;
padding: 0px;
margin: 0px;
}
#wpbookmarklet textarea {
font-family: Verdana, Geneva, Arial, Helvetica;
font-size: 0.9em;
}
#wpbookmarklet .wrap {
border: 0px;
}
#wpbookmarklet #postdiv {
margin-bottom: 0.5em;
}
#wpbookmarklet #titlediv {
margin-bottom: 1em;
}
-->
</style>
</head>
<body id="wpbookmarklet">
<div id="wphead">
<h1><?php bloginfo('name') ?></h1>
</div>
<?php require('edit-form.php'); ?>
<?php do_action('admin_footer', ''); ?>
</body>
</html>

View File

@@ -126,6 +126,7 @@ endif; ?>
<?php endif; ?>
<p id="post-search">
<label class="hidden" for="post-search-input"><?php _e('Search Categories'); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
@@ -134,6 +135,24 @@ endif; ?>
<div class="tablenav">
<?php
$pagenum = absint( $_GET['pagenum'] );
if ( empty($pagenum) )
$pagenum = 1;
if( !$catsperpage || $catsperpage < 0 )
$catsperpage = 20;
$page_links = paginate_links( array(
'base' => add_query_arg( 'pagenum', '%#%' ),
'format' => '',
'total' => ceil(wp_count_terms('category') / $catsperpage),
'current' => $pagenum
));
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<div class="alignleft">
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php wp_nonce_field('bulk-categories'); ?>
@@ -147,7 +166,7 @@ endif; ?>
<table class="widefat">
<thead>
<tr>
<th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
<th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Name') ?></th>
<th scope="col"><?php _e('Description') ?></th>
<th scope="col" class="num"><?php _e('Posts') ?></th>
@@ -155,13 +174,18 @@ endif; ?>
</thead>
<tbody id="the-list" class="list:cat">
<?php
cat_rows();
cat_rows(0, 0, 0, $pagenum, $catsperpage);
?>
</tbody>
</table>
</form>
<div class="tablenav">
<?php
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>
<br class="clear" />

View File

@@ -21,7 +21,7 @@ case 'editcomment' :
$title = __('Edit Comment');
wp_enqueue_script('comment');
//wp_enqueue_script('thickbox');
require_once('admin-header.php');
$comment_id = absint( $_GET['c'] );
@@ -78,7 +78,7 @@ if ( 'spam' == $_GET['dt'] ) {
<table width="100%">
<tr>
<td><input type='button' class="button" value='<?php _e('No'); ?>' onclick="self.location='<?php echo get_option('siteurl'); ?>/wp-admin/edit-comments.php';" /></td>
<td><input type='button' class="button" value='<?php _e('No'); ?>' onclick="self.location='<?php echo admin_url('edit-comments.php'); ?>" /></td>
<td class="textright"><input type='submit' class="button" value='<?php echo $button; ?>' /></td>
</tr>
</table>
@@ -146,7 +146,7 @@ case 'deletecomment' :
else if ( '' != wp_get_original_referer() && false == $noredir )
wp_redirect( wp_get_original_referer() );
else
wp_redirect( get_option('siteurl') . '/wp-admin/edit-comments.php' );
wp_redirect( admin_url('edit-comments.php') );
die;
break;
@@ -171,7 +171,7 @@ case 'unapprovecomment' :
if ( '' != wp_get_referer() && false == $noredir )
wp_redirect( wp_get_referer() );
else
wp_redirect( get_option('siteurl') . '/wp-admin/edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments' );
wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
exit();
break;
@@ -193,14 +193,10 @@ case 'approvecomment' :
wp_set_comment_status( $comment->comment_ID, 'approve' );
if ( true == get_option('comments_notify') )
wp_notify_postauthor( $comment->comment_ID );
if ( '' != wp_get_referer() && false == $noredir )
wp_redirect( wp_get_referer() );
else
wp_redirect( get_option('siteurl') . '/wp-admin/edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments' );
wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
exit();
break;
@@ -229,4 +225,4 @@ default:
include('admin-footer.php');
?>
?>

View File

@@ -1,3 +1,24 @@
.post-com-count {
}
#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
background-image: url(../images/comment-stalk-rtl.gif);
background-position:right bottom;
}
#footer {
background-position:99% 10px;
}
#poststuff .closed .togbox, #poststuff .togbox {
background-image: url(../images/toggle-arrow-rtl.gif) !important;
}
background-image: url(../images/toggle-arrow-rtl.gif) !important;
}
.bar {
border-right-color: transparent;
border-left-color: #99d;
}
.plugins .togl {
border-right-color: transparent;
border-left-color: #ccc;
}
#upload-menu li.current {
border-right-color: transparent;
border-left-color: #448abd;
}

View File

@@ -2,7 +2,7 @@ a.page-numbers:hover {
border-color: #999;
}
body {
body, .form-table .pre {
background-color: #fff;
color: #333;
}
@@ -37,7 +37,7 @@ input.disabled, textarea.disabled {
color: #fff;
}
ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form {
ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title {
background-color: #cfebf7;
}
@@ -63,7 +63,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
color: #000;
}
ul.widget-control-list .sorthelper {
.sorthelper {
background-color: #ccf3fa;
}
@@ -204,11 +204,11 @@ ul.widget-control-list .sorthelper {
border-color: #535353;
}
.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover {
.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.del-link:hover {
color: #d54e21;
}
#adminmenu a:hover, #sidemenu a:hover {
#adminmenu a:hover, #sidemenu a:hover, .ui-tabs-nav a:hover {
color: #97c4d8;
}
@@ -239,7 +239,8 @@ ul.widget-control-list .sorthelper {
border-bottom-color: #999;
}
.submitbox .submitdelete:hover {
.submitbox .submitdelete:hover,
#media-upload a.delete:hover {
color: #fff;
background-color: #f00;
border-bottom-color: #f00;
@@ -291,11 +292,11 @@ ul.widget-control-list .sorthelper {
color: #5a5a5a;
}
#poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, a {
#poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, a {
color: #2e7ca0;
}
#adminmenu a {
#adminmenu a, .ui-tabs-nav a {
color: #cfebf6;
}
@@ -303,7 +304,7 @@ ul.widget-control-list .sorthelper {
color: #2782af
}
/* Because we don't want visited on these links */
#adminmenu a.current, #sidemenu a.current {
#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
background-color: #fff;
border-color: #07273e;
border-bottom-color: #fff;
@@ -311,11 +312,11 @@ ul.widget-control-list .sorthelper {
font-weight: bold;
}
#adminmenu li a #awaiting-mod {
#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
background-image: url(../images/comment-stalk-classic.gif);
}
#adminmenu li a #awaiting-mod span {
#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span {
background-color: #d54e21;
color: #fff;
}
@@ -326,7 +327,7 @@ ul.widget-control-list .sorthelper {
}
#adminmenu li a:hover #awaiting-mod span {
#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span {
background-color: #07273E;
}
@@ -414,11 +415,11 @@ input.readonly {
background-color: #fff;
}
#plugins .active {
.plugins .active {
background-color: #BBEEBB;
}
#plugins .togl {
.plugins .togl {
border-right-color: #ccc;
}
@@ -426,7 +427,7 @@ input.readonly {
background-color: #ffffe0;
}
#plugins tr {
.plugins tr {
background-color: #fff;
}
@@ -550,11 +551,6 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
color: #f00;
}
#media-upload a.delete {
color: #888;
}
/* TinyMCE */
.wp_themeSkin *,
.wp_themeSkin a:hover,
@@ -565,7 +561,7 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
}
/* Containers */
.wp_themeSkin table {
.wp_themeSkin table, #wp_editbtns {
background: #83B4D5;
}
@@ -717,3 +713,18 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
background-color: #ddd;
color: #333;
}
/* Diff */
table.diff .diff-deletedline {
background-color: #ffdddd;
}
table.diff .diff-deletedline del {
background-color: #ff9999;
}
table.diff .diff-addedline {
background-color: #ddffdd;
}
table.diff .diff-addedline ins {
background-color: #99ff99;
}

View File

@@ -1,3 +1,24 @@
.bar {
border-right-color: transparent;
border-left-color: #99d;
}
.post-com-count {
}
#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
background-image: url(../images/comment-stalk-rtl.gif);
background-position:right bottom;
}
#footer {
background-position:99% 10px;
}
.plugins .togl {
border-right-color: transparent;
border-left-color: #ccc;
}
#poststuff .closed .togbox, #poststuff .togbox {
background-image: url(../images/toggle-arrow-rtl.gif) !important;
}
background-image: url(../images/toggle-arrow-rtl.gif);
}
#upload-menu li.current {
border-right-color:transparent;
border-left-color: #448abd;
}

View File

@@ -2,7 +2,7 @@ a.page-numbers:hover {
border-color: #999;
}
body {
body, .form-table .pre {
background-color: #fff;
color: #333;
}
@@ -41,7 +41,7 @@ input.disabled, textarea.disabled {
color: #fff;
}
li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form {
li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title {
background-color: #eaf3fa;
}
@@ -63,7 +63,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
color: #000;
}
ul.widget-control-list .sorthelper {
.sorthelper {
background-color: #ccf3fa;
}
@@ -196,7 +196,7 @@ ul.widget-control-list .sorthelper {
border-color: #535353;
}
.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #adminmenu a:hover, #sidemenu a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.delete:hover {
.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #adminmenu a:hover, #sidemenu a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.delete:hover, #media-upload a.del-link:hover, .ui-tabs-nav a:hover {
color: #d54e21;
}
@@ -226,7 +226,8 @@ ul.widget-control-list .sorthelper {
border-bottom-color: #999;
}
.submitbox .submitdelete:hover {
.submitbox .submitdelete:hover,
#media-upload a.delete:hover {
color: #fff;
background-color: #f00;
border-bottom-color: #f00;
@@ -278,28 +279,28 @@ ul.widget-control-list .sorthelper {
color: #666;
}
#adminmenu a, #submenu a, #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, a {
#adminmenu a, #submenu a, #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, .ui-tabs-nav a, a {
color: #2583ad;
}
/* Because we don't want visited on these links */
#adminmenu a.current, #sidemenu a.current {
#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
background-color: #fff;
border-color: #c6d9e9;
border-bottom-color: #fff;
color: #d54e21;
}
#adminmenu li a #awaiting-mod {
#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
background-image: url(../images/comment-stalk-fresh.gif);
}
#adminmenu li a #awaiting-mod span, #rightnow .reallynow {
#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span, #rightnow .reallynow {
background-color: #d54e21;
color: #fff;
}
#adminmenu li a:hover #awaiting-mod span {
#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span {
background-color: #264761;
}
@@ -383,11 +384,11 @@ input.readonly {
background-color: #fff;
}
#plugins .active {
.plugins .active {
background-color: #e7f7d3;
}
#plugins .togl {
.plugins .togl {
border-right-color: #ccc;
}
@@ -395,7 +396,7 @@ input.readonly {
background-color: #ffffe0;
}
#plugins tr {
.plugins tr {
background-color: #fff;
}
@@ -532,7 +533,7 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
}
/* Containers */
.wp_themeSkin table {
.wp_themeSkin table, #wp_editbtns {
background: #cee1ef;
}
@@ -688,3 +689,18 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
background-color: #ddd;
color: #333;
}
/* Diff */
table.diff .diff-deletedline {
background-color: #ffdddd;
}
table.diff .diff-deletedline del {
background-color: #ff9999;
}
table.diff .diff-addedline {
background-color: #ddffdd;
}
table.diff .diff-addedline ins {
background-color: #99ff99;
}

View File

@@ -1,62 +1,62 @@
/* Right Now */
#rightnow {
margin-left: 15px;
margin-right:0;
margin-left: 7px;
}
#rightnow .reallynow span {
text-align: right;
float: right;
}
#rightnow .reallynow a {
text-align: left;
float: left;
margin: 1px 0 0 6px;
}
/* Widgets */
div#dashboard-widgets-wrap {
margin-right:0;
margin-left:-13px;
}
div.dashboard-widget-holder {
float:right;
}
div.dashboard-widget {
margin-right:0;
margin-left: 20px;
}
h3.dashboard-widget-title span {
text-align: right;
float: right;
}
#dashboard-widgets .widget_rss ul li a {
float:right;
font-weight:bold;
margin:0pt 0pt 0.2em 0.5em;
}
#dashboard-widgets .widget_rss ul li span.rss-date {
float: right;
}
h3.dashboard-widget-title small {
text-align: left;
float: left;
float:left;
}
div.dashboard-widget-content ul,
div.dashboard-widget-content ol,
div.dashboard-widget-content dl {
div.dashboard-widget-submit input {
font-family: Tahoma;
}
div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl {
padding-left:0;
padding-right:15px;
}
div#dashboard-widgets-wrap
{
margin-right:0;
margin-left:-10px;
#dashboard_secondary div.dashboard-widget-content ul li {
float:right;
}
div.dashboard-widget {
margin-right:0;
margin-left:20px;
#dashboard_secondary div.dashboard-widget-content ul li .post {
font-family:arial;
}
#dashboard_secondary div.dashboard-widget-content ul li a {
border-right:0 none;
border-left: 1px solid #dadada;
height:110px;
}
#dashboard_secondary div.dashboard-widget-content ul li a cite {
font-family: Tahoma;
}
#dashboard-widgets .widget_rss ul li span.rss-date {
float:right;
}
#dashboard-widgets .widget_rss ul li a {
float:right;
margin:0 0 0.2em 0.5em;
float: right;
margin: 0 0 .2em .5em;
}
#dashboard_secondary div.dashboard-widget-content ul li a {
border-right:0 none;
border-left:1px solid #DADADA;
}

View File

@@ -0,0 +1,31 @@
body, td {
font-family: Tahoma;
}
textarea, input, select {
font-family: Tahoma;
}
h1, h2, h3 {
font-family:arial;
}
.widefat td {
padding: 7px 10px 9px 15px;
}
.widefat th {
padding: 9px 10px 6px 15px;
text-align: right;
}
.widefat th input {
margin: 0 8px 0 0;
}
.widefat .check-column {
text-align: left;
}
.wrap h2 {
font-family:arial;
margin: 5px -4px 0 0;
padding-right:0;
padding-left: 280px;
}
.wrap h2.long-header {
padding-left: 0;
}

View File

@@ -194,3 +194,7 @@ th.check-column + th, th.check-column + td {
padding-bottom: 7px;
padding-right: 280px;
}
.wrap h2.long-header {
padding-right: 0;
}

View File

@@ -1,53 +1,73 @@
/* footer */
body, td {
font-family: Tahoma,Verdana,sans-serif;
#poststuff .postbox h3 {
padding-left:0;
padding-right: 23px;
}
.wrap {
text-align: right;
* html #poststuff .postarea, * html #poststuff #titlediv {
margin-left:0;
margin-right: 3%;
}
.wrap h2 {
margin: 5px 0 0 4px;
* html #poststuff h2 {
margin-right: 0;
}
#footer {
padding-left:50px;
}
#footer p {
background:none;
height:auto;
padding: 5px 5px 0;
}
#bh {
padding-right:0;
padding-left: 15px;
padding-right: 0px;
}
/* write post */
div#dashboard-widgets {
padding-right:0;
padding-left: 1px;
}
#tagchecklist span a {
margin: 4px -9px 0 0;
}
#poststuff .togbox {
margin-right:-16px;
margin-left:0;
margin-right: -19px;
}
#poststuff h3 {
padding-right:20px;
.widefat th input {
margin: 0 5px 0 0;
}
p#widget-search, p#post-search {
padding-left: 15px;
/* ---------- add by navid */
#dashmenu { /* fix top right bottom in admin */
direction:ltr;
}
.widefat th {
padding-bottom: 8px;
}
/* template editor */
#template textarea {
#sidemenu a { /* fix left admin buttom ex. plugins, options */
float:left;
}
/* Editor */
.mceToolbar {
direction: ltr;
text-align: left;
}
.wrap h2 {
margin:5px 4px 0 0;
}
#editor-toolbar {/* fix hover in media uploader icon */
direction:ltr;
}
#TB_window { /* fix theme preview */
left:2%;
}
/* fix widget page */
form#widgets-filter {
position:static;
}
#widget-search {
display:none;
}
/* fix manage comment page */
ul.view-switch li {
float:left;
}
form#posts-filter {
position:static;
}
#post-search {
display:none;
}
#submenu {
margin-right: 20px;
}
/* Fixes for media-upload window */
/* Center media-upload panel on screen */
#TB_window {
width: 670px;
position: absolute;
top: 50%;
left: 50%;
margin-right: 335px !important; }

View File

@@ -111,7 +111,10 @@ div#dashboard-widgets {
.tablenav-pages {
display: block;
margin-top: -3px;
}
table.ie-fixed {
table-layout: fixed;
}
#post-search .button, #widget-search .button {

View File

@@ -1,19 +1,27 @@
body {
font-size: 11px;;
font-family: Tahoma;
}
/* Half the page disapears on IE6 */
* html body {
width: 700px;
position: absolute;
left: 50%;
margin-right: 350px;
}
ul, ol {
padding: 5px 22px 5px 5px;
}
.step, th {
text-align:right;
}
.submit input, .button, .button-secondary {
font-family: Tahoma;
margin-right:0;
}
.form-table th {
text-align: right;
text-align:right;
}
input {
padding: 1px
h1 {
font-family:arial;
margin: 5px -4px 0 0;
}
#logo {
text-align: left;
}
#admin_email {
direction: ltr;
text-align: left;
}

View File

@@ -7,8 +7,10 @@ body {
margin: 2em auto 0 auto;
width: 700px;
padding: 1em 2em;
-moz-border-radius: 12px;
-khtml-border-radius: 12px;
-webkit-border-radius: 12px;
font-size: 62.5%;
border-radius: 12px;
}
a { color: #2583ad; text-decoration: none; }
@@ -25,34 +27,41 @@ h2 { font-size: 16px; }
p, li {
padding-bottom: 2px;
font-size: 1.3em;
line-height: 1.8em;
font-size: 13px;
line-height: 18px;
}
code {
font-size: 1.3em;
font-size: 13px;
}
ul, ol { padding: 5px 5px 5px 22px; }
#logo { margin: 6px 0 14px 0px; border-bottom: none;}
.step a, .step input { font-size: 2em; }
.step {
margin: 20px 0 15px;
}
td input { font-size: 1.5em; }
.step input {
font-size: 18px;
}
a.button {
font-size: 18px;
}
.step, th { text-align: left; padding: 0; }
.submit input, .button, .button-secondary {
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
padding: 6px;
border: none;
padding: 5px 7px 7px;
border: 1px solid #a3a3a3;
margin-left: 0;
font-size: 13px !important;
-moz-border-radius: 2px;
-khtml-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
color: #246;
background: #e5e5e5;
}
@@ -63,6 +72,7 @@ td input { font-size: 1.5em; }
.submit input:hover, .button:hover, .button-secondary:hover {
color: #d54e21;
border-color: #535353;
}
.form-table {
@@ -75,12 +85,13 @@ td input { font-size: 1.5em; }
margin-bottom: 9px;
padding: 10px;
border-bottom: 8px solid #fff;
font-size: 12px;
}
.form-table th {
font-size: 12px;
font-size: 13px;
text-align: left;
padding: 12px 10px 10px 10px;
padding: 16px 10px 10px 10px;
border-bottom: 8px solid #fff;
width: 110px;
vertical-align: top;
@@ -100,6 +111,12 @@ td input { font-size: 1.5em; }
font-size: 11px;
}
.form-table input {
line-height: 20px;
font-size: 15px;
padding: 2px;
}
h1 {
border-bottom: 1px solid #dadada;
clear: both;
@@ -116,9 +133,10 @@ h1 {
#error-page p {
font-size: 14px;
line-height: 1.6em;
line-height: 16px;
margin: 25px 0 20px;
}
#error-page code {
font-size: 1em;
font-size: 15px;
}

View File

@@ -1,32 +1,37 @@
body {
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
direction: rtl;
font-family: Tahoma;
}
form {
margin-left:0;
margin-right:8px;
margin-right: 8px;
}
form .forgetmenot {
float:right;
}
#login form .submit input {
font-family: Tahoma;
}
form .submit {
float:left;
}
#backtoblog a {
left:auto;
right:15px;
}
#login_error, .message {
margin:0 8px 16px 0;
margin: 0 8px 16px 0;
}
#nav {
margin: 0 8px 0 0;
margin:0 8px 0 0;
}
#user_pass, #user_login, #user_email {
margin-right:0;
margin-left: 6px;
direction:ltr;
}
h1 a {
text-decoration:none;
}
#backtoblog a {
left: auto;
right: 15px;
}
/* ltr input */
#user_login, #user_pass {
direction:ltr;
}

View File

@@ -1,21 +1,66 @@
ul#sidemenu {
left: auto;
right: 0;
body#media-upload ul#sidemenu {
left:auto;
right:0;
width: 620px;
}
#search-filter {
text-align:left;
}
.align .field label {
display: block;
float: right;
padding: 0 25px 0 0;
margin: 5px 3px 5px 5px;
padding: 0 28px 0 0;
margin: 0 0 0 1em;
}
.align .field input {
display: block;
float: right;
margin: 5px 15px 5px 0;
.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label {
background-position:center right;
}
tr.image-size label {
margin: 0 0 0 1em;
}
.filename.original {
float: right;
}
.crunching {
text-align: left;
margin-right:0;
margin-left: 5px;
}
button.dismiss {
right:auto;
left:5px;
}
.file-error {
margin: 0 50px 5px 0;
}
.progress {
left:auto;
right:0;
}
.bar {
border-right-width:0;
border-left-width: 3px;
border-left-style: solid;
}
.media-item .pinkynail {
float:right;
}
.describe-toggle-on, .describe-toggle-off {
float: left;
margin-right:0;
margin-left: 20px;
}
/* Specific to Uploader */
#media-upload .media-upload-form p {
margin: 0 0 1em 1em;
}
.filename {
float: right;
margin-left:0;
margin-right: 10px;
}
#media-upload .describe th.label {
text-align:right;
}
.menu_order {
float:left;
}
.image-align-none-label,
.image-align-left-label,
.image-align-center-label,
.image-align-right-label {
background-position: center right;
}

View File

@@ -32,6 +32,7 @@ form {
.media-upload-form label, .media-upload-form legend {
display:block;
font-weight: bold;
font-size: 13px;
margin-bottom: 0.5em;
margin: 0 0 0.5em 0;
}
@@ -196,6 +197,11 @@ abbr.required {
#media-upload .media-upload-form p {
margin: 0 1em 1em 0;
}
#media-upload .media-upload-form p.ml-submit {
padding: 1em 0;
}
#media-upload p.help {
font-style: italic;
font-weight: normal;
@@ -217,10 +223,17 @@ abbr.required {
min-height: 36px;
width: 100%;
}
#media-upload .ui-sortable .media-item {
cursor: move;
}
.filename {
float: left;
line-height: 36px;
margin-left: 10px;
float: left;
overflow: hidden;
max-width: 430px;
}
#media-upload .describe {
border-top-width: 1px;
@@ -228,6 +241,7 @@ abbr.required {
padding: 5px;
width: 100%;
clear: both;
cursor: default;
}
#media-upload .describe th.label {
padding-top: .5em;
@@ -240,3 +254,62 @@ abbr.required {
margin-bottom: 1em;
height: 3em;
}
#media-upload #filter {
width: 623px;
}
#media-upload #filter .subsubsub {
margin: 8px 0;
}
#filter .tablenav select {
border-style:solid;
border-width:1px;
padding:2px;
vertical-align:top;
}
#media-upload a.delete,
#media-upload a.del-link {
padding: 0 3px 1px;
}
#media-upload .del-attachment {
display: none;
margin: 5px 0;
}
.menu_order {
float: right;
font-size: 11px;
margin: 10px 10px 0;
}
.menu_order_input {
border: 1px solid #DDDDDD;
font-size: 10px;
padding: 1px;
width: 23px;
}
.ui-sortable-helper {
background-color: #fff;
border: 1px solid #aaa;
opacity: 0.6;
filter: alpha(opacity=60);
}
#media-upload th.order-head {
width: 25%;
text-align: center;
}
#media-upload .widefat {
width: 626px;
border-style: solid solid none;
}
.sorthelper {
z-index: -1;
}

View File

@@ -0,0 +1,3 @@
.ui-tabs-nav {
margin-right: 0;
}

View File

@@ -0,0 +1,8 @@
#posting {
position: static !important;
}
.ui-tabs-nav {
margin-left: 0;
border: 0 !important;
}

View File

@@ -0,0 +1,98 @@
body {
font-family: Tahoma;
}
.ui-tabs-nav {
padding-left:0;
padding-right:8px;
}
.ui-tabs-nav li {
float: right;
}
.button {
font-family: Tahoma;
margin-left:0;
margin-right: 5px;
}
#wphead #viewsite {
margin-left:0;
margin-right: 10px;
}
#viewsite {
right:auto;
left: 8px;
}
#wphead #viewsite a {
font-family: Tahoma;
}
h1 {
right:auto;
left:0;
}
div#posting {
padding-left:0;
padding-right: 16px;
}
#photo_directions span {
right:auto;
left:3px;
}
#img_container a {
float:right;
}
#img_container a, #img_container a:link, #img_container a:visited {
margin:0 0 4px 4px;
}
div#categories {
right:auto;
left:16px;
}
div#categories h2 {
margin: .5em 1em .5em 0;
}
#tagsdiv #newtag {
margin-right:0;
margin-left: 5px;
}
#jaxtag {
padding-left:0;
padding-right: 1em;
}
#tagchecklist {
padding-left:0;
padding-right: 1em;
}
#tagchecklist span {
margin-right: 10px;
margin-left: .5em;
float: right;
}
#tagchecklist span a {
margin: 6px -9px 0pt 0;
float: right;
}
.submitbox {
float: left;
}
.submitbox .submit input {
text-align:right;
}
.video_split #extra_fields {
float:right;
}
.video_split .editor_area {
float: left;
}
.ac_results li {
text-align:right;
}
#TB_ajaxContent #options {
right:auto;
left:25px;
}
#post_status {
margin-left:0;
margin-right: 10px;
}
#footer {
padding: 10px 60px 0 0;
}

521
wp-admin/css/press-this.css Normal file
View File

@@ -0,0 +1,521 @@
body {
font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
color: #333;
margin: 0px;
padding: 0px;
}
img { border: 0; }
/* Tabs */
@media projection , screen {
.ui-tabs-hide {
display: none;
}
}
@media print {
.ui-tabs-nav {
display: none;
}
}
.ui-tabs-nav {
list-style: none;
border-bottom: 1px solid #C6D9E9;
padding-left: 8px;
margin-bottom: .5em;
margin-top: -2em;
}
/* Additional IE specific bug fixes... */
* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
display: inline-block;
}
* :first-child+html .ui-tabs-nav {
/* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
display: inline-block;
}
.ui-tabs-nav:after {
/* clearing without presentational markup, IE gets extra treatment */
display: block;
clear: both;
content: " ";
}
.ui-tabs-nav li {
float: left;
margin: 0;
height: 2em;
line-height: 2em;
}
.ui-tabs-nav a,.ui-tabs-nav a span {
display: block;
}
.ui-tabs-nav a {
margin: 1px 0 0;
/* position: relative makes opacity fail for disabled tab in IE */
padding-left: 0;
color: #27537a;
font-weight: bold;
line-height: 2em;
text-align: center;
text-decoration: none;
white-space: nowrap; /* required in IE 6 */
outline: 0; /* prevent dotted border in Firefox */
padding: 0 1em;
}
.ui-tabs-nav .ui-tabs-selected a {
position: relative;
top: 1px;
z-index: 2;
margin-top: 0;
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
border-style: solid;
border-width: 1px;
background: white;
border-bottom-width: 2px;
margin-top: -2px;
}
.ui-tabs-nav a:hover,.ui-tabs-nav a:focus,.ui-tabs-nav a:active,
.ui-tabs-nav .ui-tabs-selected a:link,.ui-tabs-nav .ui-tabs-selected a:visited {
cursor: pointer;
}
/* Header */
#wphead {
border-top: none;
height: 2em;
padding-top: 8px;
}
.button {
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
padding: 3px 5px;
font-size: 12px;
line-height: 1.5em;
border-width: 1px;
border-style: solid;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
cursor: pointer;
margin-left: 5px;
text-decoration: none;
}
.howto {
font-size: 11px;
font-style: italic;
display: block;
}
#wphead #viewsite {
position: absolute;
margin-top: 12px;
margin-left: 10px;
}
#viewsite {
position: relative;
right: 8px;
top: 6px;
margin: 0 !important;
}
#wphead #viewsite a {
font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
padding: 3px 4px;
display: block;
letter-spacing: normal;
border-width: 1px;
border-style: solid;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
text-decoration: none;
}
#previewview {
padding-top: 8px !important;
padding-bottom: 8px !important;
}
h1 {
font-size: .75em;
line-height: 2.666em;
top: .5em;
right: 0;
margin: 0 !important;
padding: 0 !important;
width: 236px;
background: none;
}
input.text {
border: 0pt none;
outline-color: -moz-use-text-color;
outline-style: none;
outline-width: medium;
padding: 0pt;
width: 100%;
border-style: solid;
color: #333333;
}
/* Editor/Main Column */
div#container {
margin: 0;
min-width: 500px;
}
div#container form {
margin: 0px;
padding: 0px;
}
div#posting {
padding-left: 16px;
position: absolute;
z-index: 1;
width: 66%;
}
#post_title {
width: 99%;
}
.titlewrap {
border-style: solid;
border-width: 1px;
padding: 2px 3px;
border-color: #CCCCCC;
}
div#posting h2 {
margin: .5em 0 .25em 0;
font-size: 12px;
padding: 3px;
background: ;
}
.editor-container {
border-width: 1px;
border-color: #ccc;
border-style: solid;
margin-bottom: 1em;
}
/* Photo Styles */
#photo_directions {
margin-top: .25em;
display: block;
position: relative;
}
#photo_directions span {
display: block;
position: absolute;
top: 0;
right: 3px;
}
#photo_saving {
margin: 0 8px 8px;
vertical-align: middle;
}
#img_container {
background-color: #fff;
overflow: auto;
height: 100px;
}
#img_container a {
display: block;
width: 79px;
height: 79px;
float: left;
}
#img_container img {
width: 75px;
height: 75px;
border: 0px;
padding: 2px;
background-color: #f4f4f4;
cursor: pointer;
}
#img_container a, #img_container a:link, #img_container a:visited {
border: 2px solid #ccc;
margin: 0 4px 4px 0;
}
#img_container a:hover, #img_container a:active {
border: 2px solid #000;
}
/* Submit Column */
div#categories {
font-size: 85%;
position: absolute;
top: 50px;
right: 16px;
width: 27%;
z-index: 2;
}
div#categories h2 {
color: #333;
font-size: 12px;
margin: .5em 0 .5em 1em;
padding: 0;
}
#categories-all {
overflow: auto;
padding: 0 1em 1em 1em;
height: 15em;
}
#categories ul {
list-style: none;
padding: 0;
margin: 0;
}
#tagsdiv #newtag {
padding: 3px;
margin-right: 5px;
width: 16em;
}
#jaxtag {
clear: both;
padding-left: 1em;
margin: 0;
}
#tagchecklist {
padding-left: 1em;
margin-bottom: 1em;
font-size: 12px;
overflow: auto;
}
#tagchecklist strong {
position: absolute;
font-size: .75em;
}
#tagchecklist span {
margin-right: .5em;
margin-left: 10px;
display: block;
float: left;
font-size: 11px;
line-height: 1.8em;
white-space: nowrap;
cursor: default;
}
#tagchecklist span a {
margin: 6px 0pt 0pt -9px;
cursor: pointer;
width: 10px;
height: 10px;
display: block;
float: left;
text-indent: -9999px;
overflow: hidden;
position: absolute;
}
.submit {
-moz-border-radius-bottomleft: 3px;
-khtml-border-bottom-left-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-bottom-left-radius: 3px;
-moz-border-radius-bottomright: 3px;
-khtml-border-bottom-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-bottom-right-radius: 3px;
margin: 0;
padding: 10px;
}
.submitbox {
width: 100%;
float: right;
}
.submitbox .submit a:hover {
border-bottom-width: 1px;
border-bottom-style: solid;
}
.submitbox .submit input {
border: none;
text-align: left;
padding: 6px 4px;
font-size: 12px;
margin: 2px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
cursor: pointer;
}
.submitbox #previewview {
padding: 15px 10px;
-moz-border-radius-topleft: 3px;
-khtml-border-top-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-top-left-radius: 3px;
-moz-border-radius-topright: 3px;
-khtml-border-top-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-top-right-radius: 3px;
}
/* Video Styles */
.video_split #extra_fields {
width: 27%;
height: 300px;
float: left;
}
#embed_code {
border: 0;
width: 99%;
height: 200px;
}
.video_split .editor_area {
width: 70%;
float: right;
}
.ac_results {
padding: 0;
margin: 0;
list-style: none;
position: absolute;
z-index: 10000;
display: none;
border-width: 1px;
border-style: solid;
}
.ac_results li {
padding: 2px 5px;
white-space: nowrap;
text-align: left;
}
.ac_over {
cursor: pointer;
}
.ac_match {
text-decoration: underline;
}
.photolist {
display: none;
}
#extra_fields small {
display: block;
margin-top: .5em;
padding-bottom: .25em;
}
#TB_ajaxContent #options {
position: absolute;
top: 20px;
right: 25px;
padding: 5px;
}
#TB_ajaxContent h3 {
margin-bottom: .25em;
}
.updated {
margin: 0;
margin-left: 15px;
margin-right: 15px;
padding: 0;
max-width: 980px;
border-width: 1px;
border-style: solid;
padding: 0 0.6em;
max-width: 950px;
margin-top: 1em;
margin-bottom: 1em;
}
.updated p, .error p {
margin: 0.6em 0;
}
.updated a, .error a {
text-decoration: underline;
}
.updated a {
text-decoration: none;
padding-bottom: 2px;
}
#post_status {
margin-left: 10px;
margin-bottom: 1em;
display: block;
}
/* Footer */
#footer {
height: 65px;
display: block;
width: 640px;
padding: 10px 0 0 60px;
margin: 0;
position: absolute;
bottom: 0;
font-size: 12px;
}
#footer p {
margin: 0;
padding: 7px 0;
}
#footer p a {
text-decoration: none;
}
#footer p a:hover {
text-decoration: underline;
}
/* Utility Classes */
.centered {
text-align: center;
}
.hidden {
display: none;
}

View File

@@ -1,11 +1,15 @@
#template textarea {
font-family:monospace;
}
#templateside {
float:left;
}
#themeselector {
padding-right:0;
padding-left:5px;
padding-left: 5px;
float: left;
}
div.tablenav {
margin-left:210px;
margin-right:0;
}
margin-left: 210px;
}

View File

@@ -1,50 +1,45 @@
/* 2 column liquid layout */
div.widget-liquid-left-holder {
clear:right;
float:right;
float: right;
clear: right;
margin-right:0;
margin-left:-310px;
margin-left: -310px;
}
div.widget-liquid-left {
margin-right:0;
margin-left:310px;
margin-left: 320px;
}
div.widget-liquid-right {
clear:left;
float:left;
float: left;
clear: left;
}
p#widget-search {
right:auto;
left:0;
right:auto
}
h4.widget-title span {
float: right;
}
h4.widget-title a {
float: left;
margin-left:0;
margin-right: 1em;
}
ul#widget-list li.widget-list-item h4.widget-title {
float:right;
text-align:right;
}
ul#widget-list li.widget-list-item div.widget-description {
margin:0 200px 0 0;
padding:0 4em 0 0;
margin: 0 200px 0 0;
padding: 0 4em 0 0;
}
.widget-control-save, .widget-control-remove {
float:right;
margin-right:0;
margin-left:8px;
margin-left: 8px;
float: right;
}
h4.widget-title a {
li.widget-list-control-item h4.widget-title a,
#dragHelper li.widget-list-control-item h4.widget-title a,
#draghelper li.widget-list-control-item h4.widget-title a:visited {
right:auto;
left:1em;
left: 1em;
}
li.widget-list-control-item h4.widget-title a, #dragHelper li.widget-list-control-item h4.widget-title a, #draghelper li.widget-list-control-item h4.widget-title a:visited {
right:auto;
left:1em;
}
li.widget-list-control-item div.widget-control {
padding:0 0 0 10px;
}
ul.widget-control-list div.widget-control-actions {
margin-right:0;
margin-left:-10px;
}
ul.widget-control-list .widget-title {
text-align:right;
}

View File

@@ -45,10 +45,20 @@ ul#widget-list li.widget-list-item {
margin: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
background-color: transparent;
line-height: 1;
}
h4.widget-title span {
float: left;
}
h4.widget-title a {
float: right;
text-decoration: underline;
border-bottom: none;
margin-left: 1em;
}
ul#widget-list li.widget-list-item h4.widget-title {
position: relative;
margin: 0;
@@ -59,7 +69,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;;
border-radius: 3px;
}
#dragHelper h4.widget-title {
@@ -74,7 +84,6 @@ ul#widget-list li.widget-list-item div.widget-description {
font-size: 11px;
}
ul#widget-list li.widget-list-item ul.widget-control-info {
display: none;
}
@@ -91,27 +100,26 @@ ul.widget-control-list {
padding: 0 1em;
}
ul.widget-control-list li {
position: relative;
}
div#current-widgets p.submit {
padding: 1em;
}
li.widget-list-control-item {
margin: 0 0 1em;
margin: 1em 0;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.widget-sortable h4 {
li.widget-list-control-item h4,
#dragHelper li.widget-list-control-item h4,
li.widget-sortable h4 {
margin: 0;
padding: 0.4em 2.5em 0.4em 0.8em;
cursor: move;
font-size: 13px;
padding: 0.4em 0.8em;
position: relative;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
@@ -129,13 +137,6 @@ li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.w
text-decoration: none;
}
h4.widget-title a {
position: absolute;
right: 1em;
text-decoration: underline;
border-bottom: none;
}
li.widget-list-control-item h4.widget-title a,
#dragHelper li.widget-list-control-item h4.widget-title a,
#draghelper li.widget-list-control-item h4.widget-title a:visited {
@@ -143,16 +144,15 @@ li.widget-list-control-item h4.widget-title a,
}
li.widget-list-control-item h4.widget-title a:hover {
text-decoration: none;
border-bottom: none;
}
li.widget-list-control-item div.widget-control {
display: none;
margin: 1em;
padding: 0 10px 0 7px; /* Correction for padding, margin, border of inputs */
padding: 15px;
font-size: 11px;
position: relative;
}
li.widget-list-control-item div.widget-control p {
@@ -161,15 +161,9 @@ li.widget-list-control-item div.widget-control p {
}
ul.widget-control-list div.widget-control-actions {
margin-right: -10px; /* Correction for padding, margin, border of inputs */
margin-left: -6px;
border-top-width: 1px;
border-top-style: solid;
padding: 0.5em 0 0.8em;
}
ul.widget-control-list .widget-title {
padding: 0.5em 0 0;
}
.widget-control-edit {

View File

@@ -189,7 +189,7 @@ Event.observe( window, 'load', hide_text );
<div id="desc"><?php bloginfo('description');?></div>
</div>
<?php if ( !defined( 'NO_HEADER_TEXT' ) ) { ?>
<form method="post" action="<?php echo get_option('siteurl') ?>/wp-admin/themes.php?page=custom-header&amp;updated=true">
<form method="post" action="<?php echo admin_url('themes.php?page=custom-header&amp;updated=true') ?>">
<input type="button" value="<?php _e('Hide Text'); ?>" onclick="hide_text()" id="hidetext" />
<input type="button" value="<?php _e('Select a Text Color'); ?>" onclick="colorSelect($('textcolor'), 'pickcolor')" id="pickcolor" /><input type="button" value="<?php _e('Use Original Color'); ?>" onclick="colorDefault()" id="defaultcolor" />
<?php wp_nonce_field('custom-header') ?>

View File

@@ -26,18 +26,18 @@ if ( ! empty($cat_ID) ) {
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
<td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" /><br />
<td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" aria-required="true" /><br />
<?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape($category->slug); ?>" size="40" /><br />
<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
<?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th>
<td>
<?php wp_dropdown_categories('hide_empty=0&name=category_parent&orderby=name&selected=' . $category->parent . '&hierarchical=1&show_option_none=' . __('None')); ?><br />
<?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
<?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?>
</td>
</tr>

View File

@@ -12,8 +12,7 @@ if ( !empty( $_REQUEST['delete_comments'] ) ) {
$comments_deleted = $comments_approved = $comments_unapproved = $comments_spammed = 0;
foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each
$comment = (int) $comment;
$post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
// $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") );
$post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment) );
if ( !current_user_can('edit_post', $post_id) )
continue;
if ( !empty( $_REQUEST['spamit'] ) ) {
@@ -31,6 +30,8 @@ if ( !empty( $_REQUEST['delete_comments'] ) ) {
}
endforeach;
$redirect_to = basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed . '&unapproved=' . $comments_unapproved;
if ( isset($_REQUEST['apage']) )
$redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to );
if ( !empty($_REQUEST['mode']) )
$redirect_to = add_query_arg('mode', $_REQUEST['mode'], $redirect_to);
if ( !empty($_REQUEST['comment_status']) )
@@ -97,7 +98,7 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp
<?php
$status_links = array();
$num_comments = wp_count_comments();
$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', $num_comments->moderated), "<span class='comment-count'>$num_comments->moderated</span>"), 'approved' => _c('Approved|plural'));
$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 'approved' => _c('Approved|plural'));
$class = ( '' === $comment_status ) ? ' class="current"' : '';
$status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>";
foreach ( $stati as $status => $label ) {
@@ -117,6 +118,7 @@ unset($status_links);
</ul>
<p id="post-search">
<label class="hidden" for="post-search-input"><?php _e( 'Search Comments' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo $search; ?>" />
<input type="submit" value="<?php _e( 'Search Comments' ); ?>" class="button" />
</p>
@@ -132,22 +134,24 @@ unset($status_links);
<?php
$comments_per_page = apply_filters('comments_per_page', 20, $comment_status);
if ( isset( $_GET['apage'] ) )
$page = abs( (int) $_GET['apage'] );
else
$page = 1;
$start = $offset = ( $page - 1 ) * 20;
$start = $offset = ( $page - 1 ) * $comments_per_page;
list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, 25 ); // Grab a few extra
list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5 ); // Grab a few extra
$comments = array_slice($_comments, 0, 20);
$extra_comments = array_slice($_comments, 20);
$comments = array_slice($_comments, 0, $comments_per_page);
$extra_comments = array_slice($_comments, $comments_per_page);
$page_links = paginate_links( array(
'base' => add_query_arg( 'apage', '%#%' ),
'format' => '',
'total' => ceil($total / 20),
'total' => ceil($total / $comments_per_page),
'current' => $page
));
@@ -173,6 +177,9 @@ if ( $page_links )
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php do_action('manage_comments_nav', $comment_status); ?>
<?php wp_nonce_field('bulk-comments'); ?>
<?php if ( isset($_GET['apage']) ) { ?>
<input type="hidden" name="apage" value="<?php echo absint( $_GET['apage'] ); ?>" />
<?php } ?>
</div>
<br class="clear" />
@@ -186,7 +193,7 @@ if ($comments) {
<table class="widefat">
<thead>
<tr>
<th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('comments-form'));" /></th>
<th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Comment') ?></th>
<th scope="col"><?php _e('Date') ?></th>
<th scope="col" class="action-links"><?php _e('Actions') ?></th>

View File

@@ -1,12 +1,46 @@
<?php
$action = isset($action)? $action : '';
<?php
$action = isset($action) ? $action : '';
if ( isset($_GET['message']) )
$_GET['message'] = absint( $_GET['message'] );
$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Post updated.');
if ( isset($_GET['revision']) )
$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
$notice = false;
$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' );
if ( !isset($post_ID) || 0 == $post_ID ) {
$form_action = 'post';
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
$autosave = false;
} else {
$post_ID = (int) $post_ID;
$form_action = 'editpost';
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
$autosave = wp_get_post_autosave( $post_id );
// Detect if there exists an autosave newer than the post and if that autosave is different than the post
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) {
foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
if ( wp_text_diff( $autosave->$autosave_field, $post->$autosave_field ) ) {
$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
break;
}
}
unset($autosave_field, $_autosave_field);
}
}
?>
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
<?php endif; ?>
<?php if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif; ?>
@@ -20,33 +54,15 @@ $messages[4] = __('Post updated.');
<h2><?php _e('Write Post') ?></h2>
<?php
if (!isset($post_ID) || 0 == $post_ID) {
$form_action = 'post';
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
if ( !isset($post_ID) || 0 == $post_ID)
wp_nonce_field('add-post');
} else {
$post_ID = (int) $post_ID;
$form_action = 'editpost';
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
else
wp_nonce_field('update-post_' . $post_ID);
}
$form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />';
$form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />';
$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
if ('' != $post->pinged) {
$pings = '<p>'. __('Already pinged:') . '</p><ul>';
$already_pinged = explode("\n", trim($post->pinged));
foreach ($already_pinged as $pinged_url) {
$pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";
}
$pings .= '</ul>';
}
$saveasdraft = '<input name="save" type="submit" id="save" class="button" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />';
?>
@@ -57,14 +73,7 @@ $saveasdraft = '<input name="save" type="submit" id="save" class="button" tabind
<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php
if ( !empty($_REQUEST['popupurl']) )
echo clean_url(stripslashes($_REQUEST['popupurl']));
else if ( strpos( wp_get_referer(), '/wp-admin/' ) === false && $post_ID && url_to_postid(wp_get_referer()) === $post_ID )
echo 'redo';
else
echo clean_url(stripslashes(wp_get_referer()));
?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
<?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
<?php echo $form_extra ?>
@@ -83,10 +92,13 @@ else
<div class="inside">
<p><strong><?php _e('Publish Status') ?></strong></p>
<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
<p>
<select name='post_status' tabindex='4'>
<?php if ( current_user_can('publish_posts') ) : // Contributors only get "Unpublished" and "Pending Review" ?>
<select name='post_status' id='post_status' tabindex='4'>
<?php
// only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability)
if ( current_user_can('publish_posts') OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) :
?>
<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
<?php if ( 'future' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
@@ -98,7 +110,7 @@ else
</p>
<?php if ( current_user_can( 'publish_posts' ) ) : ?>
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label></p>
<p id="private-checkbox"><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label></p>
<?php endif; ?>
<?php
if ($post_ID) {
@@ -156,6 +168,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
<br class="clear" />
<?php endif; ?>
<span id="autosave"></span>
<span id="wp-word-count"></span>
</p>
<div class="side-info">
@@ -172,6 +185,9 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
<li><a href="edit.php?post_status=draft"><?php _e('View Drafts'); ?></a></li>
<?php do_action('post_relatedlinks_list'); ?>
</ul>
<h5><?php _e('Shortcuts') ?></h5>
<p><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?> <a href="<?php echo get_shortcut_link(); ?>" title="<?php echo attribute_escape(__('Press This')) ?>"><?php _e('Press This') ?></a></p>
</div>
<?php do_action('submitpost_box'); ?>
@@ -179,7 +195,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
<div id="post-body">
<div id="titlediv">
<h3><?php _e('Title') ?></h3>
<h3><label for="title"><?php _e('Title') ?></label></h3>
<div id="titlewrap">
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" autocomplete="off" />
</div>
@@ -194,7 +210,7 @@ endif; ?>
</div>
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
<h3><?php _e('Post') ?></h3>
<h3><label for="content"><?php _e('Post') ?></label></h3>
<?php the_editor($post->post_content); ?>
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
@@ -205,23 +221,22 @@ endif; ?>
<?php echo $form_pingback ?>
<?php echo $form_prevstatus ?>
<div id="tagsdiv" class="postbox <?php echo postbox_classes('tagsdiv', 'post'); ?>">
<h3><?php _e('Tags'); ?></h3>
<div class="inside">
<p id="jaxtag"><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post_ID ); ?>" /></p>
<?php
function post_tags_meta_box($post) {
?>
<p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
<div id="tagchecklist"></div>
</div>
</div>
<div id="categorydiv" class="postbox <?php echo postbox_classes('categorydiv', 'post'); ?>">
<h3><?php _e('Categories') ?></h3>
<div class="inside">
<?php
}
add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'normal', 'core');
function post_categories_meta_box($post) {
?>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="category-add" class="wp-hidden-child">
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" />
<?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
<label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
<label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
<?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
@@ -241,12 +256,13 @@ endif; ?>
<div id="categories-all" class="ui-tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php wp_category_checklist($post_ID) ?>
<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
</ul>
</div>
</div>
</div>
<?php
}
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'normal', 'core');
?>
<?php do_meta_boxes('post', 'normal', $post); ?>
@@ -254,32 +270,41 @@ endif; ?>
<h2><?php _e('Advanced Options'); ?></h2>
<div id="postexcerpt" class="postbox <?php echo postbox_classes('postexcerpt', 'post'); ?>">
<h3><?php _e('Excerpt') ?></h3>
<div class="inside"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
<?php
function post_excerpt_meta_box($post) {
?>
<label class="hidden" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
<p><?php _e('Excerpts are optional hand-crafted summaries of your content. You can <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank">use them in your template</a>'); ?></p>
</div>
</div>
<?php
}
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'advanced', 'core');
<div id="trackbacksdiv" class="postbox <?php echo postbox_classes('trackbacksdiv', 'post'); ?>">
<h3><?php _e('Trackbacks') ?></h3>
<div class="inside">
<p><?php _e('Send trackbacks to:'); ?> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
function post_trackback_meta_box($post) {
$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
if ('' != $post->pinged) {
$pings = '<p>'. __('Already pinged:') . '</p><ul>';
$already_pinged = explode("\n", trim($post->pinged));
foreach ($already_pinged as $pinged_url) {
$pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";
}
$pings .= '</ul>';
}
?>
<p><label for="trackback"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
<p><?php _e('Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress blogs they&#8217;ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
<?php
if ( ! empty($pings) )
echo $pings;
?>
</div>
</div>
}
add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core');
<div id="postcustom" class="postbox <?php echo postbox_classes('postcustom', 'post'); ?>">
<h3><?php _e('Custom Fields') ?></h3>
<div class="inside">
function post_custom_meta_box($post) {
?>
<div id="postcustomstuff">
<table cellpadding="3">
<?php
$metadata = has_meta($post_ID);
$metadata = has_meta($post->ID);
list_meta($metadata);
?>
@@ -290,55 +315,66 @@ list_meta($metadata);
<div id="ajax-response"></div>
</div>
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
</div>
</div>
<?php
}
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'advanced', 'core');
<?php do_action('dbx_post_advanced'); ?>
do_action('dbx_post_advanced');
<div id="commentstatusdiv" class="postbox <?php echo postbox_classes('commentstatusdiv', 'post'); ?>">
<h3><?php _e('Comments &amp; Pings') ?></h3>
<div class="inside">
function post_comment_status_meta_box($post) {
?>
<input name="advanced_view" type="hidden" value="1" />
<p><label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
<?php _e('Allow Comments') ?></label></p>
<p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
<p><?php _e('These settings apply to this post only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
</div>
</div>
<div id="passworddiv" class="postbox <?php echo postbox_classes('passworddiv', 'post'); ?>">
<h3><?php _e('Password Protect This Post') ?></h3>
<div class="inside">
<p><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
</div>
</div>
<div id="slugdiv" class="postbox <?php echo postbox_classes('slugdiv', 'post'); ?>">
<h3><?php _e('Post Slug') ?></h3>
<div class="inside">
<input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
</div>
</div>
<?php
}
add_meta_box('commentstatusdiv', __('Comments &amp; Pings'), 'post_comment_status_meta_box', 'post', 'advanced', 'core');
function post_password_meta_box($post) {
?>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
<?php
}
add_meta_box('passworddiv', __('Password Protect This Post'), 'post_password_meta_box', 'post', 'advanced', 'core');
function post_slug_meta_box($post) {
?>
<label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
<?php
}
add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'advanced', 'core');
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
if ( $authors && count( $authors ) > 1 ) :
function post_author_meta_box($post) {
global $current_user, $user_ID;
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
?>
<div id="authordiv" class="postbox <?php echo postbox_classes('authordiv', 'post'); ?>">
<h3><?php _e('Post Author'); ?></h3>
<div class="inside">
<?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
</div>
</div>
<?php endif; ?>
<label class="hidden" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
<?php
}
add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'advanced', 'core');
endif;
<?php do_meta_boxes('post', 'advanced', $post); ?>
if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
function post_revisions_meta_box($post) {
wp_list_post_revisions();
}
add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'advanced', 'core');
endif;
<?php do_action('dbx_post_sidebar'); ?>
do_meta_boxes('post', 'advanced', $post);
do_action('dbx_post_sidebar');
?>
</div>
</div>

View File

@@ -22,9 +22,9 @@ $form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment-
<div class="inside">
<p><strong><?php _e('Approval Status') ?></strong></p>
<p><strong><label for='comment_status'><?php _e('Approval Status') ?></label></strong></p>
<p>
<select name='comment_status'>
<select name='comment_status' id='comment_status'>
<option<?php selected( $comment->comment_approved, '1' ); ?> value='1'><?php _e('Approved') ?></option>
<option<?php selected( $comment->comment_approved, '0' ); ?> value='0'><?php _e('Moderated') ?></option>
<option<?php selected( $comment->comment_approved, 'spam' ); ?> value='spam'><?php _e('Spam') ?></option>
@@ -64,28 +64,28 @@ echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletec
<div id="post-body">
<div id="namediv" class="stuffbox">
<h3><?php _e('Name') ?></h3>
<h3><label for="name"><?php _e('Name') ?></label></h3>
<div class="inside">
<input type="text" name="newcomment_author" size="30" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" />
</div>
</div>
<div id="emaildiv" class="stuffbox">
<h3><?php _e('E-mail') ?></h3>
<h3><label for="email"><?php _e('E-mail') ?></label></h3>
<div class="inside">
<input type="text" name="newcomment_author_email" size="30" value="<?php echo attribute_escape( $comment->comment_author_email ); ?>" tabindex="2" id="email" />
</div>
</div>
<div id="uridiv" class="stuffbox">
<h3><?php _e('URL') ?></h3>
<h3><label for="newcomment_author_url"><?php _e('URL') ?></label></h3>
<div class="inside">
<input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="3" />
</div>
</div>
<div id="postdiv" class="postarea">
<h3><?php _e('Comment') ?></h3>
<h3><label for="content"><?php _e('Comment') ?></label></h3>
<?php the_editor($comment->comment_content, 'content', 'newcomment_author_url', false, 4); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
</div>

View File

@@ -10,12 +10,13 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
foreach( (array) $_GET['delete'] as $cat_ID ) {
$cat_name = get_term_field('name', $cat_ID, 'link_category');
$default_cat_id = get_option('default_link_category');
// Don't delete the default cats.
if ( $cat_ID == get_option('default_link_category') )
if ( $cat_ID == $default_cat_id )
wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
wp_delete_term($cat_ID, 'link_category');
wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
}
$location = 'edit-link-categories.php';
@@ -62,6 +63,7 @@ endif; ?>
<?php endif; ?>
<p id="post-search">
<label class="hidden" for="post-search-input"><?php _e( 'Search Categories' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
@@ -101,7 +103,7 @@ if ( $page_links )
<table class="widefat">
<thead>
<tr>
<th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
<th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Name') ?></th>
<th scope="col"><?php _e('Description') ?></th>
<th scope="col" class="num" style="width: 90px;"><?php _e('Links') ?></th>

View File

@@ -26,11 +26,11 @@ if ( ! empty($cat_ID) ) {
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="name"><?php _e('Category name') ?></label></th>
<td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" /></td>
<td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" aria-required="true" /></td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="slug"><?php _e('Category slug') ?></label></th>
<td><input name="slug" id="slug" type="text" value="<?php echo $category->slug; ?>" size="40" />
<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" />
<?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
</tr>
<tr class="form-field">

View File

@@ -74,7 +74,7 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<div id="post-body">
<div id="namediv" class="stuffbox">
<h3><?php _e('Name') ?></h3>
<h3><label for="link_name"><?php _e('Name') ?></label></h3>
<div class="inside">
<input type="text" name="link_name" size="30" tabindex="1" value="<?php echo $link->link_name; ?>" id="link_name" /><br />
<?php _e('Example: Nifty blogging software'); ?>
@@ -82,7 +82,7 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
</div>
<div id="addressdiv" class="stuffbox">
<h3><?php _e('Web Address') ?></h3>
<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
<div class="inside">
<input type="text" name="link_url" size="30" tabindex="1" value="<?php echo $link->link_url; ?>" id="link_url" /><br />
<?php _e('Example: <code>http://wordpress.org/</code> &#8212; don&#8217;t forget the <code>http://</code>'); ?>
@@ -90,21 +90,19 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
</div>
<div id="descriptiondiv" class="stuffbox">
<h3><?php _e('Description') ?></h3>
<h3><label for="link_description"><?php _e('Description') ?></label></h3>
<div class="inside">
<input type="text" name="link_description" size="30" tabindex="1" value="<?php echo $link->link_description; ?>" id="link_description" /><br />
<?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?>
</div>
</div>
<div id="linkcategorydiv" class="postbox <?php echo postbox_classes('linkcategorydiv', 'link'); ?>">
<h3><?php _e('Categories') ?></h3>
<div class="inside">
<?php function link_categories_meta_box($link) { ?>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="link-category-add" class="wp-hidden-child">
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" />
<label class="hidden" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" aria-required="true" />
<input type="button" id="category-add-sumbit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
@@ -118,7 +116,7 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<div id="categories-all" class="ui-tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php wp_link_category_checklist($link_id); ?>
<?php wp_link_category_checklist($link->link_id); ?>
</ul>
</div>
@@ -127,17 +125,17 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<?php wp_popular_terms_checklist('link_category'); ?>
</ul>
</div>
</div>
</div>
<?php
}
add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
?>
<?php do_meta_boxes('link', 'normal', $link); ?>
<h2><?php _e('Advanced Options'); ?></h2>
<div id="linktargetdiv" class="postbox <?php echo postbox_classes('linktargetdiv', 'link'); ?>">
<h3><?php _e('Target') ?></h3>
<div class="inside">
<?php function link_target_meta_box($link) { ?>
<fieldset><legend class="hidden"><?php _e('Target') ?></legend>
<label for="link_target_blank" class="selectit">
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
<code>_blank</code></label><br />
@@ -147,16 +145,17 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<label for="link_target_none" class="selectit">
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
<?php _e('none') ?></label>
</fieldset>
<p><?php _e('Choose the frame your link targets. Essentially this means if you choose <code>_blank</code> your link will open in a new window.'); ?></p>
</div>
</div>
<?php
}
add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'advanced', 'core');
<div id="linkxfndiv" class="postbox <?php echo postbox_classes('linkxfndiv', 'link'); ?>">
<h3><?php _e('Link Relationship (XFN)') ?></h3>
<div class="inside">
function link_xfn_meta_box($link) {
?>
<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
<tr>
<th style="width: 20%;" scope="row"><?php _e('rel:') ?></th>
<th style="width: 20%;" scope="row"><label for="link_rel"><?php _e('rel:') ?></label></th>
<td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
</tr>
<tr>
@@ -164,15 +163,15 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<table cellpadding="3" cellspacing="5" class="form-table">
<tr>
<th scope="row"> <?php _e('identity') ?> </th>
<td>
<td><fieldset><legend class="hidden"> <?php _e('identity') ?> </legend>
<label for="me">
<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
<?php _e('another web address of mine') ?></label>
</td>
</fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('friendship') ?> </th>
<td>
<td><fieldset><legend class="hidden"> <?php _e('friendship') ?> </legend>
<label for="contact">
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
<label for="acquaintance">
@@ -181,30 +180,30 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
<label for="friendship">
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
</td>
</fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('physical') ?> </th>
<td>
<td><fieldset><legend class="hidden"> <?php _e('physical') ?> </legend>
<label for="met">
<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
<?php _e('met') ?></label>
</td>
</fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('professional') ?> </th>
<td>
<td><fieldset><legend class="hidden"> <?php _e('professional') ?> </legend>
<label for="co-worker">
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
<?php _e('co-worker') ?></label>
<label for="colleague">
<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
<?php _e('colleague') ?></label>
</td>
</fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('geographical') ?> </th>
<td>
<td><fieldset><legend class="hidden"> <?php _e('geographical') ?> </legend>
<label for="co-resident">
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
<?php _e('co-resident') ?></label>
@@ -214,11 +213,11 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<label for="geographical">
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
<?php _e('none') ?></label>
</td>
</fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('family') ?> </th>
<td>
<td><fieldset><legend class="hidden"> <?php _e('family') ?> </legend>
<label for="child">
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
<?php _e('child') ?></label>
@@ -237,11 +236,11 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<label for="family">
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
<?php _e('none') ?></label>
</td>
</fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('romantic') ?> </th>
<td>
<td><fieldset><legend class="hidden"> <?php _e('romantic') ?> </legend>
<label for="muse">
<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
<?php _e('muse') ?></label>
@@ -254,19 +253,19 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<label for="romantic">
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
<?php _e('sweetheart') ?></label>
</td>
</fieldset></td>
</tr>
</table>
</td>
</tr>
</table>
<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
</div>
</div>
<?php
}
add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'advanced', 'core');
<div id="linkadvanceddiv" class="postbox <?php echo postbox_classes('linkadvanceddiv', 'link'); ?>">
<h3><?php _e('Advanced') ?></h3>
<div class="inside">
function link_advanced_meta_box($link) {
?>
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
<tr class="form-field">
<th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
@@ -294,12 +293,13 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
</td>
</tr>
</table>
</div>
</div>
<?php
}
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'advanced', 'core');
<?php do_meta_boxes('link', 'advanced', $link); ?>
do_meta_boxes('link', 'advanced', $link);
<?php if ( $link_id ) : ?>
if ( $link_id ) : ?>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />

View File

@@ -5,10 +5,12 @@ $messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Page updated.');
?>
<?php if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif;
if ( isset($_GET['revision']) )
$messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
$notice = false;
$notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' );
if (!isset($post_ID) || 0 == $post_ID) {
$form_action = 'post';
@@ -20,17 +22,23 @@ if (!isset($post_ID) || 0 == $post_ID) {
$form_action = 'editpost';
$nonce_action = 'update-page_' . $post_ID;
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
$autosave = wp_get_post_autosave( $post_id );
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) )
$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
}
$temp_ID = (int) $temp_ID;
$user_ID = (int) $user_ID;
$sendto = clean_url(stripslashes(wp_get_referer()));
if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
$sendto = 'redo';
?>
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
<?php endif; ?>
<?php if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif; ?>
<form name="post" action="page.php" method="post" id="post">
<div class="wrap">
<h2><?php _e('Write Page') ?></h2>
@@ -44,15 +52,11 @@ if (isset($mode) && 'bookmarklet' == $mode)
<input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
<?php echo $form_extra ?>
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php
if ( strpos( wp_get_referer(), '/wp-admin/' ) === false && $post_ID && url_to_postid(wp_get_referer()) === $post_ID )
echo 'redo';
else
echo clean_url(stripslashes(wp_get_referer()));
?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
<?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
<div id="poststuff">
@@ -68,14 +72,14 @@ else
</div>
<div class="inside">
<p><strong><?php _e('Publish Status') ?></strong></p>
<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
<p>
<select name='post_status' tabindex='4'>
<?php if ( current_user_can('publish_pages') ) : ?>
<select name='post_status' tabindex='4' id='post_status'>
<?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages')
// 'publish' option will be selected for published AND private posts (checkbox overrides dropdown)
if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) :
?>
<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
<?php else: ?>
<option<?php selected( $post->post_status, 'private' ); ?> value='private'><?php _e('Published') ?></option>
<?php endif; ?>
<?php if ( 'future' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Pending') ?></option>
@@ -84,8 +88,10 @@ else
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option>
</select>
</p>
<?php if ( current_user_can( 'publish_posts' ) ) : ?>
<p id="private-checkbox"><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
<?php endif; ?>
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
<?php
if ($post_ID) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
@@ -140,6 +146,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
<br class="clear" />
<?php endif; ?>
<span id="autosave"></span>
<span id="wp-word-count"></span>
</p>
<div class="side-info">
@@ -159,7 +166,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
<div id="post-body">
<div id="titlediv">
<h3><?php _e('Title') ?></h3>
<h3><label for="title"><?php _e('Title') ?></label></h3>
<div id="titlewrap">
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" autocomplete="off" />
</div>
@@ -174,7 +181,7 @@ endif; ?>
</div>
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
<h3><?php _e('Page') ?></h3>
<h3><label for="content"><?php _e('Page') ?></label></h3>
<?php the_editor($post->post_content); ?>
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
@@ -188,13 +195,14 @@ endif; ?>
<h2><?php _e('Advanced Options'); ?></h2>
<div id="pagepostcustom" class="postbox <?php echo postbox_classes('pagepostcustom', 'page'); ?>">
<h3><?php _e('Custom Fields') ?></h3>
<div class="inside">
<?php
function page_custom_meta_box($post){
?>
<div id="postcustomstuff">
<table cellpadding="3">
<?php
$metadata = has_meta($post_ID);
$metadata = has_meta($post->ID);
list_meta($metadata);
?>
@@ -205,83 +213,97 @@ list_meta($metadata);
<div id="ajax-response"></div>
</div>
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
</div>
</div>
<?php
}
add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'advanced', 'core');
<div id="pagecommentstatusdiv" class="postbox <?php echo postbox_classes('pagecommentstatusdiv', 'page'); ?>">
<h3><?php _e('Comments &amp; Pings') ?></h3>
<div class="inside">
function page_comments_status_meta_box($post){
?>
<input name="advanced_view" type="hidden" value="1" />
<p><label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
<?php _e('Allow Comments') ?></label></p>
<p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
<p><?php _e('These settings apply to this page only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
</div>
</div>
<?php
}
add_meta_box('pagecommentstatusdiv', __('Comments &amp; Pings'), 'page_comments_status_meta_box', 'page', 'advanced', 'core');
<div id="pagepassworddiv" class="postbox <?php echo postbox_classes('pagepassworddiv', 'page'); ?>">
<h3><?php _e('Password Protect This Page') ?></h3>
<div class="inside">
<p><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
function page_password_meta_box($post){
?>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
</div>
</div>
<?php
}
add_meta_box('pagepassworddiv', __('Password Protect This Page'), 'page_password_meta_box', 'page', 'advanced', 'core');
<div id="pageslugdiv" class="postbox <?php echo postbox_classes('pageslugdiv', 'page'); ?>">
<h3><?php _e('Page Slug') ?></h3>
<div class="inside">
<input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
</div>
</div>
function page_slug_meta_box($post){
?>
<label class="hidden" for="post_name"><?php _e('Page Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
<?php
}
add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'advanced', 'core');
<div id="pageparentdiv" class="postbox <?php echo postbox_classes('pageparentdiv', 'page'); ?>">
<h3><?php _e('Page Parent') ?></h3>
<div class="inside">
<select name="parent_id">
function page_parent_meta_box($post){
?>
<label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label>
<select name="parent_id" id="parent_id">
<option value='0'><?php _e('Main Page (no parent)'); ?></option>
<?php parent_dropdown($post->post_parent); ?>
</select>
<p><?php _e('You can arrange your pages in hierarchies, for example you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
</div>
</div>
<?php
}
add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', 'advanced', 'core');
<?php if ( 0 != count( get_page_templates() ) ) { ?>
<div id="pagetemplatediv" class="postbox <?php echo postbox_classes('pagetemplatediv', 'page'); ?>">
<h3><?php _e('Page Template') ?></h3>
<div class="inside">
<select name="page_template">
if ( 0 != count( get_page_templates() ) ) {
function page_template_meta_box($post){
?>
<label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
<option value='default'><?php _e('Default Template'); ?></option>
<?php page_template_dropdown($post->page_template); ?>
</select>
<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them above.'); ?></p>
</div>
</div>
<?php } ?>
<div id="pageorderdiv" class="postbox <?php echo postbox_classes('pageorderdiv', 'page'); ?>">
<h3><?php _e('Page Order') ?></h3>
<div class="inside">
<p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it&#8217;ll be better in future releases.)'); ?></p>
</div>
</div>
<?php
}
add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', 'advanced', 'core');
}
function page_order_meta_box($post){
?>
<p><label class="hidden" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it&#8217;ll be better in future releases.)'); ?></p>
<?php
}
add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', 'advanced', 'core');
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
if ( $authors && count( $authors ) > 1 ) :
if ( $authors && count( $authors ) > 1 ) {
function page_author_meta_box($post){
global $current_user, $user_ID;
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
?>
<div id="pageauthordiv" class="postbox <?php echo postbox_classes('pageauthordiv', 'page'); ?>">
<h3><?php _e('Page Author'); ?></h3>
<div class="inside">
<?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
</div>
</div>
<?php endif; ?>
<label class="hidden" for="post_author_override"><?php _e('Page Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
<?php
}
add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'advanced', 'core');
}
<?php do_meta_boxes('page', 'advanced', $post); ?>
if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
function page_revisions_meta_box($post) {
wp_list_post_revisions();
}
add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'advanced', 'core');
endif;
do_meta_boxes('page', 'advanced', $post);
?>
</div>
</div>

View File

@@ -20,8 +20,8 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
}
$sendback = wp_get_referer();
if (strpos($sendback, 'page.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/page-new.php';
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php';
if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
wp_redirect($sendback);
@@ -111,12 +111,32 @@ endif;
?>
<p id="post-search">
<label class="hidden" for="post-search-input"><?php _e( 'Search Pages' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Pages' ); ?>" class="button" />
</p>
<div class="tablenav">
<?php
$pagenum = absint( $_GET['pagenum'] );
if ( empty($pagenum) )
$pagenum = 1;
if( !$per_page || $per_page < 0 )
$per_page = 20;
$num_pages = ceil(count($posts) / $per_page);
$page_links = paginate_links( array(
'base' => add_query_arg( 'pagenum', '%#%' ),
'format' => '',
'total' => $num_pages,
'current' => $pagenum
));
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<div class="alignleft">
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php wp_nonce_field('bulk-pages'); ?>
@@ -150,7 +170,7 @@ if ($posts) {
</tr>
</thead>
<tbody>
<?php page_rows($posts); ?>
<?php page_rows($posts, $pagenum, $per_page); ?>
</tbody>
</table>
@@ -168,6 +188,10 @@ if ($posts) {
?>
<div class="tablenav">
<?php
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>
@@ -175,7 +199,7 @@ if ($posts) {
if ( 1 == count($posts) && is_singular() ) :
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
if ( $comments ) :
// Make sure comments, post, and post_author are cached
update_comment_cache($comments);

View File

@@ -26,12 +26,12 @@ if ( ! empty($tag_ID) ) {
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th>
<td><input name="name" id="name" type="text" value="<?php echo attribute_escape($tag->name); ?>" size="40" />
<td><input name="name" id="name" type="text" value="<?php echo attribute_escape($tag->name); ?>" size="40" aria-required="true" />
<p><?php _e('The name is how the tag appears on your site.'); ?></p></td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape($tag->slug); ?>" size="40" />
<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
<p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
</tr>
</table>

View File

@@ -133,6 +133,7 @@ endif; ?>
<?php endif; ?>
<p id="post-search">
<label class="hidden" for="post-search-input"><?php _e( 'Search Tags' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Tags' ); ?>" class="button" />
</p>
@@ -172,7 +173,7 @@ if ( $page_links )
<table class="widefat">
<thead>
<tr>
<th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
<th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Name') ?></th>
<th scope="col" class="num" style="width: 90px"><?php _e('Posts') ?></th>
</tr>

View File

@@ -20,8 +20,8 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
}
$sendback = wp_get_referer();
if (strpos($sendback, 'post.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/post-new.php';
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php';
if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php');
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
wp_redirect($sendback);
@@ -116,6 +116,7 @@ endif;
?>
<p id="post-search">
<label class="hidden" for="post-search-input"><?php _e( 'Search Posts' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Posts' ); ?>" class="button" />
</p>
@@ -205,7 +206,7 @@ if ( $page_links )
if ( 1 == count($posts) && is_singular() ) :
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
if ( $comments ) :
// Make sure comments, post, and post_author are cached
update_comment_cache($comments);

View File

@@ -22,9 +22,9 @@ require_once ('admin-header.php');
<table class="form-table">
<tr>
<th><?php _e('Restrict Author'); ?></th>
<th><label for="author"><?php _e('Restrict Author'); ?></label></th>
<td>
<select name="author">
<select name="author" id="author">
<option value="all" selected="selected"><?php _e('All Authors'); ?></option>
<?php
$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );

209
wp-admin/gears-manifest.php Normal file
View File

@@ -0,0 +1,209 @@
<?php
define( 'ABSPATH', dirname(dirname(__FILE__)) );
define( 'WPINC', '/wp-includes' );
function __() {}
function add_filter() {}
function attribute_escape() {}
function apply_filters() {}
function get_option() {}
function is_lighttpd_before_150() {}
function add_action() {}
function do_action_ref_array() {}
function get_bloginfo() {}
function is_admin() {return true;}
function site_url() {}
function admin_url() {}
function wp_guess_url() {}
require(ABSPATH . '/wp-includes/script-loader.php');
require(ABSPATH . '/wp-includes/version.php');
$wp_scripts = new WP_Scripts();
wp_default_scripts($wp_scripts);
$wp_styles = new WP_Styles();
wp_default_styles($wp_styles);
$defaults = $man_version = '';
foreach ( $wp_scripts->registered as $script ) {
if ( empty($script->src) || strpos($script->src, 'tiny_mce_config.php') ) continue;
$ver = empty($script->ver) ? $wp_version : $script->ver;
$src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script->src );
$defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n";
$man_version .= $ver;
}
foreach ( $wp_styles->registered as $style ) {
if ( empty($style->src) ) continue;
$ver = empty($style->ver) ? $wp_version : $style->ver;
$src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->src );
if ( 'colors' == $style->handle ) $src = 'css/colors-classic.css';
$defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n";
if ( isset($style->extra['rtl']) && $style->extra['rtl'] ) {
if ( is_bool( $style->extra['rtl'] ) )
$rtl_href = str_replace( '.css', '-rtl.css', $src );
else
$rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] );
$defaults .= '{ "url" : "' . $rtl_href . '?ver=' . $ver . '" },' . "\n";
}
$man_version .= $ver;
}
$man_version = md5($man_version);
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
header( 'Pragma: no-cache' );
header( 'Content-Type: application/x-javascript; charset=UTF-8' );
?>
{
"betaManifestVersion" : 1,
"version" : "<?php echo $man_version; ?>_20080810",
"entries" : [
<?php echo $defaults; ?>
{ "url" : "images/align-center.png" },
{ "url" : "images/align-left.png" },
{ "url" : "images/align-none.png" },
{ "url" : "images/align-right.png" },
{ "url" : "images/browse-happy.gif" },
{ "url" : "images/bubble_bg.gif" },
{ "url" : "images/comment-grey-bubble.png" },
{ "url" : "images/comment-pill.gif" },
{ "url" : "images/comment-stalk-classic.gif" },
{ "url" : "images/comment-stalk-fresh.gif" },
{ "url" : "images/comment-stalk-rtl.gif" },
{ "url" : "images/date-button.gif" },
{ "url" : "images/fade-butt.png" },
{ "url" : "images/gear.png" },
{ "url" : "images/logo-ghost.png" },
{ "url" : "images/logo-login.gif" },
{ "url" : "images/logo.gif" },
{ "url" : "images/media-button-gallery.gif" },
{ "url" : "images/media-button-image.gif" },
{ "url" : "images/media-button-music.gif" },
{ "url" : "images/media-button-other.gif" },
{ "url" : "images/media-button-video.gif" },
{ "url" : "images/media-buttons.gif" },
{ "url" : "images/tab.png" },
{ "url" : "images/tail.gif" },
{ "url" : "images/toggle-arrow-rtl.gif" },
{ "url" : "images/toggle-arrow.gif" },
{ "url" : "images/wordpress-logo.png" },
{ "url" : "images/xit.gif" },
{ "url" : "images/loading-publish.gif" },
{ "url" : "images/loading.gif" },
{ "url" : "images/required.gif" },
{ "url" : "images/no.png" },
{ "url" : "images/yes.png" },
<?php if ( is_file(ABSPATH.'/wp-includes/js/tinymce/tiny_mce.js') ) { ?>
{ "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/fm.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/sflogo.png" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/tabs.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/progress.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_check.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/flash.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/flv_player.swf" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/quicktime.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/realmedia.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/shockwave.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/windowsmedia.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/trans.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/image.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/media.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/video.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif" },
<?php } ?>
{ "url" : "../wp-includes/images/crystal/archive.png" },
{ "url" : "../wp-includes/images/crystal/audio.png" },
{ "url" : "../wp-includes/images/crystal/code.png" },
{ "url" : "../wp-includes/images/crystal/default.png" },
{ "url" : "../wp-includes/images/crystal/document.png" },
{ "url" : "../wp-includes/images/crystal/interactive.png" },
{ "url" : "../wp-includes/images/crystal/text.png" },
{ "url" : "../wp-includes/images/crystal/video.png" },
{ "url" : "../wp-includes/images/crystal/spreadsheet.png" },
{ "url" : "../wp-includes/images/rss.png" },
{ "url" : "../wp-includes/js/thickbox/loadingAnimation.gif" },
{ "url" : "../wp-includes/js/thickbox/tb-close.png" },
{ "url" : "../wp-includes/js/swfupload/swfupload_f9.swf" }
]}

BIN
wp-admin/images/gear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
wp-admin/images/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
wp-admin/images/logo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
wp-admin/images/no.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 B

BIN
wp-admin/images/tab.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

BIN
wp-admin/images/yes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

View File

@@ -641,7 +641,7 @@ class Blogger_Import {
$host = $this->blogs[$importing_blog]['host'];
// Get an array of posts => authors
$post_ids = (array) $wpdb->get_col("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = '$host'");
$post_ids = (array) $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = %s", $host) );
$post_ids = join( ',', $post_ids );
$results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)");
foreach ( $results as $row )
@@ -658,7 +658,7 @@ class Blogger_Import {
$post_ids = (array) array_keys( $authors_posts, $this->blogs[$importing_blog]['authors'][$author][0] );
$post_ids = join( ',', $post_ids);
$wpdb->query("UPDATE $wpdb->posts SET post_author = $user_id WHERE id IN ($post_ids)");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE id IN ($post_ids)", $user_id) );
$this->blogs[$importing_blog]['authors'][$author][1] = $user_id;
}
$this->save_vars();

View File

@@ -13,7 +13,7 @@ if(!function_exists('get_comment_count'))
function get_comment_count($post_ID)
{
global $wpdb;
return $wpdb->get_var('SELECT count(*) FROM '.$wpdb->comments.' WHERE comment_post_ID = '.$post_ID);
return $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
}
}
@@ -22,7 +22,7 @@ if(!function_exists('link_exists'))
function link_exists($linkname)
{
global $wpdb;
return $wpdb->get_var('SELECT link_id FROM '.$wpdb->links.' WHERE link_name = "'.$linkname.'"');
return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) );
}
}

View File

@@ -38,16 +38,16 @@ class GM_Import {
<h3><?php _e('Second step: GreyMatter details:') ?></h3>
<table class="form-table">
<tr>
<td><?php _e('Path to GM files:') ?></td>
<td><input type="text" style="width:300px" name="gmpath" value="/home/my/site/cgi-bin/greymatter/" /></td>
<td><label for="gmpath"><?php _e('Path to GM files:') ?></label></td>
<td><input type="text" style="width:300px" name="gmpath" id="gmpath" value="/home/my/site/cgi-bin/greymatter/" /></td>
</tr>
<tr>
<td><?php _e('Path to GM entries:') ?></td>
<td><input type="text" style="width:300px" name="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
<td><label for="archivespath"><?php _e('Path to GM entries:') ?></label></td>
<td><input type="text" style="width:300px" name="archivespath" id="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
</tr>
<tr>
<td><?php _e("Last entry's number:") ?></td>
<td><input type="text" name="lastentry" value="00000001" /><br />
<td><label for="lastentry"><?php _e("Last entry's number:") ?></label></td>
<td><input type="text" name="lastentry" id="lastentry" value="00000001" /><br />
<?php _e("This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don't know that number, just log into your FTP and look it out<br />in the entries' folder)") ?></td>
</tr>
</table>

View File

@@ -166,9 +166,9 @@ class MT_Import {
$j = -1;
foreach ($authors as $author) {
++ $j;
echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');
echo '<li><label>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');
$this->users_form($j);
echo '</li>';
echo '</label></li>';
}
echo '<input type="submit" value="'.__('Submit').'">'.'<br />';
@@ -179,7 +179,7 @@ class MT_Import {
function select_authors() {
if ( $_POST['upload_type'] === 'ftp' ) {
$file['file'] = ABSPATH . 'wp-content/mt-export.txt';
$file['file'] = WP_CONTENT_DIR . '/mt-export.txt';
if ( !file_exists($file['file']) )
$file['error'] = __('<code>mt-export.txt</code> does not exist');
} else {
@@ -426,7 +426,7 @@ class MT_Import {
function import() {
$this->id = (int) $_GET['id'];
if ( $this->id == 0 )
$this->file = ABSPATH . 'wp-content/mt-export.txt';
$this->file = WP_CONTENT_DIR . '/mt-export.txt';
else
$this->file = get_attached_file($this->id);
$this->get_authors_from_post();

View File

@@ -8,7 +8,7 @@ if(!function_exists('get_comment_count'))
function get_comment_count($post_ID)
{
global $wpdb;
return $wpdb->get_var('SELECT count(*) FROM '.$wpdb->comments.' WHERE comment_post_ID = '.$post_ID);
return $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
}
}
@@ -17,7 +17,7 @@ if(!function_exists('link_exists'))
function link_exists($linkname)
{
global $wpdb;
return $wpdb->get_var('SELECT link_id FROM '.$wpdb->links.' WHERE link_name = "'.$wpdb->escape($linkname).'"');
return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) );
}
}

View File

@@ -218,7 +218,7 @@ class WP_Import {
function users_form($n, $author) {
if ( $this->allow_create_users() ) {
printf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user_create['.intval($n).']'.'" maxlength="30"> <br />');
printf('<label>'.__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user_create['.intval($n).']'.'" maxlength="30"></label> <br />');
}
else {
echo __('Map to existing').'<br />';
@@ -357,6 +357,11 @@ class WP_Import {
$guid = $this->get_tag( $post, 'guid' );
$post_author = $this->get_tag( $post, 'dc:creator' );
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
$post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
$post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
$post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
$post_content = $this->get_tag( $post, 'content:encoded' );
$post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
$post_content = str_replace('<br>', '<br />', $post_content);
@@ -404,7 +409,7 @@ class WP_Import {
$post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
if ($post_type == 'attachment') {
$remote_url = $this->get_tag( $post, 'wp:attachment_url' );
if ( !$remote_url )

View File

@@ -3,50 +3,71 @@
class WP_Categories_to_Tags {
var $categories_to_convert = array();
var $all_categories = array();
var $tags_to_convert = array();
var $all_tags = array();
var $hybrids_ids = array();
function header() {
echo '<div class="wrap">';
echo '<h2>' . __('Convert Categories to Tags') . '</h2>';
if ( ! current_user_can('manage_categories') ) {
echo '<div class="narrow">';
echo '<p>' . __('Cheatin&#8217; uh?') . '</p>';
echo '</div>';
} else { ?>
<div class="tablenav"><p style="margin:4px"><a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag"><?php _e( "Categories to Tags" ); ?></a>
<a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag&amp;step=3"><?php _e( "Tags to Categories" ); ?></a></p></div>
<?php }
}
function footer() {
echo '</div>';
}
function populate_all_categories() {
global $wpdb;
function populate_cats() {
$categories = get_categories('get=all');
foreach ( $categories as $category ) {
if ( !tag_exists($wpdb->escape($category->name)) )
$this->all_categories[] = $category;
$this->all_categories[] = $category;
if ( is_term( $category->slug, 'post_tag' ) )
$this->hybrids_ids[] = $category->term_id;
}
}
function welcome() {
$this->populate_all_categories();
function populate_tags() {
echo '<div class="narrow">';
$tags = get_terms( array('post_tag'), 'get=all' );
foreach ( $tags as $tag ) {
$this->all_tags[] = $tag;
if ( is_term( $tag->slug, 'category' ) )
$this->hybrids_ids[] = $tag->term_id;
}
}
if (count($this->all_categories) > 0) {
echo '<p>' . __('Hey there. Here you can selectively converts existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>';
echo '<p>' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '</p>';
function categories_tab() {
$this->populate_cats();
$cat_num = count($this->all_categories);
echo '<br class="clear" />';
if ( $cat_num > 0 ) {
echo '<h2>' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '</h2>';
echo '<div class="narrow">';
echo '<p>' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>';
echo '<p>' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '</p></div>';
$this->categories_form();
} else {
echo '<p>'.__('You have no categories to convert!').'</p>';
}
echo '</div>';
}
function categories_form() {
?>
function categories_form() { ?>
<script type="text/javascript">
<!--
/* <![CDATA[ */
var checkflag = "false";
function check_all_rows() {
field = document.formlist;
field = document.catlist;
if ( 'false' == checkflag ) {
for ( i = 0; i < field.length; i++ ) {
if ( 'cats_to_convert[]' == field[i].name )
@@ -63,54 +84,117 @@ function check_all_rows() {
return '<?php _e('Check All') ?>';
}
}
// -->
/* ]]> */
</script>
<?php
echo '<form name="formlist" id="formlist" action="admin.php?import=wp-cat2tag&amp;step=2" method="post">
<p><input type="button" class="button-secondary" value="' . __('Check All') . '"' . ' onClick="this.value=check_all_rows()"></p>';
wp_nonce_field('import-cat2tag');
echo '<ul style="list-style:none">';
$hier = _get_term_hierarchy('category');
<form name="catlist" id="catlist" action="admin.php?import=wp-cat2tag&amp;step=2" method="post">
<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_rows()" />
<?php wp_nonce_field('import-cat2tag'); ?></p>
<ul style="list-style:none">
<?php $hier = _get_term_hierarchy('category');
foreach ($this->all_categories as $category) {
$category = sanitize_term( $category, 'category', 'display' );
if ((int) $category->parent == 0) {
echo '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>';
if ( (int) $category->parent == 0 ) { ?>
if (isset($hier[$category->term_id])) {
$this->_category_children($category, $hier);
}
<li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($category->term_id); ?>" /> <?php echo $category->name . ' (' . $category->count . ')'; ?></label><?php
echo '</li>';
}
if ( in_array( intval($category->term_id), $this->hybrids_ids ) )
echo ' <a href="#note"> * </a>';
if ( isset($hier[$category->term_id]) )
$this->_category_children($category, $hier); ?></li>
<?php }
} ?>
</ul>
<?php if ( ! empty($this->hybrids_ids) )
echo '<p><a name="note"></a>' . __('* This category is also a tag. Converting it will add that tag to all posts that are currently in the category.') . '</p>'; ?>
<p class="submit"><input type="submit" name="submit" class="button" value="<?php _e('Convert Categories to Tags'); ?>" /></p>
</form>
<?php }
function tags_tab() {
$this->populate_tags();
$tags_num = count($this->all_tags);
echo '<br class="clear" />';
if ( $tags_num > 0 ) {
echo '<h2>' . sprintf( __ngettext( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '</h2>';
echo '<div class="narrow">';
echo '<p>' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '</p>';
echo '<p>' . __('The newly created categories will still be associated with the same posts.') . '</p></div>';
$this->tags_form();
} else {
echo '<p>'.__('You have no tags to convert!').'</p>';
}
echo '</ul>';
echo '<p class="submit"><input type="submit" name="submit" class="button" value="' . __('Convert Tags') . '" /></p>';
echo '</form>';
}
function _category_children($parent, $hier) {
echo '<ul style="list-style:none">';
function tags_form() { ?>
foreach ($hier[$parent->term_id] as $child_id) {
$child =& get_category($child_id);
echo '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($child->term_id) . '" /> ' . $child->name . ' (' . $child->count . ')</label>';
if (isset($hier[$child->term_id])) {
$this->_category_children($child, $hier);
}
echo '</li>';
<script type="text/javascript">
/* <![CDATA[ */
var checktags = "false";
function check_all_tagrows() {
field = document.taglist;
if ( 'false' == checktags ) {
for ( i = 0; i < field.length; i++ ) {
if ( 'tags_to_convert[]' == field[i].name )
field[i].checked = true;
}
checktags = 'true';
return '<?php _e('Uncheck All') ?>';
} else {
for ( i = 0; i < field.length; i++ ) {
if ( 'tags_to_convert[]' == field[i].name )
field[i].checked = false;
}
checktags = 'false';
return '<?php _e('Check All') ?>';
}
}
/* ]]> */
</script>
echo '</ul>';
<form name="taglist" id="taglist" action="admin.php?import=wp-cat2tag&amp;step=4" method="post">
<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_tagrows()" />
<?php wp_nonce_field('import-cat2tag'); ?></p>
<ul style="list-style:none">
<?php foreach ( $this->all_tags as $tag ) { ?>
<li><label><input type="checkbox" name="tags_to_convert[]" value="<?php echo intval($tag->term_id); ?>" /> <?php echo attribute_escape($tag->name) . ' (' . $tag->count . ')'; ?></label><?php if ( in_array( intval($tag->term_id), $this->hybrids_ids ) ) echo ' <a href="#note"> * </a>'; ?></li>
<?php } ?>
</ul>
<?php if ( ! empty($this->hybrids_ids) )
echo '<p><a name="note"></a>' . __('* This tag is also a category. When converted, all posts associated with the tag will also be in the category.') . '</p>'; ?>
<p class="submit"><input type="submit" name="submit_tags" class="button" value="<?php _e('Convert Tags to Categories'); ?>" /></p>
</form>
<?php }
function _category_children($parent, $hier) { ?>
<ul style="list-style:none">
<?php foreach ($hier[$parent->term_id] as $child_id) {
$child =& get_category($child_id); ?>
<li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($child->term_id); ?>" /> <?php echo $child->name . ' (' . $child->count . ')'; ?></label><?php
if ( in_array( intval($child->term_id), $this->hybrids_ids ) )
echo ' <a href="#note"> * </a>';
if ( isset($hier[$child->term_id]) )
$this->_category_children($child, $hier); ?></li>
<?php } ?>
</ul><?php
}
function _category_exists($cat_id) {
@@ -125,101 +209,238 @@ function check_all_rows() {
}
}
function convert_them() {
function convert_categories() {
global $wpdb;
if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) {
echo '<div class="narrow">';
echo '<p>' . sprintf(__('Uh, oh. Something didn&#8217;t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag') . '</p>';
echo '</div>';
return;
if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) { ?>
<div class="narrow">
<p><?php printf(__('Uh, oh. Something didn&#8217;t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag'); ?></p>
</div>
<?php return;
}
if ( empty($this->categories_to_convert) )
$this->categories_to_convert = $_POST['cats_to_convert'];
$hier = _get_term_hierarchy('category');
$hybrid_cats = $clear_parents = $parents = false;
$clean_term_cache = $clean_cat_cache = array();
$default_cat = get_option('default_category');
echo '<ul>';
foreach ( (array) $this->categories_to_convert as $cat_id) {
$cat_id = (int) $cat_id;
echo '<li>' . sprintf(__('Converting category #%s ... '), $cat_id);
if (!$this->_category_exists($cat_id)) {
_e('Category doesn\'t exist!');
if ( ! $this->_category_exists($cat_id) ) {
echo '<li>' . sprintf( __('Category %s doesn\'t exist!'), $cat_id ) . "</li>\n";
} else {
$category =& get_category($cat_id);
echo '<li>' . sprintf(__('Converting category <strong>%s</strong> ... '), $category->name);
// If the category is the default, leave category in place and create tag.
if ( $default_cat == $category->term_id ) {
if ( ! ($id = is_term( $category->slug, 'post_tag' ) ) )
$id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug));
$id = $id['term_taxonomy_id'];
$posts = get_objects_in_term($category->term_id, 'category');
$term_order = 0;
foreach ( $posts as $post ) {
$values[] = $wpdb->prepare( "(%d, %d, %d)", $post, $id, $term_order);
clean_post_cache($post);
}
if ( $values ) {
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $category->count, $category->term_id) );
}
echo __('Converted successfully.') . "</li>\n";
continue;
}
// if tag already exists, add it to all posts in the category
if ( $tag_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $category->term_id) ) ) {
$objects_ids = get_objects_in_term($category->term_id, 'category');
$tag_ttid = (int) $tag_ttid;
$term_order = 0;
foreach ( $objects_ids as $object_id )
$values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tag_ttid, $term_order);
if ( $values ) {
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)");
$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag_ttid) );
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $count, $category->term_id) );
}
echo __('Tag added to all posts in this category.') . " *</li>\n";
$hybrid_cats = true;
$clean_term_cache[] = $category->term_id;
$clean_cat_cache[] = $category->term_id;
if ( tag_exists($wpdb->escape($category->name)) ) {
_e('Category is already a tag.');
echo '</li>';
continue;
}
// If the category is the default, leave category in place and create tag.
if ( get_option('default_category') == $category->term_id ) {
$id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug));
$id = $id['term_taxonomy_id'];
$posts = get_objects_in_term($category->term_id, 'category');
foreach ( $posts as $post ) {
if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") )
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post', '$id')");
$tt_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) );
if ( $tt_ids ) {
$posts = $wpdb->get_col("SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . join(',', $tt_ids) . ") GROUP BY object_id");
foreach ( (array) $posts as $post )
clean_post_cache($post);
}
} else {
$tt_ids = $wpdb->get_col("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
if ( $tt_ids ) {
$posts = $wpdb->get_col("SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . join(',', $tt_ids) . ") GROUP BY object_id");
foreach ( (array) $posts as $post )
clean_post_cache($post);
}
// Change the category to a tag.
$wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
$terms = $wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE parent = '{$category->term_id}' AND taxonomy = 'category'");
foreach ( (array) $terms as $term )
clean_category_cache($term);
// Set all parents to 0 (root-level) if their parent was the converted tag
$wpdb->query("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = '{$category->term_id}' AND taxonomy = 'category'");
}
// Clean the cache
clean_category_cache($category->term_id);
_e('Converted successfully.');
// Change the category to a tag.
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) );
// Set all parents to 0 (root-level) if their parent was the converted tag
$parents = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = %d AND taxonomy = 'category'", $category->term_id) );
if ( $parents ) $clear_parents = true;
$clean_cat_cache[] = $category->term_id;
echo __('Converted successfully.') . "</li>\n";
}
}
echo '</ul>';
echo '</li>';
if ( ! empty($clean_term_cache) ) {
$clean_term_cache = array_unique(array_values($clean_term_cache));
foreach ( $clean_term_cache as $id )
wp_cache_delete($id, 'post_tag');
}
echo '</ul>';
if ( ! empty($clean_cat_cache) ) {
$clean_cat_cache = array_unique(array_values($clean_cat_cache));
foreach ( $clean_cat_cache as $id )
wp_cache_delete($id, 'category');
}
if ( $clear_parents ) delete_option('category_children');
if ( $hybrid_cats )
echo '<p>' . sprintf( __('* This category is also a tag. The converter has added that tag to all posts currently in the category. If you want to remove it, please confirm that all tags were added successfully, then delete it from the <a href="%s">Manage Categories</a> page.'), 'categories.php') . '</p>';
echo '<p>' . sprintf( __('We&#8217;re all done here, but you can always <a href="%s">convert more</a>.'), 'admin.php?import=wp-cat2tag' ) . '</p>';
}
function convert_tags() {
global $wpdb;
if ( (!isset($_POST['tags_to_convert']) || !is_array($_POST['tags_to_convert'])) && empty($this->tags_to_convert)) {
echo '<div class="narrow">';
echo '<p>' . sprintf(__('Uh, oh. Something didn&#8217;t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag&amp;step=3') . '</p>';
echo '</div>';
return;
}
if ( empty($this->tags_to_convert) )
$this->tags_to_convert = $_POST['tags_to_convert'];
$hybrid_tags = $clear_parents = false;
$clean_cat_cache = $clean_term_cache = array();
$default_cat = get_option('default_category');
echo '<ul>';
foreach ( (array) $this->tags_to_convert as $tag_id) {
$tag_id = (int) $tag_id;
if ( $tag = get_term( $tag_id, 'post_tag' ) ) {
printf('<li>' . __('Converting tag <strong>%s</strong> ... '), $tag->name);
if ( $cat_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $tag->term_id) ) ) {
$objects_ids = get_objects_in_term($tag->term_id, 'post_tag');
$cat_ttid = (int) $cat_ttid;
$term_order = 0;
foreach ( $objects_ids as $object_id ) {
$values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $cat_ttid, $term_order);
clean_post_cache($object_id);
}
if ( $values ) {
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)");
if ( $default_cat != $tag->term_id ) {
$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag->term_id) );
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'category'", $count, $tag->term_id) );
}
}
$hybrid_tags = true;
$clean_term_cache[] = $tag->term_id;
$clean_cat_cache[] = $tag->term_id;
echo __('All posts were added to the category with the same name.') . " *</li>\n";
continue;
}
// Change the tag to a category.
$parent = $wpdb->get_var( $wpdb->prepare("SELECT parent FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $tag->term_id) );
if ( 0 == $parent || (0 < (int) $parent && $this->_category_exists($parent)) ) {
$reset_parent = '';
$clear_parents = true;
} else
$reset_parent = ", parent = '0'";
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'category' $reset_parent WHERE term_id = %d AND taxonomy = 'post_tag'", $tag->term_id) );
$clean_term_cache[] = $tag->term_id;
$clean_cat_cache[] = $cat['term_id'];
echo __('Converted successfully.') . "</li>\n";
} else {
printf( '<li>' . __('Tag #%s doesn\'t exist!') . "</li>\n", $tag_id );
}
}
if ( ! empty($clean_term_cache) ) {
$clean_term_cache = array_unique(array_values($clean_term_cache));
foreach ( $clean_term_cache as $id )
wp_cache_delete($id, 'post_tag');
}
if ( ! empty($clean_cat_cache) ) {
$clean_cat_cache = array_unique(array_values($clean_cat_cache));
foreach ( $clean_cat_cache as $id )
wp_cache_delete($id, 'category');
}
if ( $clear_parents ) delete_option('category_children');
echo '</ul>';
if ( $hybrid_tags )
echo '<p>' . sprintf( __('* This tag is also a category. The converter has added all posts from it to the category. If you want to remove it, please confirm that all posts were added successfully, then delete it from the <a href="%s">Manage Tags</a> page.'), 'edit-tags.php') . '</p>';
echo '<p>' . sprintf( __('We&#8217;re all done here, but you can always <a href="%s">convert more</a>.'), 'admin.php?import=wp-cat2tag&amp;step=3' ) . '</p>';
}
function init() {
$step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
$this->header();
if (!current_user_can('manage_categories')) {
echo '<div class="narrow">';
echo '<p>' . __('Cheatin&#8217; uh?') . '</p>';
echo '</div>';
} else {
if ( $step > 1 )
check_admin_referer('import-cat2tag');
if ( current_user_can('manage_categories') ) {
switch ($step) {
case 1 :
$this->welcome();
$this->categories_tab();
break;
case 2 :
$this->convert_them();
check_admin_referer('import-cat2tag');
$this->convert_categories();
break;
case 3 :
$this->tags_tab();
break;
case 4 :
check_admin_referer('import-cat2tag');
$this->convert_tags();
break;
}
}
@@ -234,6 +455,6 @@ function check_all_rows() {
$wp_cat2tag_importer = new WP_Categories_to_Tags();
register_importer('wp-cat2tag', __('Categories to Tags Converter'), __('Convert existing categories to tags, selectively.'), array(&$wp_cat2tag_importer, 'init'));
register_importer('wp-cat2tag', __('Categories and Tags Converter'), __('Convert existing categories to tags or tags to categories, selectively.'), array(&$wp_cat2tag_importer, 'init'));
?>
?>

View File

@@ -47,7 +47,7 @@ function wp_delete_link($link_id) {
wp_delete_object_term_relationships($link_id, 'link_category');
$wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_id = %d", $link_id) );
do_action('deleted_link', $link_id);
@@ -73,7 +73,7 @@ function wp_insert_link($linkdata) {
$linkdata = wp_parse_args($linkdata, $defaults);
$linkdata = sanitize_bookmark($linkdata, 'db');
extract($linkdata, EXTR_SKIP);
extract(stripslashes_deep($linkdata), EXTR_SKIP);
$update = false;
@@ -119,15 +119,14 @@ function wp_insert_link($linkdata) {
}
if ( $update ) {
$wpdb->query("UPDATE $wpdb->links SET link_url='$link_url',
link_name='$link_name', link_image='$link_image',
link_target='$link_target',
link_visible='$link_visible', link_description='$link_description',
link_rating='$link_rating', link_rel='$link_rel',
link_notes='$link_notes', link_rss = '$link_rss'
WHERE link_id='$link_id'");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_url = %s,
link_name = %s, link_image = %s, link_target = %s,
link_visible = %s, link_description = %s, link_rating = %s,
link_rel = %s, link_notes = %s, link_rss = %s
WHERE link_id = %s", $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id) );
} else {
$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
$link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss) );
$link_id = (int) $wpdb->insert_id;
}

View File

@@ -0,0 +1,158 @@
<?php
class WP_Filesystem_Base{
var $verbose = false;
var $cache = array();
var $method = '';
function abspath() {
if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false )
return FTP_BASE;
return $this->find_folder(ABSPATH);
}
function wp_content_dir() {
if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false )
return FTP_CONTENT_DIR;
return $this->find_folder(WP_CONTENT_DIR);
}
function wp_plugins_dir() {
if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false )
return FTP_PLUGIN_DIR;
return $this->find_folder(WP_PLUGIN_DIR);
}
function wp_themes_dir() {
return $this->wp_content_dir() . '/themes';
}
//Back compat: use abspath() or wp_*_dir
function find_base_dir($base = '.', $echo = false) {
$this->verbose = $echo;
return $this->abspath();
}
//Back compat: use ::abspath() or ::wp_*_dir
function get_base_dir($base = '.', $echo = false) {
$this->verbose = $echo;
return $this->abspath();
}
function find_folder($folder) {
$folder = str_replace('\\', '/', $folder); //Windows Sanitiation
if ( isset($this->cache[ $folder ] ) )
return $this->cache[ $folder ];
if ( $this->exists($folder) ) { //Folder exists at that absolute path.
$this->cache[ $folder ] = $folder;
return $folder;
}
if( $return = $this->search_for_folder($folder) )
$this->cache[ $folder ] = $return;
return $return;
}
// Assumes $folder is windows sanitized;
// Assumes that the drive letter is safe to be stripped off, Should not be a problem for windows servers.
function search_for_folder($folder, $base = '.', $loop = false ) {
if ( empty( $base ) || '.' == $base )
$base = trailingslashit($this->cwd());
$folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there.
$folder_parts = explode('/', $folder);
$last_path = $folder_parts[ count($folder_parts) - 1 ];
$files = $this->dirlist( $base );
foreach ( $folder_parts as $key ) {
if ( $key == $last_path )
continue; //We want this to be caught by the next code block.
//Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
// If its found, change into it and follow through looking for it.
// If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
// If it reaches the end, and still cant find it, it'll return false for the entire function.
if( isset($files[ $key ]) ){
//Lets try that folder:
$newdir = trailingslashit(path_join($base, $key));
if( $this->verbose )
printf( __('Changing to %s') . '<br/>', $newdir );
if( $ret = $this->search_for_folder( $folder, $newdir, $loop) )
return $ret;
}
}
//Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
if(isset( $files[ $last_path ] ) ) {
if( $this->verbose )
printf( __('Found %s') . '<br/>', $base . $last_path );
return $base . $last_path;
}
if( $loop )
return false;//Prevent tihs function looping again.
//As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
return $this->search_for_folder($folder, '/', true);
}
//Common Helper functions.
function gethchmod($file){
//From the PHP.net page for ...?
$perms = $this->getchmod($file);
if (($perms & 0xC000) == 0xC000) // Socket
$info = 's';
elseif (($perms & 0xA000) == 0xA000) // Symbolic Link
$info = 'l';
elseif (($perms & 0x8000) == 0x8000) // Regular
$info = '-';
elseif (($perms & 0x6000) == 0x6000) // Block special
$info = 'b';
elseif (($perms & 0x4000) == 0x4000) // Directory
$info = 'd';
elseif (($perms & 0x2000) == 0x2000) // Character special
$info = 'c';
elseif (($perms & 0x1000) == 0x1000)// FIFO pipe
$info = 'p';
else // Unknown
$info = 'u';
// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));
// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));
// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));
return $info;
}
function getnumchmodfromh($mode) {
$realmode = "";
$legal = array("", "w", "r", "x", "-");
$attarray = preg_split("//", $mode);
for($i=0; $i < count($attarray); $i++)
if($key = array_search($attarray[$i], $legal))
$realmode .= $legal[$key];
$mode = str_pad($realmode, 9, '-');
$trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1');
$mode = strtr($mode,$trans);
$newmode = '';
$newmode .= $mode[0] + $mode[1] + $mode[2];
$newmode .= $mode[3] + $mode[4] + $mode[5];
$newmode .= $mode[6] + $mode[7] + $mode[8];
return $newmode;
}
}
?>

View File

@@ -1,51 +1,46 @@
<?php
class WP_Filesystem_Direct{
class WP_Filesystem_Direct extends WP_Filesystem_Base {
var $permission = null;
var $errors = array();
function WP_Filesystem_Direct($arg){
function WP_Filesystem_Direct($arg) {
$this->method = 'direct';
$this->errors = new WP_Error();
$this->permission = umask();
}
function connect(){
function connect() {
return true;
}
function setDefaultPermissions($perm){
function setDefaultPermissions($perm) {
$this->permission = $perm;
}
function find_base_dir($base = '.', $echo = false){
return str_replace('\\','/',ABSPATH);
}
function get_base_dir($base = '.', $echo = false){
return $this->find_base_dir($base, $echo);
}
function get_contents($file){
function get_contents($file) {
return @file_get_contents($file);
}
function get_contents_array($file){
function get_contents_array($file) {
return @file($file);
}
function put_contents($file,$contents,$mode=false,$type=''){
if ( ! ($fp = @fopen($file,'w'.$type)) )
function put_contents($file, $contents, $mode = false, $type = '') {
if ( ! ($fp = @fopen($file, 'w' . $type)) )
return false;
@fwrite($fp,$contents);
@fwrite($fp, $contents);
@fclose($fp);
$this->chmod($file,$mode);
return true;
}
function cwd(){
function cwd() {
return @getcwd();
}
function chdir($dir){
function chdir($dir) {
return @chdir($dir);
}
function chgrp($file,$group,$recursive=false){
function chgrp($file, $group, $recursive = false) {
if( ! $this->exists($file) )
return false;
if( ! $recursive )
return @chgrp($file,$group);
return @chgrp($file, $group);
if( ! $this->is_dir($file) )
return @chgrp($file,$group);
return @chgrp($file, $group);
//Is a directory, and we want recursive
$file = trailingslashit($file);
$filelist = $this->dirlist($file);
@@ -54,7 +49,7 @@ class WP_Filesystem_Direct{
return true;
}
function chmod($file,$mode=false,$recursive=false){
function chmod($file, $mode = false, $recursive = false) {
if( ! $mode )
$mode = $this->permission;
if( ! $this->exists($file) )
@@ -62,7 +57,7 @@ class WP_Filesystem_Direct{
if( ! $recursive )
return @chmod($file,$mode);
if( ! $this->is_dir($file) )
return @chmod($file,$mode);
return @chmod($file, $mode);
//Is a directory, and we want recursive
$file = trailingslashit($file);
$filelist = $this->dirlist($file);
@@ -71,120 +66,51 @@ class WP_Filesystem_Direct{
return true;
}
function chown($file,$owner,$recursive=false){
function chown($file, $owner, $recursive = false) {
if( ! $this->exists($file) )
return false;
if( ! $recursive )
return @chown($file,$owner);
return @chown($file, $owner);
if( ! $this->is_dir($file) )
return @chown($file,$owner);
return @chown($file, $owner);
//Is a directory, and we want recursive
$filelist = $this->dirlist($file);
foreach($filelist as $filename){
$this->chown($file.'/'.$filename,$owner,$recursive);
$this->chown($file . '/' . $filename, $owner, $recursive);
}
return true;
}
function owner($file){
function owner($file) {
$owneruid = @fileowner($file);
if( ! $owneruid )
return false;
if( !function_exists('posix_getpwuid') )
if( ! function_exists('posix_getpwuid') )
return $owneruid;
$ownerarray = posix_getpwuid($owneruid);
return $ownerarray['name'];
}
function getchmod($file){
function getchmod($file) {
return @fileperms($file);
}
function gethchmod($file){
//From the PHP.net page for ...?
$perms = $this->getchmod($file);
if (($perms & 0xC000) == 0xC000) {
// Socket
$info = 's';
} elseif (($perms & 0xA000) == 0xA000) {
// Symbolic Link
$info = 'l';
} elseif (($perms & 0x8000) == 0x8000) {
// Regular
$info = '-';
} elseif (($perms & 0x6000) == 0x6000) {
// Block special
$info = 'b';
} elseif (($perms & 0x4000) == 0x4000) {
// Directory
$info = 'd';
} elseif (($perms & 0x2000) == 0x2000) {
// Character special
$info = 'c';
} elseif (($perms & 0x1000) == 0x1000) {
// FIFO pipe
$info = 'p';
} else {
// Unknown
$info = 'u';
}
// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));
// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));
// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));
return $info;
}
function getnumchmodfromh($mode) {
$realmode = "";
$legal = array("","w","r","x","-");
$attarray = preg_split("//",$mode);
for($i=0;$i<count($attarray);$i++){
if($key = array_search($attarray[$i],$legal)){
$realmode .= $legal[$key];
}
}
$mode = str_pad($realmode,9,'-');
$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');
$mode = strtr($mode,$trans);
$newmode = '';
$newmode .= $mode[0]+$mode[1]+$mode[2];
$newmode .= $mode[3]+$mode[4]+$mode[5];
$newmode .= $mode[6]+$mode[7]+$mode[8];
return $newmode;
}
function group($file){
function group($file) {
$gid = @filegroup($file);
if( ! $gid )
return false;
if( !function_exists('posix_getgrgid') )
if( ! function_exists('posix_getgrgid') )
return $gid;
$grouparray = posix_getgrgid($gid);
return $grouparray['name'];
}
function copy($source,$destination,$overwrite=false){
function copy($source, $destination, $overwrite = false) {
if( ! $overwrite && $this->exists($destination) )
return false;
return copy($source,$destination);
return copy($source, $destination);
}
function move($source,$destination,$overwrite=false){
function move($source, $destination, $overwrite = false) {
//Possible to use rename()?
if( $this->copy($source,$destination,$overwrite) && $this->exists($destination) ){
if( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ){
$this->delete($source);
return true;
} else {
@@ -192,12 +118,12 @@ class WP_Filesystem_Direct{
}
}
function delete($file, $recursive=false){
$file = str_replace('\\','/',$file); //for win32, occasional problems deleteing files otherwise
function delete($file, $recursive = false) {
$file = str_replace('\\', '/', $file); //for win32, occasional problems deleteing files otherwise
if( $this->is_file($file) )
return @unlink($file);
if( !$recursive && $this->is_dir($file) )
if( ! $recursive && $this->is_dir($file) )
return @rmdir($file);
//At this point its a folder, and we're in recursive mode
@@ -206,7 +132,7 @@ class WP_Filesystem_Direct{
$retval = true;
if( is_array($filelist) ) //false if no files, So check first.
foreach($filelist as $filename=>$fileinfo)
foreach($filelist as $filename => $fileinfo)
if( ! $this->delete($file . $filename, $recursive) )
$retval = false;
@@ -215,34 +141,34 @@ class WP_Filesystem_Direct{
return $retval;
}
function exists($file){
function exists($file) {
return @file_exists($file);
}
function is_file($file){
function is_file($file) {
return @is_file($file);
}
function is_dir($path){
function is_dir($path) {
return @is_dir($path);
}
function is_readable($file){
function is_readable($file) {
return @is_readable($file);
}
function is_writable($file){
function is_writable($file) {
return @is_writable($file);
}
function atime($file){
function atime($file) {
return @fileatime($file);
}
function mtime($file){
function mtime($file) {
return @filemtime($file);
}
function size($file){
function size($file) {
return @filesize($file);
}
@@ -251,38 +177,38 @@ class WP_Filesystem_Direct{
$time = time();
if($atime == 0)
$atime = time();
return @touch($file,$time,$atime);
return @touch($file, $time, $atime);
}
function mkdir($path, $chmod = false, $chown = false, $chgrp = false){
if( ! $chmod)
$chmod = $this->permission;
if( !@mkdir($path,$chmod) )
if( ! @mkdir($path, $chmod) )
return false;
if( $chown )
$this->chown($path,$chown);
$this->chown($path, $chown);
if( $chgrp )
$this->chgrp($path,$chgrp);
$this->chgrp($path, $chgrp);
return true;
}
function rmdir($path,$recursive=false){
function rmdir($path, $recursive = false) {
//Currently unused and untested, Use delete() instead.
if( ! $recursive )
return @rmdir($path);
//recursive:
$filelist = $this->dirlist($path);
foreach($filelist as $filename=>$det){
if ( '/' == substr($filename,-1,1) )
$this->rmdir($path.'/'.$filename,$recursive);
foreach($filelist as $filename => $det) {
if ( '/' == substr($filename, -1, 1) )
$this->rmdir($path . '/' . $filename, $recursive);
@rmdir($filename);
}
return @rmdir($path);
}
function dirlist($path,$incdot=false,$recursive=false){
if( $this->is_file($path) ){
function dirlist($path, $incdot = false, $recursive = false) {
if( $this->is_file($path) ) {
$limitFile = basename($path);
$path = dirname($path);
} else {
@@ -293,9 +219,9 @@ class WP_Filesystem_Direct{
$ret = array();
$dir = dir($path);
while (false !== ($entry = $dir->read())) {
while (false !== ($entry = $dir->read()) ) {
$struc = array();
$struc['name'] = $entry;
$struc['name'] = $entry;
if( '.' == $struc['name'] || '..' == $struc['name'] )
continue; //Do not care about these folders.
@@ -315,9 +241,9 @@ class WP_Filesystem_Direct{
$struc['time'] = date('h:i:s',$struc['lastmodunix']);
$struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd' : 'f';
if ('d' == $struc['type'] ){
if ( 'd' == $struc['type'] ) {
if( $recursive )
$struc['files'] = $this->dirlist($path.'/'.$struc['name'], $incdot, $recursive);
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
else
$struc['files'] = array();
}
@@ -328,9 +254,5 @@ class WP_Filesystem_Direct{
unset($dir);
return $ret;
}
function __destruct(){
return;
}
}
?>

View File

@@ -1,11 +1,10 @@
<?php
class WP_Filesystem_FTPext{
class WP_Filesystem_FTPext extends WP_Filesystem_Base{
var $link;
var $timeout = 5;
var $errors = array();
var $options = array();
var $wp_base = '';
var $permission = null;
var $filetypes = array(
@@ -24,6 +23,7 @@ class WP_Filesystem_FTPext{
);
function WP_Filesystem_FTPext($opt='') {
$this->method = 'ftpext';
$this->errors = new WP_Error();
//Check if possible to use ftp functions.
@@ -60,12 +60,11 @@ class WP_Filesystem_FTPext{
$this->options['ssl'] = ( !empty($opt['ssl']) );
}
function connect(){
if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') ) {
function connect() {
if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') )
$this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'],$this->timeout);
} else {
else
$this->link = @ftp_connect($this->options['hostname'], $this->options['port'],$this->timeout);
}
if ( ! $this->link ) {
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
@@ -80,76 +79,11 @@ class WP_Filesystem_FTPext{
return true;
}
function setDefaultPermissions($perm){
function setDefaultPermissions($perm) {
$this->permission = $perm;
}
function find_base_dir($base = '.',$echo = false, $loop = false) {
//Sanitize the Windows path formats, This allows easier conparison and aligns it to FTP output.
$abspath = str_replace('\\','/',ABSPATH); //windows: Straighten up the paths..
if( strpos($abspath, ':') ){ //Windows, Strip out the driveletter
if( preg_match("|.{1}\:(.+)|i", $abspath, $mat) )
$abspath = $mat[1];
}
//Set up the base directory (Which unless specified, is the current one)
if( empty( $base ) || '.' == $base ) $base = $this->cwd();
$base = trailingslashit($base);
//Can we see the Current directory as part of the ABSPATH?
$location = strpos($abspath, $base);
if( false !== $location ) {
$newbase = path_join($base, substr($abspath, $location + strlen($base)));
if( false !== $this->chdir($newbase) ){ //chdir sometimes returns null under certain circumstances, even when its changed correctly, FALSE will be returned if it doesnt change correctly.
if($echo) printf( __('Changing to %s') . '<br/>', $newbase );
//Check to see if it exists in that folder.
if( $this->exists($newbase . 'wp-settings.php') ){
if($echo) printf( __('Found %s'), $newbase . 'wp-settings.php<br/>' );
return $newbase;
}
}
}
//Ok, Couldnt do a magic location from that particular folder level
//Get a list of the files in the current directory, See if we can locate where we are in the folder stucture.
$files = $this->dirlist($base);
$arrPath = explode('/', $abspath);
foreach($arrPath as $key){
//Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
// If its found, change into it and follow through looking for it.
// If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
// If it reaches the end, and still cant find it, it'll return false for the entire function.
if( isset($files[ $key ]) ){
//Lets try that folder:
$folder = path_join($base, $key);
if($echo) printf( __('Changing to %s') . '<br/>', $folder );
$ret = $this->find_base_dir( $folder, $echo, $loop);
if( $ret )
return $ret;
}
}
//Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
if(isset( $files[ 'wp-settings.php' ]) ){
if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' );
return $base;
}
if( $loop )
return false;//Prevent tihs function looping again.
//As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
return $this->find_base_dir('/', $echo, true);
}
function get_base_dir($base = '.', $echo = false){
if( defined('FTP_BASE') )
$this->wp_base = FTP_BASE;
if( empty($this->wp_base) )
$this->wp_base = $this->find_base_dir($base,$echo);
return $this->wp_base;
}
function get_contents($file,$type='',$resumepos=0){
function get_contents($file, $type = '', $resumepos = 0 ){
if( empty($type) ){
$extension = substr(strrchr($file, "."), 1);
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
@@ -157,7 +91,7 @@ class WP_Filesystem_FTPext{
$temp = tmpfile();
if ( ! $temp )
return false;
if( ! @ftp_fget($this->link,$temp,$file,$type,$resumepos) )
if( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) )
return false;
fseek($temp, 0); //Skip back to the start of the file being written to
$contents = '';
@@ -167,202 +101,132 @@ class WP_Filesystem_FTPext{
fclose($temp);
return $contents;
}
function get_contents_array($file){
return explode("\n",$this->get_contents($file));
function get_contents_array($file) {
return explode("\n", $this->get_contents($file));
}
function put_contents($file,$contents,$type=''){
if( empty($type) ){
function put_contents($file, $contents, $type = '' ) {
if( empty($type) ) {
$extension = substr(strrchr($file, "."), 1);
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
}
$temp = tmpfile();
if ( ! $temp )
return false;
fwrite($temp,$contents);
fwrite($temp, $contents);
fseek($temp, 0); //Skip back to the start of the file being written to
$ret = @ftp_fput($this->link,$file,$temp,$type);
$ret = @ftp_fput($this->link, $file, $temp, $type);
fclose($temp);
return $ret;
}
function cwd(){
function cwd() {
$cwd = ftp_pwd($this->link);
if( $cwd )
$cwd = trailingslashit($cwd);
return $cwd;
}
function chdir($dir){
function chdir($dir) {
return @ftp_chdir($dir);
}
function chgrp($file,$group,$recursive=false){
function chgrp($file, $group, $recursive = false ) {
return false;
}
function chmod($file,$mode=false,$recursive=false){
function chmod($file, $mode = false, $recursive = false) {
if( ! $mode )
$mode = $this->permission;
if( ! $mode )
return false;
if ( ! $this->exists($file) )
return false;
if ( ! $recursive || ! $this->is_dir($file) ){
if (!function_exists('ftp_chmod'))
if ( ! $recursive || ! $this->is_dir($file) ) {
if ( ! function_exists('ftp_chmod') )
return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file));
return @ftp_chmod($this->link,$mode,$file);
return @ftp_chmod($this->link, $mode, $file);
}
//Is a directory, and we want recursive
$filelist = $this->dirlist($file);
foreach($filelist as $filename){
$this->chmod($file.'/'.$filename,$mode,$recursive);
$this->chmod($file . '/' . $filename, $mode, $recursive);
}
return true;
}
function chown($file,$owner,$recursive=false){
function chown($file, $owner, $recursive = false ) {
return false;
}
function owner($file){
function owner($file) {
$dir = $this->dirlist($file);
return $dir[$file]['owner'];
}
function getchmod($file){
function getchmod($file) {
$dir = $this->dirlist($file);
return $dir[$file]['permsn'];
}
function gethchmod($file){
//From the PHP.net page for ...?
$perms = $this->getchmod($file);
if (($perms & 0xC000) == 0xC000) {
// Socket
$info = 's';
} elseif (($perms & 0xA000) == 0xA000) {
// Symbolic Link
$info = 'l';
} elseif (($perms & 0x8000) == 0x8000) {
// Regular
$info = '-';
} elseif (($perms & 0x6000) == 0x6000) {
// Block special
$info = 'b';
} elseif (($perms & 0x4000) == 0x4000) {
// Directory
$info = 'd';
} elseif (($perms & 0x2000) == 0x2000) {
// Character special
$info = 'c';
} elseif (($perms & 0x1000) == 0x1000) {
// FIFO pipe
$info = 'p';
} else {
// Unknown
$info = 'u';
}
// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));
// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));
// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));
return $info;
}
function getnumchmodfromh($mode) {
$realmode = "";
$legal = array("","w","r","x","-");
$attarray = preg_split("//",$mode);
for($i=0;$i<count($attarray);$i++){
if($key = array_search($attarray[$i],$legal)){
$realmode .= $legal[$key];
}
}
$mode = str_pad($realmode,9,'-');
$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');
$mode = strtr($mode,$trans);
$newmode = '';
$newmode .= $mode[0]+$mode[1]+$mode[2];
$newmode .= $mode[3]+$mode[4]+$mode[5];
$newmode .= $mode[6]+$mode[7]+$mode[8];
return $newmode;
}
function group($file){
function group($file) {
$dir = $this->dirlist($file);
return $dir[$file]['group'];
}
function copy($source,$destination,$overwrite=false){
function copy($source, $destination, $overwrite = false ) {
if( ! $overwrite && $this->exists($destination) )
return false;
$content = $this->get_contents($source);
if( false === $content)
return false;
return $this->put_contents($destination,$content);
return $this->put_contents($destination, $content);
}
function move($source,$destination,$overwrite=false){
return ftp_rename($this->link,$source,$destination);
function move($source, $destination, $overwrite = false) {
return ftp_rename($this->link, $source, $destination);
}
function delete($file,$recursive=false) {
if ( $this->is_file($file) )
return @ftp_delete($this->link,$file);
return @ftp_delete($this->link, $file);
if ( !$recursive )
return @ftp_rmdir($this->link,$file);
return @ftp_rmdir($this->link, $file);
$filelist = $this->dirlist($file);
foreach ((array) $filelist as $filename => $fileinfo) {
$this->delete($file.'/'.$filename,$recursive);
$this->delete($file . '/' . $filename, $recursive);
}
return @ftp_rmdir($this->link,$file);
return @ftp_rmdir($this->link, $file);
}
function exists($file){
$list = ftp_rawlist($this->link,$file,false);
function exists($file) {
$list = ftp_rawlist($this->link, $file, false);
if( ! $list )
return false;
return count($list) == 1 ? true : false;
}
function is_file($file){
function is_file($file) {
return $this->is_dir($file) ? false : true;
}
function is_dir($path){
function is_dir($path) {
$cwd = $this->cwd();
$result = @ftp_chdir($this->link, $path);
if( $result && $path == $this->cwd() ||
$this->cwd() != $cwd ) {
if( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
@ftp_chdir($this->link, $cwd);
return true;
}
return false;
}
function is_readable($file){
function is_readable($file) {
//Get dir list, Check if the file is writable by the current user??
return true;
}
function is_writable($file){
function is_writable($file) {
//Get dir list, Check if the file is writable by the current user??
return true;
}
function atime($file){
function atime($file) {
return false;
}
function mtime($file){
function mtime($file) {
return ftp_mdtm($this->link, $file);
}
function size($file){
function size($file) {
return ftp_size($this->link, $file);
}
function touch($file,$time=0,$atime=0){
function touch($file, $time = 0, $atime = 0) {
return false;
}
function mkdir($path,$chmod=false,$chown=false,$chgrp=false){
function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
if( !@ftp_mkdir($this->link, $path) )
return false;
if( $chmod )
@@ -373,7 +237,7 @@ class WP_Filesystem_FTPext{
$this->chgrp($path, $chgrp);
return true;
}
function rmdir($path,$recursive=false){
function rmdir($path, $recursive = false) {
if( ! $recursive )
return @ftp_rmdir($this->link, $path);
@@ -385,9 +249,9 @@ class WP_Filesystem_FTPext{
function parselisting($line) {
$is_windows = ($this->OS_remote == FTP_OS_Windows);
if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/",$line,$lucifer)) {
if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer)) {
$b = array();
if ($lucifer[3]<70) { $lucifer[3]+=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
$b['isdir'] = ($lucifer[7]=="<DIR>");
if ( $b['isdir'] )
$b['type'] = 'd';
@@ -445,15 +309,15 @@ class WP_Filesystem_FTPext{
return $b;
}
function dirlist($path='.',$incdot=false,$recursive=false){
if( $this->is_file($path) ){
function dirlist($path = '.', $incdot = false, $recursive = false) {
if( $this->is_file($path) ) {
$limitFile = basename($path);
$path = dirname($path) . '/';
} else {
$limitFile = false;
}
$list = @ftp_rawlist($this->link , '-a ' . $path, false);
$list = @ftp_rawlist($this->link, '-a ' . $path, false);
if ( $list === false )
return false;
@@ -464,10 +328,10 @@ class WP_Filesystem_FTPext{
if ( empty($entry) )
continue;
if ( $entry["name"]=="." or $entry["name"]==".." )
if ( '.' == $entry["name"] || '..' == $entry["name"] )
continue;
$dirlist[$entry['name']] = $entry;
$dirlist[ $entry['name'] ] = $entry;
}
if ( ! $dirlist )
@@ -485,11 +349,11 @@ class WP_Filesystem_FTPext{
//We're including the doted starts
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
if ($recursive)
$struc['files'] = $this->dirlist($path.'/'.$struc['name'],$incdot,$recursive);
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
}
} else { //No dots
if ($recursive)
$struc['files'] = $this->dirlist($path.'/'.$struc['name'],$incdot,$recursive);
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
}
}
//File

View File

@@ -1,29 +1,29 @@
<?php
class WP_Filesystem_ftpsockets{
class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
var $ftp = false;
var $timeout = 5;
var $errors;
var $options = array();
var $wp_base = '';
var $permission = null;
var $filetypes = array(
'php'=>FTP_ASCII,
'css'=>FTP_ASCII,
'txt'=>FTP_ASCII,
'js'=>FTP_ASCII,
'html'=>FTP_ASCII,
'htm'=>FTP_ASCII,
'xml'=>FTP_ASCII,
'php' => FTP_ASCII,
'css' => FTP_ASCII,
'txt' => FTP_ASCII,
'js' => FTP_ASCII,
'html'=> FTP_ASCII,
'htm' => FTP_ASCII,
'xml' => FTP_ASCII,
'jpg'=>FTP_BINARY,
'png'=>FTP_BINARY,
'gif'=>FTP_BINARY,
'bmp'=>FTP_BINARY
'jpg' => FTP_BINARY,
'png' => FTP_BINARY,
'gif' => FTP_BINARY,
'bmp' => FTP_BINARY
);
function WP_Filesystem_ftpsockets($opt='') {
$this->method = 'ftpsockets';
$this->errors = new WP_Error();
//Check if possible to use ftp functions.
@@ -86,241 +86,109 @@ class WP_Filesystem_ftpsockets{
$this->permission = $perm;
}
function find_base_dir($base = '.',$echo = false, $loop = false) {
//Sanitize the Windows path formats, This allows easier conparison and aligns it to FTP output.
$abspath = str_replace('\\','/',ABSPATH); //windows: Straighten up the paths..
if( strpos($abspath, ':') ){ //Windows, Strip out the driveletter
if( preg_match("|.{1}\:(.+)|i", $abspath, $mat) )
$abspath = $mat[1];
}
//Set up the base directory (Which unless specified, is the current one)
if( empty( $base ) || '.' == $base ) $base = $this->cwd();
$base = trailingslashit($base);
//Can we see the Current directory as part of the ABSPATH?
$location = strpos($abspath, $base);
if( false !== $location ) {
$newbase = path_join($base, substr($abspath, $location + strlen($base)));
if( false !== $this->chdir($newbase) ){ //chdir sometimes returns null under certain circumstances, even when its changed correctly, FALSE will be returned if it doesnt change correctly.
if($echo) printf( __('Changing to %s') . '<br/>', $newbase );
//Check to see if it exists in that folder.
if( $this->exists($newbase . 'wp-settings.php') ){
if($echo) printf( __('Found %s'), $newbase . 'wp-settings.php<br/>' );
return $newbase;
}
}
}
//Ok, Couldnt do a magic location from that particular folder level
//Get a list of the files in the current directory, See if we can locate where we are in the folder stucture.
$files = $this->dirlist($base);
$arrPath = explode('/', $abspath);
foreach($arrPath as $key){
//Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
// If its found, change into it and follow through looking for it.
// If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
// If it reaches the end, and still cant find it, it'll return false for the entire function.
if( isset($files[ $key ]) ){
//Lets try that folder:
$folder = path_join($base, $key);
if($echo) printf( __('Changing to %s') . '<br/>', $folder );
$ret = $this->find_base_dir( $folder, $echo, $loop);
if( $ret )
return $ret;
}
}
//Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
if(isset( $files[ 'wp-settings.php' ]) ){
if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' );
return $base;
}
if( $loop )
return false;//Prevent tihs function looping again.
//As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
return $this->find_base_dir('/', $echo, true);
}
function get_base_dir($base = '.', $echo = false){
if( defined('FTP_BASE') )
$this->wp_base = FTP_BASE;
if( empty($this->wp_base) )
$this->wp_base = $this->find_base_dir($base, $echo);
return $this->wp_base;
}
function get_contents($file,$type='',$resumepos=0){
function get_contents($file, $type = '', $resumepos = 0){
if( ! $this->exists($file) )
return false;
if( empty($type) ){
$extension = substr(strrchr($file, "."), 1);
$extension = substr(strrchr($file, '.'), 1);
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_AUTOASCII;
}
$this->ftp->SetType($type);
$temp = tmpfile();
if ( ! $temp )
$temp = wp_tempnam( $file );
if ( ! $temphandle = fopen($temp, 'w+') )
return false;
if ( ! $this->ftp->fget($temp, $file) ) {
fclose($temp);
if ( ! $this->ftp->fget($temphandle, $file) ) {
fclose($temphandle);
unlink($temp);
return ''; //Blank document, File does exist, Its just blank.
}
fseek($temp, 0); //Skip back to the start of the file being written to
fseek($temphandle, 0); //Skip back to the start of the file being written to
$contents = '';
while ( !feof($temp) )
$contents .= fread($temp, 8192);
fclose($temp);
while ( ! feof($temphandle) )
$contents .= fread($temphandle, 8192);
fclose($temphandle);
unlink($temp);
return $contents;
}
function get_contents_array($file){
return explode("\n",$this->get_contents($file));
return explode("\n", $this->get_contents($file) );
}
function put_contents($file,$contents,$type=''){
function put_contents($file, $contents, $type = '' ) {
if( empty($type) ){
$extension = substr(strrchr($file, "."), 1);
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
$extension = substr(strrchr($file, '.'), 1);
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_AUTOASCII;
}
$this->ftp->SetType($type);
$temp = tmpfile();
if ( ! $temp )
$temp = wp_tempnam( $file );
if ( ! $temphandle = fopen($temp, 'w+') ){
unlink($temp);
return false;
fwrite($temp,$contents);
fseek($temp, 0); //Skip back to the start of the file being written to
$ret = $this->ftp->fput($file, $temp);
fclose($temp);
}
fwrite($temphandle, $contents);
fseek($temphandle, 0); //Skip back to the start of the file being written to
$ret = $this->ftp->fput($file, $temphandle);
fclose($temphandle);
unlink($temp);
return $ret;
}
function cwd(){
function cwd() {
$cwd = $this->ftp->pwd();
if( $cwd )
$cwd = trailingslashit($cwd);
return $cwd;
}
function chdir($file){
function chdir($file) {
return $this->ftp->chdir($file);
}
function chgrp($file,$group,$recursive=false){
function chgrp($file, $group, $recursive = false ) {
return false;
}
function chmod($file,$mode=false,$recursive=false){
function chmod($file, $mode = false, $recursive = false ){
if( ! $mode )
$mode = $this->permission;
if( ! $mode )
return false;
//if( ! $this->exists($file) )
// return false;
if( ! $recursive || ! $this->is_dir($file) ){
if( ! $recursive || ! $this->is_dir($file) ) {
return $this->ftp->chmod($file,$mode);
}
//Is a directory, and we want recursive
$filelist = $this->dirlist($file);
foreach($filelist as $filename){
$this->chmod($file.'/'.$filename,$mode,$recursive);
$this->chmod($file . '/' . $filename, $mode, $recursive);
}
return true;
}
function chown($file,$owner,$recursive=false){
function chown($file, $owner, $recursive = false ) {
return false;
}
function owner($file){
function owner($file) {
$dir = $this->dirlist($file);
return $dir[$file]['owner'];
}
function getchmod($file){
function getchmod($file) {
$dir = $this->dirlist($file);
return $dir[$file]['permsn'];
}
function gethchmod($file){
//From the PHP.net page for ...?
$perms = $this->getchmod($file);
if (($perms & 0xC000) == 0xC000) {
// Socket
$info = 's';
} elseif (($perms & 0xA000) == 0xA000) {
// Symbolic Link
$info = 'l';
} elseif (($perms & 0x8000) == 0x8000) {
// Regular
$info = '-';
} elseif (($perms & 0x6000) == 0x6000) {
// Block special
$info = 'b';
} elseif (($perms & 0x4000) == 0x4000) {
// Directory
$info = 'd';
} elseif (($perms & 0x2000) == 0x2000) {
// Character special
$info = 'c';
} elseif (($perms & 0x1000) == 0x1000) {
// FIFO pipe
$info = 'p';
} else {
// Unknown
$info = 'u';
}
// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));
// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));
// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));
return $info;
}
function getnumchmodfromh($mode) {
$realmode = "";
$legal = array("","w","r","x","-");
$attarray = preg_split("//",$mode);
for($i=0;$i<count($attarray);$i++){
if($key = array_search($attarray[$i],$legal)){
$realmode .= $legal[$key];
}
}
$mode = str_pad($realmode,9,'-');
$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');
$mode = strtr($mode,$trans);
$newmode = '';
$newmode .= $mode[0]+$mode[1]+$mode[2];
$newmode .= $mode[3]+$mode[4]+$mode[5];
$newmode .= $mode[6]+$mode[7]+$mode[8];
return $newmode;
}
function group($file){
function group($file) {
$dir = $this->dirlist($file);
return $dir[$file]['group'];
}
function copy($source,$destination,$overwrite=false){
function copy($source, $destination, $overwrite = false ) {
if( ! $overwrite && $this->exists($destination) )
return false;
@@ -328,14 +196,14 @@ class WP_Filesystem_ftpsockets{
if ( false === $content )
return false;
return $this->put_contents($destination,$content);
return $this->put_contents($destination, $content);
}
function move($source,$destination,$overwrite=false){
return $this->ftp->rename($source,$destination);
function move($source, $destination, $overwrite = false ) {
return $this->ftp->rename($source, $destination);
}
function delete($file,$recursive=false) {
function delete($file, $recursive = false ) {
if ( $this->is_file($file) )
return $this->ftp->delete($file);
if ( !$recursive )
@@ -344,15 +212,15 @@ class WP_Filesystem_ftpsockets{
return $this->ftp->mdel($file);
}
function exists($file){
function exists($file) {
return $this->ftp->is_exists($file);
}
function is_file($file){
function is_file($file) {
return $this->is_dir($file) ? false : true;
}
function is_dir($path){
function is_dir($path) {
$cwd = $this->cwd();
if ( $this->chdir($path) ) {
$this->chdir($cwd);
@@ -361,33 +229,33 @@ class WP_Filesystem_ftpsockets{
return false;
}
function is_readable($file){
function is_readable($file) {
//Get dir list, Check if the file is writable by the current user??
return true;
}
function is_writable($file){
function is_writable($file) {
//Get dir list, Check if the file is writable by the current user??
return true;
}
function atime($file){
function atime($file) {
return false;
}
function mtime($file){
function mtime($file) {
return $this->ftp->mdtm($file);
}
function size($file){
function size($file) {
return $this->ftp->filesize($file);
}
function touch($file,$time=0,$atime=0){
function touch($file, $time = 0, $atime = 0 ){
return false;
}
function mkdir($path,$chmod=false,$chown=false,$chgrp=false){
function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
if( ! $this->ftp->mkdir($path) )
return false;
if( $chmod )
@@ -399,15 +267,15 @@ class WP_Filesystem_ftpsockets{
return true;
}
function rmdir($path,$recursive=false){
function rmdir($path, $recursive = false ) {
if( ! $recursive )
return $this->ftp->rmdir($path);
return $this->ftp->mdel($path);
}
function dirlist($path='.',$incdot=false,$recursive=false){
if( $this->is_file($path) ){
function dirlist($path = '.', $incdot = false, $recursive = false ) {
if( $this->is_file($path) ) {
$limitFile = basename($path);
$path = dirname($path) . '/';
} else {
@@ -430,11 +298,11 @@ class WP_Filesystem_ftpsockets{
//We're including the doted starts
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
if ($recursive)
$struc['files'] = $this->dirlist($path.'/'.$struc['name'],$incdot,$recursive);
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
}
} else { //No dots
if ($recursive)
$struc['files'] = $this->dirlist($path.'/'.$struc['name'],$incdot,$recursive);
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
}
}
//File

View File

@@ -3,8 +3,8 @@
function comment_exists($comment_author, $comment_date) {
global $wpdb;
return $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments
WHERE comment_author = '$comment_author' AND comment_date = '$comment_date'");
return $wpdb->get_var( $wpdb->prepare("SELECT comment_post_ID FROM $wpdb->comments
WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) );
}
function edit_comment() {

View File

@@ -23,7 +23,9 @@ function wp_dashboard_setup() {
/* Register Widgets and Controls */
// Recent Comments Widget
if ( current_user_can( 'moderate_comments' ) && $mod_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'") ) {
$mod_comments = wp_count_comments();
$mod_comments = $mod_comments->moderated;
if ( current_user_can( 'moderate_comments' ) && $mod_comments ) {
$notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments );
$notice = "<a href='edit-comments.php?comment_status=moderated'>$notice</a>";
} else {
@@ -34,9 +36,10 @@ function wp_dashboard_setup() {
);
// Incoming Links Widget
if ( !isset( $widget_options['dashboard_incoming_links'] ) ) {
if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
$update = true;
$widget_options['dashboard_incoming_links'] = array(
'home' => get_option('home'),
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
'items' => 5,
@@ -214,16 +217,16 @@ function wp_dashboard_dynamic_sidebar_params( $params ) {
$wp_registered_widgets[$widget_id]['callback'] = 'wp_dashboard_empty';
$sidebar_widget_name = $wp_registered_widget_controls[$widget_id]['name'];
$params[1] = 'wp_dashboard_trigger_widget_control';
$sidebar_before_widget .= '<form action="' . remove_query_arg( 'edit' ) . '" method="post">';
$sidebar_before_widget .= '<form action="' . clean_url(remove_query_arg( 'edit' )) . '" method="post">';
$sidebar_after_widget = "<div class='dashboard-widget-submit'><input type='hidden' name='sidebar' value='wp_dashboard' /><input type='hidden' name='widget_id' value='$widget_id' /><input type='submit' value='" . __( 'Save' ) . "' /></div></form>$sidebar_after_widget";
$links[] = '<a href="' . remove_query_arg( 'edit' ) . '">' . __( 'Cancel' ) . '</a>';
$links[] = '<a href="' . clean_url(remove_query_arg( 'edit' )) . '">' . __( 'Cancel' ) . '</a>';
} else {
$links[] = '<a href="' . add_query_arg( 'edit', $widget_id ) . "#$widget_id" . '">' . __( 'Edit' ) . '</a>';
$links[] = '<a href="' . clean_url(add_query_arg( 'edit', $widget_id )) . "#$widget_id" . '">' . __( 'Edit' ) . '</a>';
}
}
if ( $widget_feed_link )
$links[] = '<img class="rss-icon" src="' . get_option( 'siteurl' ) . '/' . WPINC . '/images/rss.png" alt="' . __( 'rss icon' ) . '" /> <a href="' . clean_url( $widget_feed_link ) . '">' . __( 'RSS' ) . '</a>';
$links[] = '<img class="rss-icon" src="' . includes_url('images/rss.png') . '" alt="' . __( 'rss icon' ) . '" /> <a href="' . clean_url( $widget_feed_link ) . '">' . __( 'RSS' ) . '</a>';
$links = apply_filters( "wp_dashboard_widget_links_$widget_id", $links );
@@ -267,7 +270,7 @@ function wp_dashboard_recent_comments( $sidebar_args ) {
$lambda = create_function( '', 'return 5;' );
add_filter( 'option_posts_per_rss', $lambda ); // hack - comments query doesn't accept per_page parameter
$comments_query = new WP_Query('feed=rss2&withcomments=1');
$comments_query = new WP_Query(array('feed' => 'rss2', 'withcomments' => 1));
remove_filter( 'option_posts_per_rss', $lambda );
$is_first = true;
@@ -313,7 +316,7 @@ function wp_dashboard_incoming_links_output() {
$widgets = get_option( 'dashboard_widget_options' );
@extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP );
$rss = @fetch_rss( $url );
if ( isset($rss->items) && 1 < count($rss->items) ) {// Technorati returns a 1-item feed when it has no results
if ( isset($rss->items) && 0 < count($rss->items) ) {
echo "<ul>\n";
@@ -387,8 +390,7 @@ function wp_dashboard_secondary_output() {
$rss->items = array_slice($rss->items, 0, $items);
foreach ($rss->items as $item ) {
$title = wp_specialchars($item['title']);
$author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] );
$post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] );
list($author,$post) = explode( ':', $title, 2 );
$link = clean_url($item['link']);
echo "\t<li><a href='$link'><span class='post'>$post</span><span class='hidden'> - </span><cite>$author</cite></a></li>\n";

View File

@@ -17,7 +17,7 @@ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
$where = '';
if ( $author and $author != 'all' ) {
$author_id = (int) $author;
$where = " WHERE post_author = '$author_id' ";
$where = $wpdb->prepare(" WHERE post_author = %d ", $author_id);
}
// grab a snapshot of post IDs, just in case it changes during the export
@@ -201,6 +201,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
<guid isPermaLink="false"><?php the_guid(); ?></guid>
<description></description>
<content:encoded><?php echo wxr_cdata( apply_filters('the_content_export', $post->post_content) ); ?></content:encoded>
<excerpt:encoded><?php echo wxr_cdata( apply_filters('the_excerpt_export', $post->post_excerpt) ); ?></excerpt:encoded>
<wp:post_id><?php echo $post->ID; ?></wp:post_id>
<wp:post_date><?php echo $post->post_date; ?></wp:post_date>
<wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
@@ -217,7 +218,7 @@ if ($post->post_type == 'attachment') { ?>
<wp:attachment_url><?php echo wp_get_attachment_url($post->ID); ?></wp:attachment_url>
<?php } ?>
<?php
$postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID");
$postmeta = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID) );
if ( $postmeta ) {
?>
<?php foreach( $postmeta as $meta ) { ?>
@@ -228,7 +229,7 @@ if ( $postmeta ) {
<?php } ?>
<?php } ?>
<?php
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID");
$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d", $post->ID) );
if ( $comments ) { foreach ( $comments as $c ) { ?>
<wp:comment>
<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
@@ -252,4 +253,4 @@ if ( $comments ) { foreach ( $comments as $c ) { ?>
<?php
}
?>
?>

View File

@@ -34,19 +34,47 @@ function get_home_path() {
function get_real_file_to_edit( $file ) {
if ('index.php' == $file || '.htaccess' == $file ) {
$real_file = get_home_path().$file;
$real_file = get_home_path() . $file;
} else {
$real_file = ABSPATH.$file;
$real_file = WP_CONTENT_DIR . $file;
}
return $real_file;
}
//$folder = Full path to folder
//$levels = Levels of folders to follow, Default: 100 (PHP Loop limit)
function list_files( $folder = '', $levels = 100 ) {
if( empty($folder) )
return false;
if( ! $levels )
return false;
$files = array();
if ( $dir = @opendir( $folder ) ) {
while (($file = readdir( $dir ) ) !== false ) {
if ( in_array($file, array('.', '..') ) )
continue;
if ( is_dir( $folder . '/' . $file ) ) {
$files2 = list_files( $folder . '/' . $file, $levels - 1);
if( $files2 )
$files = array_merge($files, $files2 );
else
$files[] = $folder . '/' . $file . '/';
} else {
$files[] = $folder . '/' . $file;
}
}
}
@closedir( $dir );
return $files;
}
function get_temp_dir() {
if ( defined('WP_TEMP_DIR') )
return trailingslashit(WP_TEMP_DIR);
$temp = ABSPATH . 'wp-content/';
$temp = WP_CONTENT_DIR . '/';
if ( is_dir($temp) && is_writable($temp) )
return $temp;
@@ -56,20 +84,16 @@ function get_temp_dir() {
return '/tmp/';
}
function validate_file( $file, $allowed_files = '' ) {
if ( false !== strpos( $file, '..' ))
return 1;
function wp_tempnam($filename = '', $dir = ''){
if ( empty($dir) )
$dir = get_temp_dir();
$filename = basename($filename);
if ( empty($filename) )
$filename = time();
if ( false !== strpos( $file, './' ))
return 1;
if (':' == substr( $file, 1, 1 ))
return 2;
if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) )
return 3;
return 0;
$filename = $dir . wp_unique_filename($dir, $filename);
touch($filename);
return $filename;
}
function validate_file_to_edit( $file, $allowed_files = '' ) {
@@ -188,6 +212,102 @@ function wp_handle_upload( &$file, $overrides = false ) {
return $return;
}
// Pass this function an array similar to that of a $_FILES POST array.
function wp_handle_sideload( &$file, $overrides = false ) {
// The default error handler.
if (! function_exists( 'wp_handle_upload_error' ) ) {
function wp_handle_upload_error( &$file, $message ) {
return array( 'error'=>$message );
}
}
// You may define your own function and pass the name in $overrides['upload_error_handler']
$upload_error_handler = 'wp_handle_upload_error';
// $_POST['action'] must be set and its value must equal $overrides['action'] or this:
$action = 'wp_handle_sideload';
// Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
$upload_error_strings = array( false,
__( "The file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>." ),
__( "The file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form." ),
__( "The file was only partially uploaded." ),
__( "No file was sent." ),
__( "Missing a temporary folder." ),
__( "Failed to write file to disk." ));
// All tests are on by default. Most can be turned off by $override[{test_name}] = false;
$test_form = true;
$test_size = true;
// If you override this, you must provide $ext and $type!!!!
$test_type = true;
$mimes = false;
// Install user overrides. Did we mention that this voids your warranty?
if ( is_array( $overrides ) )
extract( $overrides, EXTR_OVERWRITE );
// A correct form post will pass this test.
if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) )
return $upload_error_handler( $file, __( 'Invalid form submission.' ));
// A successful upload will pass this test. It makes no sense to override this one.
if ( $file['error'] > 0 )
return $upload_error_handler( $file, $upload_error_strings[$file['error']] );
// A non-empty file will pass this test.
if ( $test_size && !(filesize($file['tmp_name']) > 0 ) )
return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' ));
// A properly uploaded file will pass this test. There should be no reason to override this one.
if (! @ is_file( $file['tmp_name'] ) )
return $upload_error_handler( $file, __( 'Specified file does not exist.' ));
// A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
if ( $test_type ) {
$wp_filetype = wp_check_filetype( $file['name'], $mimes );
extract( $wp_filetype );
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
if ( !$ext )
$ext = ltrim(strrchr($file['name'], '.'), '.');
if ( !$type )
$type = $file['type'];
}
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
return $upload_error_handler( $file, $uploads['error'] );
$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
// Strip the query strings.
$filename = str_replace('?','-', $filename);
$filename = str_replace('&','-', $filename);
// Move the file to the uploads dir
$new_file = $uploads['path'] . "/$filename";
if ( false === @ rename( $file['tmp_name'], $new_file ) ) {
return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
}
// Set correct file permissions
$stat = stat( dirname( $new_file ));
$perms = $stat['mode'] & 0000666;
@ chmod( $new_file, $perms );
// Compute the URL
$url = $uploads['url'] . "/$filename";
$return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
return $return;
}
/**
* Downloads a url to a local file using the Snoopy HTTP Class
@@ -200,7 +320,7 @@ function download_url( $url ) {
if( ! $url )
return new WP_Error('http_no_url', __('Invalid URL Provided'));
$tmpfname = tempnam(get_temp_dir(), 'wpupdate');
$tmpfname = wp_tempnam($url);
if( ! $tmpfname )
return new WP_Error('http_no_file', __('Could not create Temporary file'));
@@ -260,13 +380,13 @@ function unzip_file($file, $to) {
$tmppath .= $path[$j] . '/';
if ( ! $fs->is_dir($to . $tmppath) )
if ( !$fs->mkdir($to . $tmppath, 0755) )
return new WP_Error('mkdir_failed', __('Could not create directory'));
return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $tmppath);
}
// We've made sure the folders are there, so let's extract the file now:
if ( ! $file['folder'] )
if ( !$fs->put_contents( $to . $file['filename'], $file['content']) )
return new WP_Error('copy_failed', __('Could not copy file'));
return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']);
$fs->chmod($to . $file['filename'], 0644);
}
@@ -284,27 +404,33 @@ function copy_dir($from, $to) {
foreach ( (array) $dirlist as $filename => $fileinfo ) {
if ( 'f' == $fileinfo['type'] ) {
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) )
return false;
return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename);
$wp_filesystem->chmod($to . $filename, 0644);
} elseif ( 'd' == $fileinfo['type'] ) {
if ( !$wp_filesystem->mkdir($to . $filename, 0755) )
return false;
if ( !copy_dir($from . $filename, $to . $filename) )
return false;
return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename);
$result = copy_dir($from . $filename, $to . $filename);
if ( is_wp_error($result) )
return $result;
}
}
return true;
}
function WP_Filesystem( $args = false, $preference = false ) {
function WP_Filesystem( $args = false ) {
global $wp_filesystem;
$method = get_filesystem_method($preference);
require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php');
$method = get_filesystem_method();
if ( ! $method )
return false;
require_once('class-wp-filesystem-'.$method.'.php');
$abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-'.$method.'.php', $method);
if( ! file_exists($abstraction_file) )
return;
require_once($abstraction_file);
$method = "WP_Filesystem_$method";
$wp_filesystem = new $method($args);
@@ -319,18 +445,17 @@ function WP_Filesystem( $args = false, $preference = false ) {
}
function get_filesystem_method() {
$tempFile = tempnam(get_temp_dir(), 'WPU');
if ( getmyuid() == fileowner($tempFile) ) {
unlink($tempFile);
return 'direct';
} else {
unlink($tempFile);
$method = false;
if( function_exists('getmyuid') && function_exists('fileowner') ){
$temp_file = wp_tempnam();
if ( getmyuid() == fileowner($temp_file) )
$method = 'direct';
unlink($temp_file);
}
if ( extension_loaded('ftp') ) return 'ftpext';
if ( extension_loaded('sockets') || function_exists('fsockopen') ) return 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
return false;
if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';
if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
return apply_filters('filesystem_method', $method);
}
?>
?>

View File

@@ -26,11 +26,14 @@ function update_gallery_tab($tabs) {
add_filter('media_upload_tabs', 'update_gallery_tab');
function the_media_upload_tabs() {
global $redir_tab;
$tabs = media_upload_tabs();
if ( !empty($tabs) ) {
echo "<ul id='sidemenu'>\n";
if ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) )
if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) )
$current = $redir_tab;
elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) )
$current = $_GET['tab'];
else {
$keys = array_keys($tabs);
@@ -41,8 +44,8 @@ function the_media_upload_tabs() {
if ( $current == $callback )
$class = " class='current'";
$href = add_query_arg(array('tab'=>$callback, 's'=>false, 'paged'=>false, 'post_mime_type'=>false, 'm'=>false));
$link = "<a href='$href'$class>$text</a>";
echo "\t<li id='tab-$callback'>$link</li>\n";
$link = "<a href='" . clean_url($href) . "'$class>$text</a>";
echo "\t<li id='" . attribute_escape("tab-$callback") . "'>$link</li>\n";
}
echo "</ul>\n";
}
@@ -55,20 +58,39 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal
$rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : '';
if ( $url )
$html = "<a href='".attribute_escape($url)."'$rel>$html</a>";
$html = '<a href="' . clean_url($url) . "\"$rel>$html</a>";
$html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size );
return $html;
}
function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html;
$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
preg_match( '/width="([0-9]+)/', $html, $matches );
if ( ! isset($matches[1]) ) return $html;
$width = $matches[1];
$html = preg_replace( '/align[^\s\'"]+\s?/', '', $html );
if ( empty($align) ) $align = 'none';
$shcode = '[caption id="' . $id . '" align="align' . $align
. '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]';
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
}
add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 );
function media_send_to_editor($html) {
?>
<script type="text/javascript">
<!--
top.send_to_editor('<?php echo addslashes($html); ?>');
top.tb_remove();
-->
/* <![CDATA[ */
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor('<?php echo addslashes($html); ?>');
/* ]]> */
</script>
<?php
exit;
@@ -80,7 +102,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array()) {
$file = wp_handle_upload($_FILES[$file_id], $overrides);
if ( isset($file['error']) )
return new wp_error( 'upload_error', $file['error'] );
return new WP_Error( 'upload_error', $file['error'] );
$url = $file['url'];
$type = $file['type'];
@@ -115,6 +137,47 @@ function media_handle_upload($file_id, $post_id, $post_data = array()) {
}
function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
$overrides = array('test_form'=>false);
$file = wp_handle_sideload($file_array, $overrides);
if ( isset($file['error']) )
return new WP_Error( 'upload_error', $file['error'] );
$url = $file['url'];
$type = $file['type'];
$file = $file['file'];
$title = preg_replace('/\.[^.]+$/', '', basename($file));
$content = '';
// use image exif/iptc data for title and caption defaults if possible
if ( $image_meta = @wp_read_image_metadata($file) ) {
if ( trim($image_meta['title']) )
$title = $image_meta['title'];
if ( trim($image_meta['caption']) )
$content = $image_meta['caption'];
}
$title = @$desc;
// Construct the attachment array
$attachment = array_merge( array(
'post_mime_type' => $type,
'guid' => $url,
'post_parent' => $post_id,
'post_title' => $title,
'post_content' => $content,
), $post_data );
// Save the data
$id = wp_insert_attachment($attachment, $file, $post_parent);
if ( !is_wp_error($id) ) {
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
return $url;
}
return $id;
}
// wrap iframe content (produced by $content_func) in a doctype, html head/body etc
// any additional function args will be passed to content_func
@@ -126,9 +189,12 @@ function wp_iframe($content_func /* ... */) {
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Uploads'); ?> &#8212; <?php _e('WordPress'); ?></title>
<?php
wp_admin_css( 'css/global' );
wp_admin_css();
wp_admin_css( 'css/colors' );
wp_enqueue_style( 'global' );
wp_enqueue_style( 'wp-admin' );
wp_enqueue_style( 'colors' );
if ( 0 === strpos( $content_func, 'media' ) )
wp_enqueue_style( 'media' );
?>
<script type="text/javascript">
//<![CDATA[
@@ -136,6 +202,7 @@ function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}el
//]]>
</script>
<?php
do_action('admin_print_styles');
do_action('admin_print_scripts');
do_action('admin_head');
if ( is_string($content_func) )
@@ -167,36 +234,15 @@ function media_buttons() {
$audio_title = __('Add Audio');
$out = <<<EOF
<a href="{$image_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
<a href="{$video_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
<a href="{$audio_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
<a href="{$media_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
<a href="{$image_upload_iframe_src}&amp;TB_iframe=true" id="add_image" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
<a href="{$video_upload_iframe_src}&amp;TB_iframe=true" id="add_video" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
<a href="{$audio_upload_iframe_src}&amp;TB_iframe=true" id="add_audio" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
<a href="{$media_upload_iframe_src}&amp;TB_iframe=true" id="add_media" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
EOF;
printf($context, $out);
}
add_action( 'media_buttons', 'media_buttons' );
function media_buttons_head() {
$siteurl = get_option('siteurl');
echo "<style type='text/css' media='all'>
@import '{$siteurl}/wp-includes/js/thickbox/thickbox.css?1';
div#TB_title {
background-color: #222222;
color: #cfcfcf;
}
div#TB_title a, div#TB_title a:visited {
color: #cfcfcf;
}
</style>\n";
}
add_action( 'admin_print_scripts', 'media_buttons_head' );
function media_admin_css() {
wp_admin_css('css/media');
}
add_action('media_upload_media', 'media_upload_handler');
function media_upload_form_handler() {
@@ -210,6 +256,8 @@ function media_upload_form_handler() {
$post['post_title'] = $attachment['post_title'];
if ( isset($attachment['post_excerpt']) )
$post['post_excerpt'] = $attachment['post_excerpt'];
if ( isset($attachment['menu_order']) )
$post['menu_order'] = $attachment['menu_order'];
$post = apply_filters('attachment_fields_to_save', $post, $attachment);
@@ -232,7 +280,7 @@ function media_upload_form_handler() {
if ( isset($_POST['send']) ) {
$keys = array_keys($_POST['send']);
$send_id = (int) array_shift($keys);
$attachment = $_POST['attachments'][$send_id];
$attachment = stripslashes_deep( $_POST['attachments'][$send_id] );
$html = $attachment['post_title'];
if ( !empty($attachment['url']) ) {
if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) )
@@ -280,12 +328,36 @@ function media_upload_image() {
$errors = $return;
}
if ( isset($_POST['save']) )
if ( isset($_POST['save']) ) {
$errors['upload_notice'] = __('Saved.');
return media_upload_gallery();
}
return wp_iframe( 'media_upload_type_form', 'image', $errors, $id );
}
function media_sideload_image($file, $post_id, $desc = null) {
if (!empty($file) ) {
$file_array['name'] = basename($file);
$file_array['tmp_name'] = download_url($file);
$desc = @$desc;
$id = media_handle_sideload($file_array, $post_id, $desc);
$src = $id;
if ( is_wp_error($id) ) {
@unlink($file_array['tmp_name']);
return $id;
}
}
if ( !empty($src) ) {
$alt = @$desc;
$html = "<img src='$src' alt='$alt' />";
return $html;
}
}
function media_upload_audio() {
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
// Upload File button was clicked
@@ -318,8 +390,10 @@ function media_upload_audio() {
$errors = $return;
}
if ( isset($_POST['save']) )
if ( isset($_POST['save']) ) {
$errors['upload_notice'] = __('Saved.');
return media_upload_gallery();
}
return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id );
}
@@ -356,8 +430,10 @@ function media_upload_video() {
$errors = $return;
}
if ( isset($_POST['save']) )
if ( isset($_POST['save']) ) {
$errors['upload_notice'] = __('Saved.');
return media_upload_gallery();
}
return wp_iframe( 'media_upload_type_form', 'video', $errors, $id );
}
@@ -394,8 +470,10 @@ function media_upload_file() {
$errors = $return;
}
if ( isset($_POST['save']) )
if ( isset($_POST['save']) ) {
$errors['upload_notice'] = __('Saved.');
return media_upload_gallery();
}
return wp_iframe( 'media_upload_type_form', 'file', $errors, $id );
}
@@ -410,6 +488,7 @@ function media_upload_gallery() {
$errors = $return;
}
wp_enqueue_script('admin-gallery');
return wp_iframe( 'media_upload_gallery_form', $errors );
}
@@ -429,8 +508,9 @@ function media_upload_library() {
function image_attachment_fields_to_edit($form_fields, $post) {
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
$form_fields['post_title']['required'] = true;
$form_fields['post_excerpt']['label'] = __('Caption');
$form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"');
$form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
$form_fields['post_content']['label'] = __('Description');
@@ -546,6 +626,10 @@ function get_attachment_fields_to_edit($post, $errors = null) {
</script>\n",
'helps' => __('Enter a link URL or click above for presets.'),
),
'menu_order' => array(
'label' => __('Order'),
'value' => $edit_post->menu_order
),
);
foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
@@ -583,7 +667,7 @@ function get_media_items( $post_id, $errors ) {
if ( $post && $post->post_type == 'attachment' )
$attachments = array($post->ID => $post);
else
$attachments = get_children("post_parent=$post_id&post_type=attachment&orderby=menu_order ASC, ID&order=DESC");
$attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') );
} else {
if ( is_array($GLOBALS['wp_the_query']->posts) )
foreach ( $GLOBALS['wp_the_query']->posts as $attachment )
@@ -601,6 +685,8 @@ function get_media_items( $post_id, $errors ) {
}
function get_media_item( $attachment_id, $args = null ) {
global $redir_tab;
$default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true );
$args = wp_parse_args( $args, $default_args );
extract( $args, EXTR_SKIP );
@@ -648,10 +734,27 @@ function get_media_item( $attachment_id, $args = null ) {
}
$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
$display_title = wp_html_excerpt($display_title, 60);
$gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false;
$order = '';
foreach ( $form_fields as $key => $val ) {
if ( 'menu_order' == $key ) {
if ( $gallery )
$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="'.$val['value'].'" /></div>';
else
$order = '<input type="hidden" name="attachments['.$attachment_id.'][menu_order]" value="'.$val['value'].'" />';
unset($form_fields['menu_order']);
break;
}
}
$item = "
$type
$toggle_links
$order
<div class='filename new'>$display_title</div>
<table class='slidetoggle describe $class'>
<thead class='media-item-info'>
@@ -676,9 +779,11 @@ function get_media_item( $attachment_id, $args = null ) {
if ( $send )
$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . attribute_escape( __( 'Insert into Post' ) ) . "' />";
if ( $delete )
$delete = "<a href='$delete_href' id='del[$attachment_id]' disabled='disabled' class='delete'>" . __('Delete') . "</button>";
$delete = "<a href=\"#\" class=\"del-link\" onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __('Delete') . "</a>";
if ( ( $send || $delete ) && !isset($form_fields['buttons']) )
$form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete</td></tr>\n");
$form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete
<div id=\"del_attachment_$attachment_id\" class=\"del-attachment\" style=\"display:none;\">" . sprintf(__("You are about to delete <strong>%s</strong>."), $filename) . " <a href=\"$delete_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Continue') . "</a>
<a href=\"#\" class=\"del-link\" onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a></div></td></tr>\n");
$hidden_fields = array();
@@ -700,6 +805,7 @@ function get_media_item( $attachment_id, $args = null ) {
}
$required = $field['required'] ? '<abbr title="required" class="required">*</abbr>' : '';
$aria_required = $field['required'] ? " aria-required='true' " : '';
$class = $id;
$class .= $field['required'] ? ' form-required' : '';
@@ -707,9 +813,9 @@ function get_media_item( $attachment_id, $args = null ) {
if ( !empty($field[$field['input']]) )
$item .= $field[$field['input']];
elseif ( $field['input'] == 'textarea' ) {
$item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . "</textarea>";
$item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . $aria_required . "</textarea>";
} else {
$item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "' />";
$item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "'" . $aria_required . "/>";
}
if ( !empty($field['helps']) )
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique((array) $field['helps']) ) . '</p>';
@@ -754,7 +860,7 @@ function media_upload_header() {
function media_upload_form( $errors = null ) {
global $type, $tab;
$flash_action_url = get_option('siteurl') . "/wp-admin/async-upload.php";
$flash_action_url = admin_url('async-upload.php');
// If Mac and mod_security, no Flash. :(
$flash = true;
@@ -765,7 +871,6 @@ function media_upload_form( $errors = null ) {
$post_id = intval($_REQUEST['post_id']);
?>
<input type='hidden' name='post_id' value='<?php echo (int) $post_id; ?>' />
<div id="media-upload-notice">
<?php if (isset($errors['upload_notice']) ) { ?>
<?php echo $errors['upload_notice']; ?>
@@ -776,18 +881,22 @@ function media_upload_form( $errors = null ) {
<?php echo $errors['upload_error']->get_error_message(); ?>
<?php } ?>
</div>
<?php do_action('pre-upload-ui'); ?>
<?php if ( $flash ) : ?>
<script type="text/javascript">
<!--
jQuery(function($){
swfu = new SWFUpload({
upload_url : "<?php echo attribute_escape( $flash_action_url ); ?>",
flash_url : "<?php echo get_option('siteurl').'/wp-includes/js/swfupload/swfupload_f9.swf'; ?>",
flash_url : "<?php echo includes_url('js/swfupload/swfupload_f9.swf'); ?>",
file_post_name: "async-upload",
file_types: "<?php echo apply_filters('upload_file_glob', '*.*'); ?>",
post_params : {
"post_id" : "<?php echo $post_id; ?>",
"auth_cookie" : "<?php echo $_COOKIE[AUTH_COOKIE]; ?>",
"auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>",
"_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
"type" : "<?php echo $type; ?>",
"tab" : "<?php echo $tab; ?>",
"short" : "1"
@@ -812,24 +921,27 @@ jQuery(function($){
//-->
</script>
<div id="flash-upload-ui">
<?php do_action('pre-flash-upload-ui'); ?>
<p><input id="flash-browse-button" type="button" value="<?php echo attribute_escape( __( 'Choose files to upload' ) ); ?>" class="button" /></p>
<p><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
<?php do_action('post-flash-upload-ui'); ?>
<p class="howto"><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
</div>
<?php endif; // $flash ?>
<div id="html-upload-ui">
<?php do_action('pre-html-upload-ui'); ?>
<p>
<input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onClick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
<input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onclick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
</p>
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<br class="clear" />
<?php if ( is_lighttpd_before_150() ): ?>
<p><?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?></p>
<?php endif;?>
<?php do_action('post-html-upload-ui'); ?>
</div>
<?php do_action('post-upload-ui'); ?>
<?php
}
@@ -838,7 +950,8 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
$post_id = intval($_REQUEST['post_id']);
$form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type=$type&tab=type&post_id=$post_id";
$form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
$callback = "type_form_$type";
?>
@@ -873,23 +986,100 @@ jQuery(function($){
<h3><?php _e('From URL'); ?></h3>
</div>
<script type="text/javascript">
//<![CDATA[
var addExtImage = {
width : '',
height : '',
align : 'alignnone',
insert : function() {
var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = null;
if ( '' == f.src.value || '' == t.width ) return false;
if ( f.title.value ) {
title = f.title.value.replace(/['"<>]+/g, '');
title = ' title="'+title+'"';
}
if ( f.alt.value ) {
alt = f.alt.value.replace(/['"<>]+/g, '');
<?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
caption = f.alt.value.replace(/'/g, '&#39;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
<?php } ?>
}
cls = caption ? '' : ' class="'+t.align+'"';
html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';
if ( f.url.value )
html = '<a href="'+f.url.value+'">'+html+'</a>';
if ( caption )
html = '[caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/caption]';
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor(html);
},
resetImageData : function() {
var t = addExtImage;
t.width = t.height = '';
document.getElementById('go_button').style.color = '#bbb';
if ( ! document.forms[0].src.value )
document.getElementById('status_img').src = 'images/required.gif';
else document.getElementById('status_img').src = 'images/no.png';
},
updateImageData : function() {
var t = addExtImage;
t.width = t.preloadImg.width;
t.height = t.preloadImg.height;
document.getElementById('go_button').style.color = '#333';
document.getElementById('status_img').src = 'images/yes.png';
},
getImageData : function() {
var t = addExtImage, src = document.forms[0].src.value;
if ( ! src ) {
t.resetImageData();
return false;
}
document.getElementById('status_img').src = 'images/loading.gif';
t.preloadImg = new Image();
t.preloadImg.onload = t.updateImageData;
t.preloadImg.onerror = t.resetImageData;
t.preloadImg.src = src;
}
}
//]]>
</script>
<div id="media-items">
<div class="media-item media-blank">
<?php echo call_user_func($callback); ?>
</div>
</div>
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
</form>
<?php
endif;
}
function media_upload_gallery_form($errors) {
global $redir_tab;
$redir_tab = 'gallery';
media_upload_header();
$post_id = intval($_REQUEST['post_id']);
$form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id";
$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id");
?>
<script type="text/javascript">
@@ -907,15 +1097,22 @@ jQuery(function($){
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form validate" id="gallery-form">
<?php wp_nonce_field('media-form'); ?>
<?php //media_upload_form( $errors ); ?>
<table class="widefat">
<thead><tr>
<th><?php _e('Media'); ?></th>
<th class="order-head"><?php _e('Order'); ?></th>
</tr></thead>
</table>
<div id="media-items">
<?php echo get_media_items($post_id, $errors); ?>
</div>
<p class="ml-submit">
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
<input type="submit" class="button insert-gallery" name="insert-gallery" value="<?php echo attribute_escape( __( 'Insert gallery into post' ) ); ?>" />
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<input type="hidden" name="type" value="<?php echo attribute_escape( $GLOBALS['type'] ); ?>" />
<input type="hidden" name="tab" value="<?php echo attribute_escape( $GLOBALS['tab'] ); ?>" />
</p>
</form>
<?php
}
@@ -927,7 +1124,7 @@ function media_upload_library_form($errors) {
$post_id = intval($_REQUEST['post_id']);
$form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id";
$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id");
$_GET['paged'] = intval($_GET['paged']);
if ( $_GET['paged'] < 1 )
@@ -948,11 +1145,11 @@ function media_upload_library_form($errors) {
<input type="hidden" name="post_mime_type" value="<?php echo attribute_escape( $_GET['post_mime_type'] ); ?>" />
<div id="search-filter">
<label class="hidden" for="post-search-input"><?php _e('Search Media');?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php echo attribute_escape( __( 'Search Media' ) ); ?>" class="button" />
</div>
<p>
<ul class="subsubsub">
<?php
$type_links = array();
@@ -968,7 +1165,7 @@ if ( empty($_GET['post_mime_type']) && !empty($num_posts[$type]) ) {
}
if ( empty($_GET['post_mime_type']) || $_GET['post_mime_type'] == 'all' )
$class = ' class="current"';
$type_links[] = "<li><a href='" . add_query_arg(array('post_mime_type'=>'all', 'paged'=>false, 'm'=>false)) . "'$class>".__('All Types')."</a>";
$type_links[] = "<li><a href='" . clean_url(add_query_arg(array('post_mime_type'=>'all', 'paged'=>false, 'm'=>false))) . "'$class>".__('All Types')."</a>";
foreach ( $post_mime_types as $mime_type => $label ) {
$class = '';
@@ -978,13 +1175,12 @@ foreach ( $post_mime_types as $mime_type => $label ) {
if ( wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
$class = ' class="current"';
$type_links[] = "<li><a href='" . add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false)) . "'$class>" . sprintf(__ngettext($label[2][0], $label[2][1], $num_posts[$mime_type]), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
$type_links[] = "<li><a href='" . clean_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf(__ngettext($label[2][0], $label[2][1], $num_posts[$mime_type]), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
}
echo implode(' | </li>', $type_links) . '</li>';
unset($type_links);
?>
</ul>
</p>
<div class="tablenav">
@@ -1059,51 +1255,84 @@ jQuery(function($){
<div id="media-items">
<?php echo get_media_items(null, $errors); ?>
</div>
<p class="ml-submit">
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
</p>
</form>
<?php
}
function type_form_image() {
if ( apply_filters( 'disable_captions', '' ) ) {
$alt = __('Alternate Text');
$alt_help = __('Alt text for the image, e.g. "The Mona Lisa"');
} else {
$alt = __('Image Caption');
$alt_help = __('Also used as alternate text for the image');
}
return '
<table class="describe"><tbody>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[src]">' . __('Image URL') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
<th valign="top" scope="row" class="label" style="width:120px;">
<span class="alignleft"><label for="src">' . __('Source') . '</label></span>
<span class="alignright"><img id="status_img" src="images/required.gif" title="required" alt="required" /></span>
</th>
<td class="field"><input id="insertonly[src]" name="insertonly[src]" value="" type="text"></td>
<td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[alt]">' . __('Description') . '</label></span>
<span class="alignleft"><label for="title">' . __('Image Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="insertonly[alt]" name="insertonly[alt]" value="" type="text"></td>
<td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td>
</tr>
<tr><td></td><td class="help">' . __('Alternate text, e.g. "The Mona Lisa"') . '</td></tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="alt">' . $alt . '</label></span>
</th>
<td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
<p class="help">' . $alt_help . '</p></td>
</tr>
<tr class="align">
<th valign="top" scope="row" class="label"><label for="insertonly[align]">' . __('Alignment') . '</label></th>
<th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
<td class="field">
<input name="insertonly[align]" id="image-align-none-0" value="none" type="radio" checked="checked" />
<label for="image-align-none-0" class="align image-align-none-label">' . __('None') . '</label>
<input name="insertonly[align]" id="image-align-left-0" value="left" type="radio" />
<label for="image-align-left-0" class="align image-align-left-label">' . __('Left') . '</label>
<input name="insertonly[align]" id="image-align-center-0" value="center" type="radio" />
<label for="image-align-center-0" class="align image-align-center-label">' . __('Center') . '</label>
<input name="insertonly[align]" id="image-align-right-0" value="right" type="radio" />
<label for="image-align-right-0" class="align image-align-right-label">' . __('Right') . '</label>
<input name="align" id="align-none" value="alignnone" onclick="addExtImage.align=this.value" type="radio" checked="checked" />
<label for="align-none" class="align image-align-none-label">' . __('None') . '</label>
<input name="align" id="align-left" value="alignleft" onclick="addExtImage.align=this.value" type="radio" />
<label for="align-left" class="align image-align-left-label">' . __('Left') . '</label>
<input name="align" id="align-center" value="aligncenter" onclick="addExtImage.align=this.value" type="radio" />
<label for="align-center" class="align image-align-center-label">' . __('Center') . '</label>
<input name="align" id="align-right" value="alignright" onclick="addExtImage.align=this.value" type="radio" />
<label for="align-right" class="align image-align-right-label">' . __('Right') . '</label>
</td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="url">' . __('Link URL') . '</label></span>
</th>
<td class="field"><input id="url" name="url" value="" type="text" /><br />
<button type="button" class="button" value="" onclick="document.forms[0].url.value=null">' . __('None') . '</button>
<button type="button" class="button" value="" onclick="document.forms[0].url.value=document.forms[0].src.value">' . __('Link to image') . '</button>
<p class="help">' . __('Enter a link URL or click above for presets.') . '</p></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" class="button" name="insertonlybutton" value="' . attribute_escape(__('Insert into Post')) . '" />
<input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . attribute_escape(__('Insert into Post')) . '" />
</td>
</tr>
</tbody></table>
';
}
function type_form_audio() {
@@ -1114,14 +1343,14 @@ function type_form_audio() {
<span class="alignleft"><label for="insertonly[href]">' . __('Audio File URL') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
</tr>
<tr><td></td><td class="help">' . __('Link text, e.g. "Still Alive by Jonathan Coulton"') . '</td></tr>
<tr>
@@ -1142,14 +1371,14 @@ function type_form_video() {
<span class="alignleft"><label for="insertonly[href]">' . __('Video URL') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
</tr>
<tr><td></td><td class="help">' . __('Link text, e.g. "Lucy on YouTube"') . '</td></tr>
<tr>
@@ -1170,14 +1399,14 @@ function type_form_file() {
<span class="alignleft"><label for="insertonly[href]">' . __('URL') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
</tr>
<tr><td></td><td class="help">' . __('Link text, e.g. "Ransom Demands (PDF)"') . '</td></tr>
<tr>
@@ -1190,6 +1419,49 @@ function type_form_file() {
';
}
// support a GET parameter for disabling the flash uploader
function media_upload_use_flash($flash) {
if ( array_key_exists('flash', $_REQUEST) )
$flash = !empty($_REQUEST['flash']);
return $flash;
}
add_filter('flash_uploader', 'media_upload_use_flash');
function media_upload_flash_bypass() {
echo '<p class="upload-flash-bypass">';
printf( __('You are using the Flash uploader. Problems? Try the <a href="%s">Browser uploader</a> instead.'), clean_url(add_query_arg('flash', 0)) );
echo '</p>';
}
add_action('post-flash-upload-ui', 'media_upload_flash_bypass');
function media_upload_html_bypass() {
echo '<p class="upload-html-bypass">';
if ( array_key_exists('flash', $_REQUEST) )
// the user manually selected the browser uploader, so let them switch back to Flash
printf( __('You are using the Browser uploader. Try the <a href="%s">Flash uploader</a> instead.'), clean_url(add_query_arg('flash', 1)) );
else
// the user probably doesn't have Flash
printf( __('You are using the Browser uploader.') );
echo '</p>';
}
add_action('post-flash-upload-ui', 'media_upload_flash_bypass');
add_action('post-html-upload-ui', 'media_upload_html_bypass');
// make sure the GET parameter sticks when we submit a form
function media_upload_bypass_url($url) {
if ( array_key_exists('flash', $_REQUEST) )
$url = add_query_arg('flash', intval($_REQUEST['flash']));
return $url;
}
add_filter('media_upload_form_url', 'media_upload_bypass_url');
add_filter('async_upload_image', 'get_media_item', 10, 2);
add_filter('async_upload_audio', 'get_media_item', 10, 2);
add_filter('async_upload_video', 'get_media_item', 10, 2);
@@ -1199,12 +1471,9 @@ add_action('media_upload_image', 'media_upload_image');
add_action('media_upload_audio', 'media_upload_audio');
add_action('media_upload_video', 'media_upload_video');
add_action('media_upload_file', 'media_upload_file');
add_action('admin_head_media_upload_type_form', 'media_admin_css');
add_filter('media_upload_gallery', 'media_upload_gallery');
add_action('admin_head_media_upload_gallery_form', 'media_admin_css');
add_filter('media_upload_library', 'media_upload_library');
add_action('admin_head_media_upload_library_form', 'media_admin_css');
?>

View File

@@ -67,7 +67,7 @@ function insert_with_markers( $filename, $marker, $insertion ) {
}
}
if (!$foundit) {
fwrite( $f, "# BEGIN {$marker}\n" );
fwrite( $f, "\n# BEGIN {$marker}\n" );
foreach ( $insertion as $insertline )
fwrite( $f, "{$insertline}\n" );
fwrite( $f, "# END {$marker}\n" );

View File

@@ -32,14 +32,15 @@ function get_plugin_data( $plugin_file ) {
}
function get_plugins($plugin_folder = '') {
global $wp_plugins;
if ( isset( $wp_plugins ) ) {
return $wp_plugins;
}
if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') )
$cache_plugins = array();
if ( isset($cache_plugins[ $plugin_folder ]) )
return $cache_plugins[ $plugin_folder ];
$wp_plugins = array ();
$plugin_root = ABSPATH . PLUGINDIR;
$plugin_root = WP_PLUGIN_DIR;
if( !empty($plugin_folder) )
$plugin_root .= $plugin_folder;
@@ -85,6 +86,9 @@ function get_plugins($plugin_folder = '') {
uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
$cache_plugins[ $plugin_folder ] = $wp_plugins;
wp_cache_set('plugins', $cache_plugins, 'plugins');
return $wp_plugins;
}
@@ -104,7 +108,7 @@ function activate_plugin($plugin, $redirect = '') {
if ( !empty($redirect) )
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error
ob_start();
@include(ABSPATH . PLUGINDIR . '/' . $plugin);
@include(WP_PLUGIN_DIR . '/' . $plugin);
$current[] = $plugin;
sort($current);
update_option('active_plugins', $current);
@@ -132,40 +136,99 @@ function deactivate_plugins($plugins, $silent= false) {
update_option('active_plugins', $current);
}
function deactivate_all_plugins() {
$current = get_option('active_plugins');
if ( empty($current) )
return;
deactivate_plugins($current);
update_option('deactivated_plugins', $current);
}
function reactivate_all_plugins($redirect = '') {
$plugins = get_option('deactivated_plugins');
if ( empty($plugins) )
return;
if ( !empty($redirect) )
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
function activate_plugins($plugins, $redirect = '') {
if ( !is_array($plugins) )
$plugins = array($plugins);
$errors = array();
foreach ( (array) $plugins as $plugin ) {
$result = activate_plugin($plugin);
if ( !empty($redirect) )
$redirect = add_query_arg('plugin', $plugin, $redirect);
$result = activate_plugin($plugin, $redirect);
if ( is_wp_error($result) )
$errors[$plugin] = $result;
}
delete_option('deactivated_plugins');
if ( !empty($errors) )
return new WP_Error('plugins_invalid', __('One of the plugins is invalid.'), $errors);
return true;
}
function delete_plugins($plugins, $redirect = '' ) {
global $wp_filesystem;
if( empty($plugins) )
return false;
$checked = array();
foreach( $plugins as $plugin )
$checked[] = 'checked[]=' . $plugin;
ob_start();
$url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-manage-plugins');
if ( false === ($credentials = request_filesystem_credentials($url)) ) {
$data = ob_get_contents();
ob_end_clean();
if( ! empty($data) ){
include_once( ABSPATH . 'wp-admin/admin-header.php');
echo $data;
include( ABSPATH . 'wp-admin/admin-footer.php');
exit;
}
return;
}
if ( ! WP_Filesystem($credentials) ) {
request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again
$data = ob_get_contents();
ob_end_clean();
if( ! empty($data) ){
include_once( ABSPATH . 'wp-admin/admin-header.php');
echo $data;
include( ABSPATH . 'wp-admin/admin-footer.php');
exit;
}
return;
}
if ( $wp_filesystem->errors->get_error_code() ) {
return $wp_filesystem->errors;
}
if ( ! is_object($wp_filesystem) )
return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
if ( $wp_filesystem->errors->get_error_code() )
return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);
//Get the base plugin folder
$plugins_dir = $wp_filesystem->wp_plugins_dir();
if ( empty($plugins_dir) )
return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));
$plugins_dir = trailingslashit( $plugins_dir );
$errors = array();
foreach( $plugins as $plugin_file ) {
$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) );
// If plugin is in its own directory, recursively delete the directory.
if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
$deleted = $wp_filesystem->delete($this_plugin_dir, true);
else
$deleted = $wp_filesystem->delete($plugins_dir . $plugin_file);
if ( ! $deleted )
$errors[] = $plugin_file;
}
if( ! empty($errors) )
return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) );
return true;
}
function validate_active_plugins() {
$check_plugins = get_option('active_plugins');
@@ -176,24 +239,25 @@ function validate_active_plugins() {
return;
}
//Invalid is any plugin that is deactivated due to error.
$invalid = array();
// If a plugin file does not exist, remove it from the list of active
// plugins.
foreach ( $check_plugins as $check_plugin ) {
if ( !file_exists(ABSPATH . PLUGINDIR . '/' . $check_plugin) ) {
$current = get_option('active_plugins');
$key = array_search($check_plugin, $current);
if ( false !== $key && NULL !== $key ) {
unset($current[$key]);
update_option('active_plugins', $current);
}
$result = validate_plugin($check_plugin);
if ( is_wp_error( $result ) ) {
$invalid[$check_plugin] = $result;
deactivate_plugins( $check_plugin, true);
}
}
return $invalid;
}
function validate_plugin($plugin) {
if ( validate_file($plugin) )
return new WP_Error('plugin_invalid', __('Invalid plugin.'));
if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) )
if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
return new WP_Error('plugin_not_found', __('Plugin file does not exist.'));
return 0;
@@ -411,18 +475,16 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
$parent = get_admin_page_parent();
$page_type = 'admin';
if ( empty ( $parent_page ) || 'admin.php' == $parent_page ) {
if ( isset( $admin_page_hooks[$plugin_page] ))
$page_type = 'toplevel';
else
if ( isset( $admin_page_hooks[$parent] ))
$page_type = $admin_page_hooks[$parent];
} else
if ( isset( $admin_page_hooks[$parent_page] ) ) {
$page_type = $admin_page_hooks[$parent_page];
} else {
$page_type = 'admin';
}
} else if ( isset( $admin_page_hooks[$parent_page] ) ) {
$page_type = $admin_page_hooks[$parent_page];
}
$plugin_name = preg_replace( '!\.php!', '', $plugin_page );

View File

@@ -1,5 +1,113 @@
<?php
/**
* _wp_translate_postdata() - Rename $_POST data from form names to DB post columns.
*
* Manipulates $_POST directly.
*
* @package WordPress
* @since 2.6
*
* @param bool $update Are we updating a pre-existing post?
* @return object|bool WP_Error on failure, true on success.
*/
function _wp_translate_postdata( $update = false ) {
if ( $update )
$_POST['ID'] = (int) $_POST['post_ID'];
$_POST['post_content'] = $_POST['content'];
$_POST['post_excerpt'] = $_POST['excerpt'];
$_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : '';
$_POST['to_ping'] = $_POST['trackback_url'];
if (!empty ( $_POST['post_author_override'] ) ) {
$_POST['post_author'] = (int) $_POST['post_author_override'];
} else {
if (!empty ( $_POST['post_author'] ) ) {
$_POST['post_author'] = (int) $_POST['post_author'];
} else {
$_POST['post_author'] = (int) $_POST['user_ID'];
}
}
if ( $_POST['post_author'] != $_POST['user_ID'] ) {
if ( 'page' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_others_pages' ) ) {
return new WP_Error( 'edit_others_pages', $update ?
__( 'You are not allowed to edit pages as this user.' ) :
__( 'You are not allowed to create pages as this user.' )
);
}
} else {
if ( !current_user_can( 'edit_others_posts' ) ) {
return new WP_Error( 'edit_others_posts', $update ?
__( 'You are not allowed to edit posts as this user.' ) :
__( 'You are not allowed to post as this user.' )
);
}
}
}
// What to do based on which button they pressed
if ( isset($_POST['saveasdraft']) && '' != $_POST['saveasdraft'] )
$_POST['post_status'] = 'draft';
if ( isset($_POST['saveasprivate']) && '' != $_POST['saveasprivate'] )
$_POST['post_status'] = 'private';
if ( isset($_POST['publish']) && ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) )
$_POST['post_status'] = 'publish';
if ( isset($_POST['advanced']) && '' != $_POST['advanced'] )
$_POST['post_status'] = 'draft';
$previous_status = get_post_field('post_status', $_POST['ID']);
// Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
// Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
if ( 'page' == $_POST['post_type'] ) {
if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) )
if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') )
$_POST['post_status'] = 'pending';
} else {
if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) :
// Stop attempts to publish new posts, but allow already published posts to be saved if appropriate.
if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') )
$_POST['post_status'] = 'pending';
endif;
}
if (!isset( $_POST['comment_status'] ))
$_POST['comment_status'] = 'closed';
if (!isset( $_POST['ping_status'] ))
$_POST['ping_status'] = 'closed';
foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
$_POST['edit_date'] = '1';
break;
}
}
if ( !empty( $_POST['edit_date'] ) ) {
$aa = $_POST['aa'];
$mm = $_POST['mm'];
$jj = $_POST['jj'];
$hh = $_POST['hh'];
$mn = $_POST['mn'];
$ss = $_POST['ss'];
$aa = ($aa <= 0 ) ? date('Y') : $aa;
$mm = ($mm <= 0 ) ? date('n') : $mm;
$jj = ($jj > 31 ) ? 31 : $jj;
$jj = ($jj <= 0 ) ? date('j') : $jj;
$hh = ($hh > 23 ) ? $hh -24 : $hh;
$mn = ($mn > 59 ) ? $mn -60 : $mn;
$ss = ($ss > 59 ) ? $ss -60 : $ss;
$_POST['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
$_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] );
}
return true;
}
// Update an existing post with values provided in $_POST.
function edit_post() {
@@ -23,78 +131,9 @@ function edit_post() {
return $post_ID;
}
// Rename.
$_POST['ID'] = (int) $_POST['post_ID'];
$_POST['post_content'] = $_POST['content'];
$_POST['post_excerpt'] = $_POST['excerpt'];
$_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : '';
$_POST['to_ping'] = $_POST['trackback_url'];
if (!empty ( $_POST['post_author_override'] ) ) {
$_POST['post_author'] = (int) $_POST['post_author_override'];
} else
if (!empty ( $_POST['post_author'] ) ) {
$_POST['post_author'] = (int) $_POST['post_author'];
} else {
$_POST['post_author'] = (int) $_POST['user_ID'];
}
if ( $_POST['post_author'] != $_POST['user_ID'] ) {
if ( 'page' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_others_pages' ) )
wp_die( __('You are not allowed to edit pages as this user.' ));
} else {
if ( !current_user_can( 'edit_others_posts' ) )
wp_die( __('You are not allowed to edit posts as this user.' ));
}
}
// What to do based on which button they pressed
if ( isset($_POST['saveasdraft']) && '' != $_POST['saveasdraft'] )
$_POST['post_status'] = 'draft';
if ( isset($_POST['saveasprivate']) && '' != $_POST['saveasprivate'] )
$_POST['post_status'] = 'private';
if ( isset($_POST['publish']) && ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) )
$_POST['post_status'] = 'publish';
if ( isset($_POST['advanced']) && '' != $_POST['advanced'] )
$_POST['post_status'] = 'draft';
if ( 'page' == $_POST['post_type'] ) {
if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ))
$_POST['post_status'] = 'pending';
} else {
if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ))
$_POST['post_status'] = 'pending';
}
if (!isset( $_POST['comment_status'] ))
$_POST['comment_status'] = 'closed';
if (!isset( $_POST['ping_status'] ))
$_POST['ping_status'] = 'closed';
foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
$_POST['edit_date'] = '1';
break;
}
}
if (!empty ( $_POST['edit_date'] ) ) {
$aa = $_POST['aa'];
$mm = $_POST['mm'];
$jj = $_POST['jj'];
$hh = $_POST['hh'];
$mn = $_POST['mn'];
$ss = $_POST['ss'];
$jj = ($jj > 31 ) ? 31 : $jj;
$hh = ($hh > 23 ) ? $hh -24 : $hh;
$mn = ($mn > 59 ) ? $mn -60 : $mn;
$ss = ($ss > 59 ) ? $ss -60 : $ss;
$_POST['post_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
$_POST['post_date_gmt'] = get_gmt_from_date( "$aa-$mm-$jj $hh:$mn:$ss" );
}
$translated = _wp_translate_postdata( true );
if ( is_wp_error($translated) )
wp_die( $translated->get_error_message() );
// Meta Stuff
if ( isset($_POST['meta']) && $_POST['meta'] ) {
@@ -194,13 +233,13 @@ function post_exists($title, $content = '', $post_date = '') {
global $wpdb;
if (!empty ($post_date))
$post_date = "AND post_date = '$post_date'";
$post_date = $wpdb->prepare("AND post_date = %s", $post_date);
if (!empty ($title))
return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$title' $post_date");
return $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title = %s $post_date", $title) );
else
if (!empty ($content))
return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_content = '$content' $post_date");
return $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_content = %s $post_date", $content) );
return 0;
}
@@ -236,79 +275,9 @@ function wp_write_post() {
}
}
// Rename.
$_POST['post_content'] = $_POST['content'];
$_POST['post_excerpt'] = $_POST['excerpt'];
$_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : '';
$_POST['to_ping'] = $_POST['trackback_url'];
if (!empty ( $_POST['post_author_override'] ) ) {
$_POST['post_author'] = (int) $_POST['post_author_override'];
} else {
if (!empty ( $_POST['post_author'] ) ) {
$_POST['post_author'] = (int) $_POST['post_author'];
} else {
$_POST['post_author'] = (int) $_POST['user_ID'];
}
}
if ( $_POST['post_author'] != $_POST['user_ID'] ) {
if ( 'page' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_others_pages' ) )
return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
} else {
if ( !current_user_can( 'edit_others_posts' ) )
return new WP_Error( 'edit_others_posts', __( 'You are not allowed to post as this user.' ) );
}
}
// What to do based on which button they pressed
if ( isset($_POST['saveasdraft']) && '' != $_POST['saveasdraft'] )
$_POST['post_status'] = 'draft';
if ( isset($_POST['saveasprivate']) && '' != $_POST['saveasprivate'] )
$_POST['post_status'] = 'private';
if ( isset($_POST['publish']) && ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) )
$_POST['post_status'] = 'publish';
if ( isset($_POST['advanced']) && '' != $_POST['advanced'] )
$_POST['post_status'] = 'draft';
if ( 'page' == $_POST['post_type'] ) {
if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) )
$_POST['post_status'] = 'pending';
} else {
if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) )
$_POST['post_status'] = 'pending';
}
if (!isset( $_POST['comment_status'] ))
$_POST['comment_status'] = 'closed';
if (!isset( $_POST['ping_status'] ))
$_POST['ping_status'] = 'closed';
foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
$_POST['edit_date'] = '1';
break;
}
}
if (!empty ( $_POST['edit_date'] ) ) {
$aa = $_POST['aa'];
$mm = $_POST['mm'];
$jj = $_POST['jj'];
$hh = $_POST['hh'];
$mn = $_POST['mn'];
$ss = $_POST['ss'];
$jj = ($jj > 31 ) ? 31 : $jj;
$hh = ($hh > 23 ) ? $hh -24 : $hh;
$mn = ($mn > 59 ) ? $mn -60 : $mn;
$ss = ($ss > 59 ) ? $ss -60 : $ss;
$_POST['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
$_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] );
}
$translated = _wp_translate_postdata( false );
if ( is_wp_error($translated) )
return $translated;
// Create the post.
$post_ID = wp_insert_post( $_POST );
@@ -380,11 +349,9 @@ function add_meta( $post_ID ) {
wp_cache_delete($post_ID, 'post_meta');
$wpdb->query( "
INSERT INTO $wpdb->postmeta
(post_id,meta_key,meta_value )
VALUES ('$post_ID','$metakey','$metavalue' )
" );
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta
(post_id,meta_key,meta_value ) VALUES (%s, %s, %s)",
$post_ID, $metakey, $metavalue) );
return $wpdb->insert_id;
}
return false;
@@ -394,10 +361,10 @@ function delete_meta( $mid ) {
global $wpdb;
$mid = (int) $mid;
$post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = '$mid'");
$post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
wp_cache_delete($post_id, 'post_meta');
return $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'" );
return $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
}
// Get a list of previously defined keys
@@ -417,7 +384,7 @@ function get_post_meta_by_id( $mid ) {
global $wpdb;
$mid = (int) $mid;
$meta = $wpdb->get_row( "SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'" );
$meta = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
if ( is_serialized_string( $meta->meta_value ) )
$meta->meta_value = maybe_unserialize( $meta->meta_value );
return $meta;
@@ -427,29 +394,30 @@ function get_post_meta_by_id( $mid ) {
function has_meta( $postid ) {
global $wpdb;
return $wpdb->get_results( "
SELECT meta_key, meta_value, meta_id, post_id
FROM $wpdb->postmeta
WHERE post_id = '$postid'
ORDER BY meta_key,meta_id", ARRAY_A );
return $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value, meta_id, post_id
FROM $wpdb->postmeta WHERE post_id = %d
ORDER BY meta_key,meta_id", $postid), ARRAY_A );
}
function update_meta( $mid, $mkey, $mvalue ) {
function update_meta( $meta_id, $meta_key, $meta_value ) {
global $wpdb;
$protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
if ( in_array($mkey, $protected) )
if ( in_array($meta_key, $protected) )
return false;
$post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = '$mid'");
$post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) );
wp_cache_delete($post_id, 'post_meta');
$mvalue = maybe_serialize( stripslashes( $mvalue ));
$mvalue = $wpdb->escape( $mvalue );
$mid = (int) $mid;
return $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'" );
$meta_value = maybe_serialize( stripslashes( $meta_value ));
$meta_id = (int) $meta_id;
$data = compact( 'meta_key', 'meta_value' );
$where = compact( 'meta_id' );
return $wpdb->update( $wpdb->postmeta, $data, $where );
}
//
@@ -502,7 +470,7 @@ function _relocate_children( $old_ID, $new_ID ) {
global $wpdb;
$old_ID = (int) $old_ID;
$new_ID = (int) $new_ID;
return $wpdb->query( "UPDATE $wpdb->posts SET post_parent = $new_ID WHERE post_parent = $old_ID" );
return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE post_parent = %d", $new_ID, $old_ID) );
}
function get_available_post_statuses($type = 'post') {
@@ -631,11 +599,10 @@ function get_sample_permalink($id, $title=null, $name = null) {
$permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);
}
$permalink = array($permalink, $post->post_name);
$permalink = array($permalink, apply_filters('editable_slug', $post->post_name));
$post->post_status = $original_status;
$post->post_date = $original_date;
$post->post_name = $original_name;
$post->post_title = $original_title;
return $permalink;
}
@@ -691,4 +658,28 @@ function wp_set_post_lock( $post_id ) {
update_post_meta( $post->ID, '_edit_last', $current_user->ID );
}
?>
/**
* wp_create_post_autosave() - creates autosave data for the specified post from $_POST data
*
* @package WordPress
* @subpackage Post Revisions
* @since 2.6
*
* @uses _wp_translate_postdata()
* @uses _wp_post_revision_fields()
*/
function wp_create_post_autosave( $post_id ) {
$translated = _wp_translate_postdata( true );
if ( is_wp_error( $translated ) )
return $translated;
// Only store one autosave. If there is already an autosave, overwrite it.
if ( $old_autosave = wp_get_post_autosave( $post_id ) ) {
$new_autosave = _wp_post_revision_fields( $_POST, true );
$new_autosave['ID'] = $old_autosave->ID;
return wp_update_post( $new_autosave );
}
// Otherwise create the new autosave as a special post revision
return _wp_put_post_revision( $_POST, true );
}

View File

@@ -15,11 +15,12 @@ if ( $wpdb->supports_collation() ) {
$wp_queries="CREATE TABLE $wpdb->terms (
term_id bigint(20) NOT NULL auto_increment,
name varchar(55) NOT NULL default '',
name varchar(200) NOT NULL default '',
slug varchar(200) NOT NULL default '',
term_group bigint(10) NOT NULL default 0,
PRIMARY KEY (term_id),
UNIQUE KEY slug (slug)
UNIQUE KEY slug (slug),
KEY name (name)
) $charset_collate;
CREATE TABLE $wpdb->term_taxonomy (
term_taxonomy_id bigint(20) NOT NULL auto_increment,
@@ -153,9 +154,11 @@ CREATE TABLE $wpdb->usermeta (
function populate_options() {
global $wpdb, $wp_db_version;
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
$guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$guessurl = wp_guess_url();
do_action('populate_options');
add_option('siteurl', $guessurl);
add_option('blogname', __('My Blog'));
add_option('blogdescription', __('Just another WordPress weblog'));
@@ -223,10 +226,10 @@ function populate_options() {
if ( ini_get('safe_mode') ) {
// Safe mode screws up mkdir(), so we must use a flat structure.
add_option('uploads_use_yearmonth_folders', 0);
add_option('upload_path', 'wp-content');
add_option('upload_path', WP_CONTENT_DIR);
} else {
add_option('uploads_use_yearmonth_folders', 1);
add_option('upload_path', 'wp-content/uploads');
add_option('upload_path', WP_CONTENT_DIR . '/uploads');
}
// 2.0.3
@@ -250,8 +253,13 @@ function populate_options() {
add_option('medium_size_w', 300);
add_option('medium_size_h', 300);
// 2.6
add_option('avatar_default', 'mystery');
add_option('enable_app', 0);
add_option('enable_xmlrpc', 0);
// Delete unused options
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval');
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins');
foreach ($unusedoptions as $option) :
delete_option($option);
endforeach;
@@ -268,6 +276,7 @@ function populate_roles() {
populate_roles_210();
populate_roles_230();
populate_roles_250();
populate_roles_260();
}
function populate_roles_160() {
@@ -423,4 +432,13 @@ function populate_roles_250() {
}
}
function populate_roles_260() {
$role = get_role( 'administrator' );
if ( !empty( $role ) ) {
$role->add_cap( 'update_plugins' );
$role->add_cap( 'delete_plugins' );
}
}
?>

View File

@@ -47,7 +47,7 @@ function wp_delete_category($cat_ID) {
if ( $cat_ID == $default )
return 0;
return wp_delete_term($cat_ID, 'category', "default=$default");
return wp_delete_term($cat_ID, 'category', array('default' => $default));
}
function wp_insert_category($catarr, $wp_error = false) {
@@ -133,7 +133,7 @@ function get_tags_to_edit( $post_id ) {
foreach ( $tags as $tag )
$tag_names[] = $tag->name;
$tags_to_edit = join( ', ', $tag_names );
$tags_to_edit = join( ',', $tag_names );
$tags_to_edit = attribute_escape( $tags_to_edit );
$tags_to_edit = apply_filters( 'tags_to_edit', $tags_to_edit );
return $tags_to_edit;

View File

@@ -4,35 +4,73 @@
// Big Mess
//
// Dandy new recursive multiple category stuff.
function cat_rows( $parent = 0, $level = 0, $categories = 0 ) {
if ( !$categories ) {
// Ugly recursive category stuff.
function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) {
$count = 0;
_cat_rows($categories, $count, $parent, $level, $page, $per_page);
}
function _cat_rows( $categories, &$count, $parent = 0, $level = 0, $page = 1, $per_page = 20 ) {
if ( empty($categories) ) {
$args = array('hide_empty' => 0);
if ( !empty($_GET['s']) )
$args['search'] = $_GET['s'];
$categories = get_categories( $args );
}
if ( !$categories )
return false;
$children = _get_term_hierarchy('category');
if ( $categories ) {
ob_start();
foreach ( $categories as $category ) {
if ( $category->parent == $parent) {
echo "\t" . _cat_row( $category, $level );
if ( isset($children[$category->term_id]) )
cat_rows( $category->term_id, $level +1, $categories );
$start = ($page - 1) * $per_page;
$end = $start + $per_page;
$i = -1;
ob_start();
foreach ( $categories as $category ) {
if ( $count >= $end )
break;
$i++;
if ( $category->parent != $parent )
continue;
// If the page starts in a subtree, print the parents.
if ( $count == $start && $category->parent > 0 ) {
$my_parents = array();
$my_parent = $category->parent;
while ( $my_parent) {
$my_parent = get_category($my_parent);
$my_parents[] = $my_parent;
if ( !$my_parent->parent )
break;
$my_parent = $my_parent->parent;
}
$num_parents = count($my_parents);
while( $my_parent = array_pop($my_parents) ) {
echo "\t" . _cat_row( $my_parent, $level - $num_parents );
$num_parents--;
}
}
$output = ob_get_contents();
ob_end_clean();
$output = apply_filters('cat_rows', $output);
if ( $count >= $start )
echo "\t" . _cat_row( $category, $level );
unset($categories[$i]); // Prune the working set
$count++;
if ( isset($children[$category->term_id]) )
_cat_rows( $categories, $count, $category->term_id, $level + 1, $page, $per_page );
echo $output;
} else {
return false;
}
$output = ob_get_contents();
ob_end_clean();
$output = apply_filters('cat_rows', $output);
echo $output;
}
function _cat_row( $category, $level, $name_override = false ) {
@@ -148,19 +186,24 @@ class Walker_Category_Checklist extends Walker {
}
}
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false ) {
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) {
$walker = new Walker_Category_Checklist;
$descendants_and_self = (int) $descendants_and_self;
$args = array();
if ( $post_id )
if ( is_array( $selected_cats ) )
$args['selected_cats'] = $selected_cats;
elseif ( $post_id )
$args['selected_cats'] = wp_get_post_categories($post_id);
else
$args['selected_cats'] = array();
if ( is_array( $selected_cats ) )
$args['selected_cats'] = $selected_cats;
$args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
if ( is_array( $popular_cats ) )
$args['popular_cats'] = $popular_cats;
else
$args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
if ( $descendants_and_self ) {
$categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" );
$self = get_category( $descendants_and_self );
@@ -169,13 +212,22 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select
$categories = get_categories('get=all');
}
$args = array($categories, 0, $args);
$output = call_user_func_array(array(&$walker, 'walk'), $args);
// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
$checked_categories = array();
for ( $i = 0; isset($categories[$i]); $i++ ) {
if ( in_array($categories[$i]->term_id, $args['selected_cats']) ) {
$checked_categories[] = $categories[$i];
unset($categories[$i]);
}
}
echo $output;
// Put checked cats on top
echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args));
// Then the rest of them
echo call_user_func_array(array(&$walker, 'walk'), array($categories, 0, $args));
}
function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10 ) {
function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
global $post_ID;
if ( $post_ID )
$checked_categories = wp_get_post_categories($post_ID);
@@ -186,6 +238,8 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10 ) {
$popular_ids = array();
foreach ( (array) $categories as $category ) {
$popular_ids[] = $category->term_id;
if ( !$echo ) // hack for AJAX use
continue;
$id = "popular-category-$category->term_id";
?>
@@ -286,7 +340,7 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {
// define the columns to display, the syntax is 'internal name' => 'display name'
function wp_manage_posts_columns() {
$posts_columns = array();
$posts_columns['cb'] = '<input type="checkbox" onclick="checkAll(document.getElementById(\'posts-filter\'));" />';
$posts_columns['cb'] = '<input type="checkbox" />';
if ( 'draft' === $_GET['post_status'] )
$posts_columns['modified'] = __('Modified');
elseif ( 'pending' === $_GET['post_status'] )
@@ -308,7 +362,7 @@ function wp_manage_posts_columns() {
// define the columns to display, the syntax is 'internal name' => 'display name'
function wp_manage_media_columns() {
$posts_columns = array();
$posts_columns['cb'] = '<input type="checkbox" onclick="checkAll(document.getElementById(\'posts-filter\'));" />';
$posts_columns['cb'] = '<input type="checkbox" />';
$posts_columns['icon'] = '';
$posts_columns['media'] = _c('Media|media column header');
$posts_columns['desc'] = _c('Description|media column header');
@@ -323,7 +377,7 @@ function wp_manage_media_columns() {
function wp_manage_pages_columns() {
$posts_columns = array();
$posts_columns['cb'] = '<input type="checkbox" onclick="checkAll(document.getElementById(\'posts-filter\'));" />';
$posts_columns['cb'] = '<input type="checkbox" />';
if ( 'draft' === $_GET['post_status'] )
$posts_columns['modified'] = __('Modified');
elseif ( 'pending' === $_GET['post_status'] )
@@ -344,7 +398,7 @@ function wp_manage_pages_columns() {
* display one row if the page doesn't have any children
* otherwise, display the row and its children in subsequent rows
*/
function display_page_row( $page, &$children_pages, $level = 0 ) {
function display_page_row( $page, $level = 0 ) {
global $post;
static $class;
@@ -468,66 +522,126 @@ foreach ($posts_columns as $column_name=>$column_display_name) {
</tr>
<?php
}
if ( ! $children_pages )
return true;
/*
* displays pages in hierarchical order with paging support
*/
function page_rows($pages, $pagenum = 1, $per_page = 20) {
$level = 0;
for ( $i = 0; $i < count($children_pages); $i++ ) {
if ( ! $pages ) {
$pages = get_pages( array('sort_column' => 'menu_order') );
$child = $children_pages[$i];
if ( ! $pages )
return false;
}
if ( $child->post_parent == $id ) {
array_splice($children_pages, $i, 1);
display_page_row($child, $children_pages, $level+1);
$i = -1; //as numeric keys in $children_pages are not preserved after splice
/*
* arrange pages into two parts: top level pages and children_pages
* children_pages is two dimensional array, eg.
* children_pages[10][] contains all sub-pages whose parent is 10.
* It only takes O(N) to arrange this and it takes O(1) for subsequent lookup operations
* If searching, ignore hierarchy and treat everything as top level
*/
if ( empty($_GET['s']) ) {
$top_level_pages = array();
$children_pages = array();
foreach ( $pages as $page ) {
// catch and repair bad pages
if ( $page->post_parent == $page->ID ) {
$page->post_parent = 0;
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) );
clean_page_cache( $page->ID );
}
if ( 0 == $page->post_parent )
$top_level_pages[] = $page;
else
$children_pages[ $page->post_parent ][] = $page;
}
$pages = &$top_level_pages;
}
$count = 0;
$start = ($pagenum - 1) * $per_page;
$end = $start + $per_page;
foreach ( $pages as $page ) {
if ( $count >= $end )
break;
if ( $count >= $start )
echo "\t" . display_page_row( $page, $level );
$count++;
if ( isset($children_pages) )
_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
}
// if it is the last pagenum and there are orphaned pages, display them with paging as well
if ( isset($children_pages) && $count < $end ){
foreach( $children_pages as $orphans ){
foreach ( $orphans as $op ) {
if ( $count >= $end )
break;
if ( $count >= $start )
echo "\t" . display_page_row( $op, 0 );
$count++;
}
}
}
}
/*
* displays pages in hierarchical order
* Given a top level page ID, display the nested hierarchy of sub-pages
* together with paging support
*/
function page_rows( $pages ) {
if ( ! $pages )
$pages = get_pages( 'sort_column=menu_order' );
if ( ! $pages )
return false;
// splice pages into two parts: those without parent and those with parent
$top_level_pages = array();
$children_pages = array();
foreach ( $pages as $page ) {
// catch and repair bad pages
if ( $page->post_parent == $page->ID ) {
$page->post_parent = 0;
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) );
clean_page_cache( $page->ID );
function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
if ( ! isset( $children_pages[$parent] ) )
return;
$start = ($pagenum - 1) * $per_page;
$end = $start + $per_page;
foreach ( $children_pages[$parent] as $page ) {
if ( $count >= $end )
break;
// If the page starts in a subtree, print the parents.
if ( $count == $start && $page->post_parent > 0 ) {
$my_parents = array();
$my_parent = $page->post_parent;
while ( $my_parent) {
$my_parent = get_post($my_parent);
$my_parents[] = $my_parent;
if ( !$my_parent->post_parent )
break;
$my_parent = $my_parent->post_parent;
}
$num_parents = count($my_parents);
while( $my_parent = array_pop($my_parents) ) {
echo "\t" . display_page_row( $my_parent, $level - $num_parents );
$num_parents--;
}
}
if ( 0 == $page->post_parent )
$top_level_pages[] = $page;
else
$children_pages[] = $page;
if ( $count >= $start )
echo "\t" . display_page_row( $page, $level );
$count++;
_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
}
foreach ( $top_level_pages as $page )
display_page_row($page, $children_pages, 0);
/*
* display the remaining children_pages which are orphans
* having orphan requires parental attention
*/
if ( count($children_pages) > 0 ) {
$empty_array = array();
foreach ( $children_pages as $orphan_page ) {
clean_page_cache( $orphan_page->ID);
display_page_row( $orphan_page, $empty_array, 0 );
}
}
unset( $children_pages[$parent] ); //required in order to keep track of orphans
}
function user_row( $user_object, $style = '', $role = '' ) {
@@ -556,7 +670,7 @@ function user_row( $user_object, $style = '', $role = '' ) {
} else {
$edit = $user_object->user_login;
}
$role_name = translate_with_context($wp_roles->role_names[$role]);
$role_name = $wp_roles->role_names[$role] ? translate_with_context($wp_roles->role_names[$role]) : __('None');
$r = "<tr id='user-$user_object->ID'$style>
<th scope='row' class='check-column'><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' /></th>
<td><strong>$edit</strong></td>
@@ -675,21 +789,22 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true
$actions = array();
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';
// we're looking at list of only approved or only unapproved comments
if ( 'moderated' == $comment_status ) {
$actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';
$actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';
unset($actions['unapprove']);
} elseif ( 'approved' == $comment_status ) {
$actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';
$actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';
unset($actions['approve']);
}
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | ';
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>';
$actions = apply_filters( 'comment_row_actions', $actions, $comment );
foreach ( $actions as $action => $link )
echo "<span class='$action'>$link</span>";
}
@@ -701,7 +816,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true
function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
if (!$categories )
$categories = get_categories( 'hide_empty=0' );
$categories = get_categories( array('hide_empty' => 0) );
if ( $categories ) {
foreach ( $categories as $category ) {
@@ -774,8 +889,8 @@ function _list_meta_row( $entry, &$count ) {
$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );
$r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>";
$r .= "\n\t\t<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>";
$r .= "\n\t\t<td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>";
$r .= "\n\t\t<td valign='top'><label class='hidden' for='meta[{$entry['meta_id']}][key]'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>";
$r .= "\n\t\t<td><label class='hidden' for='meta[{$entry['meta_id']}][value]'>" . __( 'Value' ) . "</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>";
$r .= "\n\t\t<td style='text-align: center;'><input name='updatemeta' type='submit' tabindex='6' value='".attribute_escape(__( 'Update' ))."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /><br />";
$r .= "\n\t\t<input name='deletemeta[{$entry['meta_id']}]' type='submit' ";
$r .= "class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='".attribute_escape(__( 'Delete' ))."' />";
@@ -800,8 +915,8 @@ function meta_form() {
<p><strong><?php _e( 'Add a new custom field:' ) ?></strong></p>
<table id="newmeta" cellspacing="3" cellpadding="3">
<tr>
<th colspan="2"><?php _e( 'Key' ) ?></th>
<th><?php _e( 'Value' ) ?></th>
<th colspan="2"><label <?php if ( $keys ) : ?> for="metakeyselect" <?php else : ?> for="metakeyinput" <?php endif; ?>><?php _e( 'Key' ) ?></label></th>
<th><label for="metavalue"><?php _e( 'Value' ) ?></label></th>
</tr>
<tr valign="top">
<td style="width: 18%;" class="textright">
@@ -815,7 +930,7 @@ function meta_form() {
echo "\n\t<option value='$key'>$key</option>";
}
?>
</select> <?php _e( 'or' ); ?>
</select> <label for="metakeyinput"><?php _e( 'or' ); ?></label>
<?php endif; ?>
</td>
<td><input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" /></td>
@@ -823,7 +938,7 @@ function meta_form() {
</tr>
<tr class="submit"><td colspan="3">
<?php wp_nonce_field( 'add-meta', '_ajax_nonce', false ); ?>
<input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta::post_id=<?php echo $GLOBALS['post_ID'] ? $GLOBALS['post_ID'] : $GLOBALS['temp_ID']; ?>" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" />
<input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" />
</td></tr>
</table>
<?php
@@ -888,7 +1003,7 @@ function page_template_dropdown( $default = '' ) {
function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
global $wpdb, $post_ID;
$items = $wpdb->get_results( "SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_type = 'page' ORDER BY menu_order" );
$items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );
if ( $items ) {
foreach ( $items as $item ) {
@@ -1041,8 +1156,83 @@ function wp_remember_old_slug() {
* @param string $callback Function that fills the box with the desired content. The function should echo its output.
* @param string $page The type of edit page on which to show the box (post, page, link)
* @param string $context The context within the page where the boxes should show ('normal', 'advanced')
* @param string $priority The priority within the context where the boxes should show ('high', 'low')
*/
function add_meta_box($id, $title, $callback, $page, $context = 'advanced') {
function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') {
global $wp_meta_boxes;
if ( !isset($wp_meta_boxes) )
$wp_meta_boxes = array();
if ( !isset($wp_meta_boxes[$page]) )
$wp_meta_boxes[$page] = array();
if ( !isset($wp_meta_boxes[$page][$context]) )
$wp_meta_boxes[$page][$context] = array();
foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
if ( !isset($wp_meta_boxes[$page][$context][$a_priority][$id]) )
continue;
// If a core box was previously added or removed by a plugin, don't add.
if ( 'core' == $priority ) {
// If core box previously deleted, don't add
if ( false === $wp_meta_boxes[$page][$context][$a_priority][$id] )
return;
// If box was added with default priority, give it core priority to maintain sort order
if ( 'default' == $a_priority ) {
$wp_meta_boxes[$page][$context]['core'][$id] = $wp_meta_boxes[$page][$context]['default'][$id];
unset($wp_meta_boxes[$page][$context]['default'][$id]);
}
return;
}
// If no priority given and id already present, use existing priority
if ( empty($priority) )
$priority = $a_priority;
// An id can be in only one priority
if ( $priority != $a_priority )
unset($wp_meta_boxes[$page][$context][$a_priority][$id]);
}
if ( empty($priority) )
$priority = low;
if ( !isset($wp_meta_boxes[$page][$context][$priority]) )
$wp_meta_boxes[$page][$context][$priority] = array();
$wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
}
function do_meta_boxes($page, $context, $object) {
global $wp_meta_boxes;
do_action('do_meta_boxes', $page, $context, $object);
if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
return;
foreach ( array('high', 'core', 'default', 'low') as $priority ) {
foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
if ( false === $box )
continue;
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n";
echo "<h3>{$box['title']}</h3>\n";
echo '<div class="inside">' . "\n";
call_user_func($box['callback'], $object, $box);
echo "</div>\n";
echo "</div>\n";
}
}
}
/**
* remove_meta_box() - Remove a meta box from an edit form
*
* @since 2.6
*
* @param string $id String for use in the 'id' attribute of tags.
* @param string $page The type of edit page on which to show the box (post, page, link)
* @param string $context The context within the page where the boxes should show ('normal', 'advanced')
*/
function remove_meta_box($id, $page, $context) {
global $wp_meta_boxes;
if ( !isset($wp_meta_boxes) )
@@ -1052,23 +1242,8 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced') {
if ( !isset($wp_meta_boxes[$page][$context]) )
$wp_meta_boxes[$page][$context] = array();
$wp_meta_boxes[$page][$context][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
}
function do_meta_boxes($page, $context, $object) {
global $wp_meta_boxes;
if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
return;
foreach ( (array) $wp_meta_boxes[$page][$context] as $box ) {
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n";
echo "<h3>{$box['title']}</h3>\n";
echo '<div class="inside">' . "\n";
call_user_func($box['callback'], $object, $box);
echo "</div>\n";
echo "</div>\n";
}
foreach ( array('high', 'core', 'default', 'low') as $priority )
$wp_meta_boxes[$page][$context][$priority][$id] = false;
}
?>

View File

@@ -33,7 +33,7 @@ function get_page_templates() {
if ( is_array( $templates ) ) {
foreach ( $templates as $template ) {
$template_data = implode( '', file( ABSPATH.$template ));
$template_data = implode( '', file( WP_CONTENT_DIR.$template ));
preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
preg_match( '|Description:(.*)$|mi', $template_data, $description );

View File

@@ -53,90 +53,24 @@ function update_right_now_message() {
echo "<span id='wp-version-message'>$msg</span>";
}
function wp_update_plugins() {
global $wp_version;
if ( !function_exists('fsockopen') )
return false;
$plugins = get_plugins();
$active = get_option( 'active_plugins' );
$current = get_option( 'update_plugins' );
$new_option = '';
$new_option->last_checked = time();
$plugin_changed = false;
foreach ( $plugins as $file => $p ) {
$new_option->checked[ $file ] = $p['Version'];
if ( !isset( $current->checked[ $file ] ) ) {
$plugin_changed = true;
continue;
}
if ( strval($current->checked[ $file ]) !== strval($p['Version']) )
$plugin_changed = true;
}
if (
isset( $current->last_checked ) &&
43200 > ( time() - $current->last_checked ) &&
!$plugin_changed
)
return false;
$to_send->plugins = $plugins;
$to_send->active = $active;
$send = serialize( $to_send );
$request = 'plugins=' . urlencode( $send );
$http_request = "POST /plugins/update-check/1.0/ HTTP/1.0\r\n";
$http_request .= "Host: api.wordpress.org\r\n";
$http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";
$http_request .= "Content-Length: " . strlen($request) . "\r\n";
$http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";
$http_request .= "\r\n";
$http_request .= $request;
$response = '';
if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) {
fwrite($fs, $http_request);
while ( !feof($fs) )
$response .= fgets($fs, 1160); // One TCP-IP packet
fclose($fs);
$response = explode("\r\n\r\n", $response, 2);
}
$response = unserialize( $response[1] );
if ( $response )
$new_option->response = $response;
update_option( 'update_plugins', $new_option );
}
add_action( 'load-plugins.php', 'wp_update_plugins' );
function wp_plugin_update_row( $file ) {
global $plugin_data;
function wp_plugin_update_row( $file, $plugin_data ) {
$current = get_option( 'update_plugins' );
if ( !isset( $current->response[ $file ] ) )
return false;
$r = $current->response[ $file ];
echo "<tr><td colspan='5' class='plugin-update'>";
if ( !current_user_can('edit_plugins') )
echo '<tr><td colspan="5" class="plugin-update">';
if ( ! current_user_can('update_plugins') )
printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.'), $plugin_data['Name'], $r->url, $r->new_version);
else if ( empty($r->package) )
printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> <em>automatic upgrade unavailable for this plugin</em>.'), $plugin_data['Name'], $r->url, $r->new_version);
else
printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url("update.php?action=upgrade-plugin&amp;plugin=$file", 'upgrade-plugin_' . $file) );
printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url('update.php?action=upgrade-plugin&amp;plugin=' . $file, 'upgrade-plugin_' . $file) );
echo "</td></tr>";
echo '</td></tr>';
}
add_action( 'after_plugin_row', 'wp_plugin_update_row' );
add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 );
function wp_update_plugin($plugin, $feedback = '') {
global $wp_filesystem;
@@ -150,7 +84,7 @@ function wp_update_plugin($plugin, $feedback = '') {
return new WP_Error('up_to_date', __('The plugin is at the latest version.'));
// Is a filesystem accessor setup?
if ( ! $wp_filesystem || !is_object($wp_filesystem) )
if ( ! $wp_filesystem || ! is_object($wp_filesystem) )
WP_Filesystem();
if ( ! is_object($wp_filesystem) )
@@ -159,11 +93,18 @@ function wp_update_plugin($plugin, $feedback = '') {
if ( $wp_filesystem->errors->get_error_code() )
return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);
//Get the Base folder
$base = $wp_filesystem->get_base_dir();
//Get the base plugin folder
$plugins_dir = $wp_filesystem->wp_plugins_dir();
if ( empty($plugins_dir) )
return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));
//And the same for the Content directory.
$content_dir = $wp_filesystem->wp_content_dir();
if( empty($content_dir) )
return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).'));
if ( empty($base) )
return new WP_Error('fs_nowordpress', __('Unable to locate WordPress directory.'));
$plugins_dir = trailingslashit( $plugins_dir );
$content_dir = trailingslashit( $content_dir );
// Get the URL to the zip file
$r = $current->response[ $plugin ];
@@ -174,12 +115,12 @@ function wp_update_plugin($plugin, $feedback = '') {
// Download the package
$package = $r->package;
apply_filters('update_feedback', sprintf(__('Downloading update from %s'), $package));
$file = download_url($package);
$download_file = download_url($package);
if ( is_wp_error($file) )
return new WP_Error('download_failed', __('Download failed.'), $file->get_error_message());
if ( is_wp_error($download_file) )
return new WP_Error('download_failed', __('Download failed.'), $download_file->get_error_message());
$working_dir = $base . 'wp-content/upgrade/' . basename($plugin, '.php');
$working_dir = $content_dir . 'upgrade/' . basename($plugin, '.php');
// Clean up working directory
if ( $wp_filesystem->is_dir($working_dir) )
@@ -187,16 +128,16 @@ function wp_update_plugin($plugin, $feedback = '') {
apply_filters('update_feedback', __('Unpacking the update'));
// Unzip package to working directory
$result = unzip_file($file, $working_dir);
$result = unzip_file($download_file, $working_dir);
// Once extracted, delete the package
unlink($download_file);
if ( is_wp_error($result) ) {
unlink($file);
$wp_filesystem->delete($working_dir, true);
return $result;
}
// Once extracted, delete the package
unlink($file);
if ( is_plugin_active($plugin) ) {
//Deactivate the plugin silently, Prevent deactivation hooks from running.
apply_filters('update_feedback', __('Deactivating the plugin'));
@@ -205,25 +146,25 @@ function wp_update_plugin($plugin, $feedback = '') {
// Remove the existing plugin.
apply_filters('update_feedback', __('Removing the old version of the plugin'));
$plugin_dir = dirname($base . PLUGINDIR . "/$plugin");
$plugin_dir = trailingslashit($plugin_dir);
$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
// If plugin is in its own directory, recursively delete the directory.
if ( strpos($plugin, '/') && $plugin_dir != $base . PLUGINDIR . '/' ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
$deleted = $wp_filesystem->delete($plugin_dir, true);
if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
$deleted = $wp_filesystem->delete($this_plugin_dir, true);
else
$deleted = $wp_filesystem->delete($base . PLUGINDIR . "/$plugin");
$deleted = $wp_filesystem->delete($plugins_dir . $plugin);
if ( !$deleted ) {
if ( ! $deleted ) {
$wp_filesystem->delete($working_dir, true);
return new WP_Error('delete_failed', __('Could not remove the old plugin'));
}
apply_filters('update_feedback', __('Installing the latest version'));
// Copy new version of plugin into place.
if ( !copy_dir($working_dir, $base . PLUGINDIR) ) {
$result = copy_dir($working_dir, $plugins_dir);
if ( is_wp_error($result) ) {
//$wp_filesystem->delete($working_dir, true); //TODO: Uncomment? This DOES mean that the new files are available in the upgrade folder if it fails.
return new WP_Error('install_failed', __('Installation failed'));
return $result;
}
//Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin
@@ -236,13 +177,13 @@ function wp_update_plugin($plugin, $feedback = '') {
delete_option('update_plugins');
if( empty($filelist) )
return false; //We couldnt find any files in the working dir
return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup.
$folder = $filelist[0];
$plugin = get_plugins('/' . $folder); //Pass it with a leading slash, search out the plugins in the folder,
$plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash
$pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list
return $folder . '/' . $pluginfiles[0]; //Pass it without a leading slash as WP requires
return $folder . '/' . $pluginfiles[0];
}
?>

View File

@@ -1,7 +1,7 @@
<?php
if ( file_exists(ABSPATH . 'wp-content/install.php') )
require (ABSPATH . 'wp-content/install.php');
if ( file_exists(WP_CONTENT_DIR . '/install.php') )
require (WP_CONTENT_DIR . '/install.php');
require_once(ABSPATH . 'wp-admin/includes/admin.php');
require_once(ABSPATH . 'wp-admin/includes/schema.php');
@@ -18,12 +18,8 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='
update_option('blogname', $blog_title);
update_option('admin_email', $user_email);
update_option('blog_public', $public);
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
if ( defined('WP_SITEURL') && '' != WP_SITEURL )
$guessurl = WP_SITEURL;
else
$guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$guessurl = wp_guess_url();
update_option('siteurl', $guessurl);
@@ -205,6 +201,12 @@ function upgrade_all() {
if ( $wp_current_db_version < 7796 )
upgrade_251();
if ( $wp_current_db_version < 7935 )
upgrade_252();
if ( $wp_current_db_version < 8201 )
upgrade_260();
maybe_disable_automattic_widgets();
$wp_rewrite->flush_rules();
@@ -221,7 +223,7 @@ function upgrade_100() {
foreach($posts as $post) {
if ('' == $post->post_name) {
$newtitle = sanitize_title($post->post_title);
$wpdb->query("UPDATE $wpdb->posts SET post_name = '$newtitle' WHERE ID = '$post->ID'");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_name = %s WHERE ID = %d", $newtitle, $post->ID) );
}
}
}
@@ -230,7 +232,7 @@ function upgrade_100() {
foreach ($categories as $category) {
if ('' == $category->category_nicename) {
$newtitle = sanitize_title($category->cat_name);
$wpdb->query("UPDATE $wpdb->categories SET category_nicename = '$newtitle' WHERE cat_ID = '$category->cat_ID'");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->categories SET category_nicename = %s WHERE cat_ID = %d", $newtitle, $category->cat_ID) );
}
}
@@ -253,14 +255,12 @@ function upgrade_100() {
if ($allposts) :
foreach ($allposts as $post) {
// Check to see if it's already been imported
$cat = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post->ID AND category_id = $post->post_category");
$cat = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category) );
if (!$cat && 0 != $post->post_category) { // If there's no result
$wpdb->query("
INSERT INTO $wpdb->post2cat
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->post2cat
(post_id, category_id)
VALUES
('$post->ID', '$post->post_category')
");
VALUES (%s, %s)
", $post->ID, $post->post_category) );
}
}
endif;
@@ -288,7 +288,7 @@ function upgrade_110() {
foreach ($users as $user) {
if ('' == $user->user_nicename) {
$newname = sanitize_title($user->user_nickname);
$wpdb->query("UPDATE $wpdb->users SET user_nicename = '$newname' WHERE ID = '$user->ID'");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET user_nicename = %s WHERE ID = %d", $newname, $user->ID) );
}
}
@@ -404,7 +404,7 @@ function upgrade_130() {
foreach ( $options as $option ) {
if ( 1 != $option->dupes ) { // Could this be done in the query?
$limit = $option->dupes - 1;
$dupe_ids = $wpdb->get_col("SELECT option_id FROM $wpdb->options WHERE option_name = '$option->option_name' LIMIT $limit");
$dupe_ids = $wpdb->get_col( $wpdb->prepare("SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit) );
$dupe_ids = join($dupe_ids, ',');
$wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)");
}
@@ -448,8 +448,7 @@ function upgrade_160() {
if ($idmode == 'namefl') $id = $user->user_firstname.' '.$user->user_lastname;
if ($idmode == 'namelf') $id = $user->user_lastname.' '.$user->user_firstname;
if (!$idmode) $id = $user->user_nickname;
$id = $wpdb->escape( $id );
$wpdb->query("UPDATE $wpdb->users SET display_name = '$id' WHERE ID = '$user->ID'");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET display_name = %s WHERE ID = %d", $id, $user->ID) );
endif;
// FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set.
@@ -471,7 +470,7 @@ function upgrade_160() {
$comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" );
if( is_array( $comments ) ) {
foreach ($comments as $comment) {
$wpdb->query( "UPDATE $wpdb->posts SET comment_count = $comment->c WHERE ID = '$comment->comment_post_ID'" );
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET comment_count = %d WHERE ID = %d", $comment->c, $comment->comment_post_ID) );
}
}
@@ -480,10 +479,10 @@ function upgrade_160() {
if ( $wp_current_db_version > 2541 && $wp_current_db_version <= 3091 ) {
$objects = $wpdb->get_results("SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'");
foreach ($objects as $object) {
$wpdb->query("UPDATE $wpdb->posts SET post_status = 'attachment',
post_mime_type = '$object->post_type',
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_status = 'attachment',
post_mime_type = %s,
post_type = ''
WHERE ID = $object->ID");
WHERE ID = %d", $object->post_type, $object->ID) );
$meta = get_post_meta($object->ID, 'imagedata', true);
if ( ! empty($meta['file']) )
@@ -511,7 +510,7 @@ function upgrade_210() {
$type = 'attachment';
}
$wpdb->query("UPDATE $wpdb->posts SET post_status = '$status', post_type = '$type' WHERE ID = '$post->ID'");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID) );
}
}
@@ -544,45 +543,46 @@ function upgrade_230() {
$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID");
foreach ($categories as $category) {
$term_id = (int) $category->cat_ID;
$name = $wpdb->escape($category->cat_name);
$description = $wpdb->escape($category->category_description);
$slug = $wpdb->escape($category->category_nicename);
$parent = $wpdb->escape($category->category_parent);
$name = $category->cat_name;
$description = $category->category_description;
$slug = $category->category_nicename;
$parent = $category->category_parent;
$term_group = 0;
// Associate terms with the same slug in a term group and make slugs unique.
if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) {
if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) {
$term_group = $exists[0]->term_group;
$id = $exists[0]->term_id;
$num = 2;
do {
$alt_slug = $slug . "-$num";
$num++;
$slug_check = $wpdb->get_var("SELECT slug FROM $wpdb->terms WHERE slug = '$alt_slug'");
$slug_check = $wpdb->get_var( $wpdb->prepare("SELECT slug FROM $wpdb->terms WHERE slug = %s", $alt_slug) );
} while ( $slug_check );
$slug = $alt_slug;
if ( empty( $term_group ) ) {
$term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group") + 1;
$wpdb->query("UPDATE $wpdb->terms SET term_group = '$term_group' WHERE term_id = '$id'");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d", $term_group, $id) );
}
}
$wpdb->query("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES ('$term_id', '$name', '$slug', '$term_group')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES
(%d, %s, %s, %d)", $term_id, $name, $slug, $term_group) );
$count = 0;
if ( !empty($category->category_count) ) {
$count = (int) $category->category_count;
$taxonomy = 'category';
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
}
if ( !empty($category->link_count) ) {
$count = (int) $category->link_count;
$taxonomy = 'link_category';
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
}
@@ -590,14 +590,14 @@ function upgrade_230() {
$have_tags = true;
$count = (int) $category->tag_count;
$taxonomy = 'post_tag';
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
}
if ( empty($count) ) {
$count = 0;
$taxonomy = 'category';
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
}
}
@@ -617,7 +617,7 @@ function upgrade_230() {
if ( empty($tt_id) )
continue;
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post_id', '$tt_id')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $post_id, $tt_id) );
}
// < 3570 we used linkcategories. >= 3570 we used categories and link2cat.
@@ -636,20 +636,20 @@ function upgrade_230() {
$term_group = 0;
// Associate terms with the same slug in a term group and make slugs unique.
if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) {
if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) {
$term_group = $exists[0]->term_group;
$term_id = $exists[0]->term_id;
}
if ( empty($term_id) ) {
$wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$name', '$slug', '$term_group')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES (%s, %s, %d)", $name, $slug, $term_group) );
$term_id = (int) $wpdb->insert_id;
}
$link_cat_id_map[$cat_id] = $term_id;
$default_link_cat = $term_id;
$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', 'link_category', '', '0', '0')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES (%d, 'link_category', '', '0', '0')", $term_id) );
$tt_ids[$term_id] = (int) $wpdb->insert_id;
}
@@ -665,7 +665,7 @@ function upgrade_230() {
if ( empty($tt_id) )
continue;
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$link->link_id', '$tt_id')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $link->link_id, $tt_id) );
}
// Set default to the last category we grabbed during the upgrade loop.
@@ -680,7 +680,7 @@ function upgrade_230() {
if ( empty($tt_id) )
continue;
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$link_id', '$tt_id')");
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $link_id, $tt_id) );
}
}
@@ -693,10 +693,10 @@ function upgrade_230() {
$terms = $wpdb->get_results("SELECT term_taxonomy_id, taxonomy FROM $wpdb->term_taxonomy");
foreach ( (array) $terms as $term ) {
if ( ('post_tag' == $term->taxonomy) || ('category' == $term->taxonomy) )
$count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = '$term->term_taxonomy_id'");
$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term->term_taxonomy_id) );
else
$count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = '$term->term_taxonomy_id'");
$wpdb->query("UPDATE $wpdb->term_taxonomy SET count = '$count' WHERE term_taxonomy_id = '$term->term_taxonomy_id'");
$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term->term_taxonomy_id) );
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_taxonomy_id = %d", $count, $term->term_taxonomy_id) );
}
}
@@ -739,6 +739,22 @@ function upgrade_251() {
update_option('secret', wp_generate_password(64));
}
function upgrade_252() {
global $wpdb;
$wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''");
}
function upgrade_260() {
if ( $wp_current_db_version < 8000 )
populate_roles_260();
if ( $wp_current_db_version < 8201 ) {
update_option('enable_app', 1);
update_option('enable_xmlrpc', 1);
}
}
// The functions we use to actually do stuff
// General
@@ -833,7 +849,7 @@ function __get_option($setting) {
return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) );
}
$option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
$option = $wpdb->get_var( $wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting) );
if ( 'home' == $setting && '' == $option )
return __get_option('siteurl');
@@ -868,7 +884,7 @@ function deslash($content) {
function dbDelta($queries, $execute = true) {
global $wpdb;
// Seperate individual queries into an array
// Separate individual queries into an array
if( !is_array($queries) ) {
$queries = explode( ';', $queries );
if('' == $queries[count($queries) - 1]) array_pop($queries);
@@ -1083,7 +1099,7 @@ function make_db_current_silent() {
function make_site_theme_from_oldschool($theme_name, $template) {
$home_path = get_home_path();
$site_dir = ABSPATH . "wp-content/themes/$template";
$site_dir = WP_CONTENT_DIR . "/themes/$template";
if (! file_exists("$home_path/index.php"))
return false;
@@ -1102,7 +1118,7 @@ function make_site_theme_from_oldschool($theme_name, $template) {
if ($oldfile == 'index.php') { // Check to make sure it's not a new index
$index = implode('', file("$oldpath/$oldfile"));
if (strpos($index, 'WP_USE_THEMES') !== false) {
if (! @copy(ABSPATH . 'wp-content/themes/default/index.php', "$site_dir/$newfile"))
if (! @copy(WP_CONTENT_DIR . '/themes/default/index.php', "$site_dir/$newfile"))
return false;
continue; // Don't copy anything
}
@@ -1150,8 +1166,8 @@ function make_site_theme_from_oldschool($theme_name, $template) {
}
function make_site_theme_from_default($theme_name, $template) {
$site_dir = ABSPATH . "wp-content/themes/$template";
$default_dir = ABSPATH . 'wp-content/themes/default';
$site_dir = WP_CONTENT_DIR . "/themes/$template";
$default_dir = WP_CONTENT_DIR . '/themes/default';
// Copy files from the default theme to the site theme.
//$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
@@ -1208,7 +1224,7 @@ function make_site_theme() {
// Name the theme after the blog.
$theme_name = __get_option('blogname');
$template = sanitize_title($theme_name);
$site_dir = ABSPATH . "wp-content/themes/$template";
$site_dir = WP_CONTENT_DIR . "/themes/$template";
// If the theme already exists, nothing to do.
if ( is_dir($site_dir)) {
@@ -1216,7 +1232,7 @@ function make_site_theme() {
}
// We must be able to write to the themes dir.
if (! is_writable(ABSPATH . "wp-content/themes")) {
if (! is_writable(WP_CONTENT_DIR . "/themes")) {
return false;
}

View File

@@ -141,10 +141,7 @@ function edit_user( $user_id = 0 ) {
function get_author_user_ids() {
global $wpdb;
$level_key = $wpdb->prefix . 'user_level';
$query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key' AND meta_value != '0'";
return $wpdb->get_col( $query );
return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
}
function get_editable_authors( $user_id ) {
@@ -176,7 +173,7 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
$level_key = $wpdb->prefix . 'user_level';
$query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'";
$query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
if ( $exclude_zeros )
$query .= " AND meta_value != '0'";
@@ -187,9 +184,7 @@ function get_nonauthor_user_ids() {
global $wpdb;
$level_key = $wpdb->prefix . 'user_level';
$query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key' AND meta_value = '0'";
return $wpdb->get_col( $query );
return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
}
function get_others_unpublished_posts($user_id, $type='any') {
@@ -208,7 +203,7 @@ function get_others_unpublished_posts($user_id, $type='any') {
$other_unpubs = '';
} else {
$editable = join(',', $editable);
$other_unpubs = $wpdb->get_results("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != '$user_id' ORDER BY post_modified $dir");
$other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
}
return apply_filters('get_others_drafts', $other_unpubs);
@@ -241,8 +236,7 @@ function get_user_to_edit( $user_id ) {
function get_users_drafts( $user_id ) {
global $wpdb;
$user_id = (int) $user_id;
$query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = $user_id ORDER BY post_modified DESC";
$query = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id);
$query = apply_filters('get_users_drafts', $query);
return $wpdb->get_results( $query );
}
@@ -253,7 +247,7 @@ function wp_delete_user($id, $reassign = 'novalue') {
$id = (int) $id;
if ($reassign == 'novalue') {
$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_author = $id");
$post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );
if ($post_ids) {
foreach ($post_ids as $post_id)
@@ -261,18 +255,18 @@ function wp_delete_user($id, $reassign = 'novalue') {
}
// Clean links
$wpdb->query("DELETE FROM $wpdb->links WHERE link_owner = $id");
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_owner = %d", $id) );
} else {
$reassign = (int) $reassign;
$wpdb->query("UPDATE $wpdb->posts SET post_author = {$reassign} WHERE post_author = {$id}");
$wpdb->query("UPDATE $wpdb->links SET link_owner = {$reassign} WHERE link_owner = {$id}");
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $id) );
$wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $id) );
}
// FINALLY, delete user
do_action('delete_user', $id);
$wpdb->query("DELETE FROM $wpdb->users WHERE ID = $id");
$wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$id'");
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
wp_cache_delete($id, 'users');
wp_cache_delete($user->user_login, 'userlogins');
@@ -323,7 +317,7 @@ class WP_User_Search {
function prepare_query() {
global $wpdb;
$this->first_user = ($this->page - 1) * $this->users_per_page;
$this->query_limit = ' LIMIT ' . $this->first_user . ',' . $this->users_per_page;
$this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
$this->query_sort = ' ORDER BY user_login';
$search_sql = '';
if ( $this->search_term ) {
@@ -337,7 +331,7 @@ class WP_User_Search {
$this->query_from_where = "FROM $wpdb->users";
if ( $this->role )
$this->query_from_where .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE '%$this->role%'";
$this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
else
$this->query_from_where .= " WHERE 1=1";
$this->query_from_where .= " $search_sql";
@@ -360,12 +354,18 @@ class WP_User_Search {
function do_paging() {
if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
$args = array();
if( ! empty($this->search_term) )
$args['usersearch'] = urlencode($this->search_term);
if( ! empty($this->role) )
$args['role'] = urlencode($this->role);
$this->paging_text = paginate_links( array(
'total' => ceil($this->total_users_for_query / $this->users_per_page),
'current' => $this->page,
'base' => 'users.php?%_%',
'format' => 'userspage=%#%',
'add_args' => array( 'usersearch' => urlencode($this->search_term) )
'add_args' => $args
) );
}
}
@@ -392,4 +392,4 @@ class WP_User_Search {
}
endif;
?>
?>

View File

@@ -64,7 +64,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
if ( 'all' == $show && $is_multi ) {
// it's a multi-widget. We only need to show it in the list once.
$already_shown[] = $widget['callback'];
$num = (int) array_pop( explode( '-', $widget['id'] ) );
$num = (int) array_pop( $ids = explode( '-', $widget['id'] ) );
$id_base = $wp_registered_widget_controls[$widget['id']]['id_base'];
// so that we always add a new one when clicking "add"
while ( isset($wp_registered_widgets["$id_base-$num"]) )
@@ -76,7 +76,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
}
$add_query['add'] = $widget['id'];
$action = 'add';
$add_url = wp_nonce_url( add_query_arg( $add_query ), "add-widget_$widget[id]" );
$add_url = clean_url( wp_nonce_url( add_query_arg( $add_query ), "add-widget_$widget[id]" ) );
} else {
$action = 'edit';
$edit_url = clean_url( add_query_arg( array(
@@ -102,7 +102,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
<li id="widget-list-item-<?php echo attribute_escape( $widget['id'] ); ?>" class="widget-list-item">
<h4 class="widget-title widget-draggable">
<?php echo $widget_title; ?>
<span><?php echo $widget_title; ?></span>
<?php if ( 'add' == $action ) : ?>
@@ -116,6 +116,8 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
<?php endif; ?>
<br class="clear" />
</h4>
@@ -227,11 +229,12 @@ function wp_widget_control( $sidebar_args ) {
if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] )
echo $sidebar_args['before_widget'];
?>
<h4 class="widget-title"><?php echo $widget_title ?>
<div class="widget-top">
<h4 class="widget-title"><span><?php echo $widget_title ?></span>
<?php if ( $edit ) : ?>
<a class="widget-action widget-control-edit" href="<?php echo remove_query_arg( array( 'edit', 'key' ) ); ?>"><?php _e('Cancel'); ?></a>
<a class="widget-action widget-control-edit" href="<?php echo clean_url( remove_query_arg( array( 'edit', 'key' ) ) ); ?>"><?php _e('Cancel'); ?></a>
<?php else : ?>
@@ -239,7 +242,9 @@ function wp_widget_control( $sidebar_args ) {
<?php endif; ?>
</h4>
<br class="clear" />
</h4></div>
<div class="widget-control"<?php if ( $edit ) echo ' style="display: block;"'; ?>>
@@ -281,10 +286,4 @@ function wp_widget_control_ob_filter( $string ) {
return trim( wp_specialchars( strip_tags( $string ) ) );
}
function widget_css() {
wp_admin_css( 'css/widgets' );
}
add_action( 'admin_head', 'widget_css' );
?>

View File

@@ -26,12 +26,8 @@ jQuery(function($) {
}
add_action( 'admin_head', 'index_js' );
function index_css() {
wp_admin_css( 'css/dashboard' );
}
add_action( 'admin_head', 'index_css' );
wp_enqueue_script( 'jquery' );
wp_admin_css( 'dashboard' );
$title = __('Dashboard');
$parent_file = 'index.php';
@@ -64,6 +60,8 @@ $num_cats = wp_count_terms('category');
$num_tags = wp_count_terms('post_tag');
$num_comm = get_comment_count( );
$post_type_texts = array();
if ( !empty($num_posts->publish) ) { // with feeds, anyone can tell how many posts there are. Just unlink if !current_user_can
@@ -93,30 +91,42 @@ if ( current_user_can( 'manage_categories' ) ) {
$tags_text = "<a href='edit-tags.php'>$tags_text</a>";
}
$total_comments = sprintf( __ngettext( '%1$s total', '%1$s total', $num_comm['total_comments'] ), number_format_i18n($num_comm['total_comments']) );
$approved_comments = sprintf( __ngettext( '%1$s approved', '%1$s approved', $num_comm['approved'] ), number_format_i18n($num_comm['approved']) );
$spam_comments = sprintf( __ngettext( '%1$s spam', '%1$s spam', $num_comm['spam'] ), number_format_i18n($num_comm['spam']) );
$moderated_comments = sprintf( __ngettext( '%1$s awaiting moderation', '%1$s awaiting moderation', $num_comm['awaiting_moderation'] ), number_format_i18n($num_comm['awaiting_moderation']) );
if( current_user_can( 'moderate_comments' ) ) {
$total_comments = "<a href='edit-comments.php'>{$total_comments}</a>";
$approved_comments = "<a href='edit-comments.php?comment_status=approved'>{$approved_comments}</a>";
$moderated_comments = "<a href='edit-comments.php?comment_status=moderated'>{$moderated_comments}</a>";
}
$comm_text = sprintf( __ngettext( 'You have %1$s comment, %2$s, %3$s and %4$s.', 'You have %1$s comments, %2$s, %3$s and %4$s.', $num_comm['total_comments'] ), $total_comments, $approved_comments, $spam_comments, $moderated_comments );
$post_type_text = implode(', ', $post_type_texts);
// There is always a category
$sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s' ), $post_type_text, $cats_text, $tags_text, $pending_text );
$sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text );
$sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s %5$s' ), $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text );
$sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text );
?>
<p class="youhave"><?php echo $sentence; ?></p>
<?php
$ct = current_theme_info();
$sidebars_widgets = wp_get_sidebars_widgets();
$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) );
$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ), 0 );
$widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets );
if ( $can_switch_themes = current_user_can( 'switch_themes' ) )
$widgets_text = "<a href='widgets.php'>$widgets_text</a>";
?>
<p class="youare">
<?php printf( __( 'You are using %1$s theme with %2$s.' ), $ct->title, $widgets_text ); ?>
<?php printf( __( 'You are using the %1$s theme with %2$s.' ), $ct->title, $widgets_text ); ?>
<?php if ( $can_switch_themes ) : ?>
<a href="themes.php" class="rbutton"><?php _e('Change Theme'); ?></a>
<?php endif; ?>
<?php update_right_now_message(); ?>
</p>
<?php do_action( 'rightnow_end' ); ?>
<?php do_action( 'activity_box_end' ); ?>
</div><!-- rightnow -->

View File

@@ -1,5 +1,6 @@
<?php
require_once(dirname(dirname(__FILE__)).'/wp-config.php');
$wp_only_load_config = true;
require_once(dirname(dirname(__FILE__)).'/wp-load.php');
$debug = 0;
/**
@@ -8,6 +9,7 @@ $debug = 0;
** Returns: true if already exists or on successful completion
** false on error
*/
if ( ! function_exists('maybe_create_table') ) :
function maybe_create_table($table_name, $create_ddl) {
global $wpdb;
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
@@ -25,6 +27,7 @@ function maybe_create_table($table_name, $create_ddl) {
}
return false;
}
endif;
/**
** maybe_add_column()
@@ -32,6 +35,7 @@ function maybe_create_table($table_name, $create_ddl) {
** Returns: true if already exists or on successful completion
** false on error
*/
if ( ! function_exists('maybe_add_column') ) :
function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb, $debug;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
@@ -50,7 +54,7 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
}
return false;
}
endif;
/**
** maybe_drop_column()

View File

@@ -1,12 +1,7 @@
<?php
define('WP_INSTALLING', true);
if (!file_exists('../wp-config.php')) {
require_once('../wp-includes/compat.php');
require_once('../wp-includes/functions.php');
wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><p><a href='setup-config.php' class='button'>Create a Configuration File</a>", "WordPress &rsaquo; Error");
}
require_once('../wp-config.php');
require_once('../wp-load.php');
require_once('./includes/upgrade.php');
if (isset($_GET['step']))
@@ -21,7 +16,7 @@ header( 'Content-Type: text/html; charset=utf-8' );
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php _e('WordPress &rsaquo; Installation'); ?></title>
<?php wp_admin_css( 'css/install' ); ?>
<?php wp_admin_css( 'install', true ); ?>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
@@ -59,7 +54,7 @@ switch($step) {
<td colspan="2"><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td>
</tr>
</table>
<input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" />
<p class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" /></p>
</form>
<?php
@@ -103,7 +98,7 @@ switch($step) {
</tr>
</table>
<p><a href="../wp-login.php" class="button"><?php _e('Log In'); ?></a>
<p class="step"><a href="../wp-login.php" class="button"><?php _e('Log In'); ?></a></p>
<?php
break;

View File

@@ -52,6 +52,8 @@ switchEditors = {
// Fix some block element newline issues
content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
@@ -69,7 +71,7 @@ switchEditors = {
// Trim whitespace
content = content.replace(new RegExp('^\\s*', ''), '');
content = content.replace(new RegExp('\\s*$', ''), '');
content = content.replace(new RegExp('[\\s\\u00a0]*$', ''), '');
// put back the line breaks in pre|script
content = content.replace(/<wp_temp>/g, '\n');
@@ -164,6 +166,7 @@ switchEditors = {
pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
// pee = pee.replace(new RegExp('^((?:&nbsp;)*)\\s', 'mg'), '$1&nbsp;');
// Fix the pre|script tags

View File

@@ -1,31 +1,26 @@
function checkAll(form) {
for (i = 0, n = form.elements.length; i < n; i++) {
if(form.elements[i].type == "checkbox" && !(form.elements[i].getAttribute('onclick',2))) {
if(form.elements[i].checked == true)
form.elements[i].checked = false;
else
form.elements[i].checked = true;
}
}
function checkAll(jQ) { // use attr( checked, fn )
jQuery(jQ).find( 'tbody:visible :checkbox' ).attr( 'checked', function() {
return jQuery(this).attr( 'checked' ) ? '' : 'checked';
} );
}
function getNumChecked(form) {
var num = 0;
for (i = 0, n = form.elements.length; i < n; i++) {
if (form.elements[i].type == "checkbox") {
if (form.elements[i].checked == true)
num++;
jQuery( function($) {
var lastClicked = false;
$( 'tbody :checkbox' ).click( function(e) {
if ( 'undefined' == e.shiftKey ) { return true; }
if ( e.shiftKey ) {
if ( !lastClicked ) { return true; }
var checks = $( lastClicked ).parents( 'form:first' ).find( ':checkbox' );
var first = checks.index( lastClicked );
var last = checks.index( this );
if ( 0 < first && 0 < last && first != last ) {
checks.slice( first, last ).attr( 'checked', $( this ).is( ':checked' ) ? 'checked' : '' );
}
}
}
return num;
}
function checkAllUsers(role) {
var checkboxs = document.getElementsByTagName('input');
for(var i = 0, inp; inp = checkboxs[i]; i++)
if(inp.type.toLowerCase() == 'checkbox' && inp.className == role)
if(inp.checked == false)
inp.checked = true;
else
inp.checked = false;
}
lastClicked = this;
return true;
} );
$( 'thead :checkbox' ).click( function() {
checkAll( $(this).parents( 'form:first' ) );
} );
} );

28
wp-admin/js/gallery.js Normal file
View File

@@ -0,0 +1,28 @@
jQuery(function($) {
var gallerySortable;
var gallerySortableInit = function() {
gallerySortable = $('#media-items').sortable( {
items: '.media-item',
placeholder: 'sorthelper',
axis: 'y',
distance: 2,
update: galleryReorder
} );
}
// When an update has occurred, adjust the order for each item
var galleryReorder = function(e, sort) {
jQuery.each(sort['element'].sortable('toArray'), function(i, id) {
jQuery('#' + id + ' .menu_order input')[0].value = (1+i);
});
}
// initialize sortable
gallerySortableInit();
});
jQuery(document).ready(function($){
$('.menu_order_input').each(function(){
if ( this.value == '0' ) this.value = '';
});
});

View File

@@ -1,4 +1,7 @@
jQuery(document).ready( function() {
// close postboxes that should be closed
jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
jQuery('#link_name').focus();
// postboxes
add_postbox_toggles('link');

View File

@@ -1,12 +1,53 @@
// send html to the post editor
function send_to_editor(h) {
var win = window.opener ? window.opener : window.dialogArguments;
if ( !win )
win = top;
tinyMCE = win.tinyMCE;
if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) {
tinyMCE.selectedInstance.getWin().focus();
tinyMCE.execCommand('mceInsertContent', false, h);
if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
ed.focus();
if (tinymce.isIE)
ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
if ( h.indexOf('[caption') != -1 )
h = ed.plugins.wpeditimage._do_shcode(h);
ed.execCommand('mceInsertContent', false, h);
} else
win.edInsertContent(win.edCanvas, h);
}
edInsertContent(edCanvas, h);
tb_remove();
}
// thickbox settings
jQuery(function($) {
tb_position = function() {
var tbWindow = $('#TB_window');
var width = $(window).width();
var H = $(window).height();
var W = ( 720 < width ) ? 720 : width;
if ( tbWindow.size() ) {
tbWindow.width( W - 50 ).height( H - 45 );
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
if ( typeof document.body.style.maxWidth != 'undefined' )
tbWindow.css({'top':'20px','margin-top':'0'});
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
};
return $('a.thickbox').each( function() {
var href = $(this).attr('href');
if ( ! href ) return;
href = href.replace(/&width=[0-9]+/g, '');
href = href.replace(/&height=[0-9]+/g, '');
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
});
};
jQuery('a.thickbox').click(function(){
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
tinyMCE.get('content').focus();
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
}
});
$(window).resize( function() { tb_position() } );
});

View File

@@ -18,6 +18,8 @@ function new_tag_remove_tag() {
}
function tag_update_quickclicks() {
if ( jQuery( '#tags-input' ).length == 0 )
return;
var current_tags = jQuery( '#tags-input' ).val().split(',');
jQuery( '#tagchecklist' ).empty();
shown = false;
@@ -96,7 +98,7 @@ jQuery(document).ready( function() {
jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } );
// auto-suggest stuff
jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2 } );
jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
jQuery('#newtag').keypress( tag_press_key );
// category tabs
@@ -118,8 +120,9 @@ jQuery(document).ready( function() {
jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );
noSyncChecks = false;
};
var popularCats = jQuery('#categorychecklist-pop :checkbox').map( function() { return parseInt(jQuery(this).val(), 10); } ).get().join(',');
var catAddBefore = function( s ) {
s.data += '&' + jQuery( '#categorychecklist :checked' ).serialize();
s.data += '&popular_ids=' + popularCats + '&' + jQuery( '#categorychecklist :checked' ).serialize();
return s;
};
var catAddAfter = function( r, s ) {
@@ -149,7 +152,8 @@ jQuery(document).ready( function() {
} );
jQuery('#category-add-toggle').click( function() {
jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' );
categoryTabs.tabsClick( 1 );
// categoryTabs.tabs( 'select', '#categories-all' ); // this is broken (in the UI beta?)
categoryTabs.find( 'a[href="#categories-all"]' ).click();
jQuery('#newcat').focus();
return false;
} );
@@ -177,5 +181,9 @@ jQuery(document).ready( function() {
if ( jQuery.isFunction( autosave_update_post_ID ) ) {
autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
}
} });
}, addBefore: function( s ) {
s.data += '&post_id=' + jQuery('#post_ID').val();
return s;
}
});
});

View File

@@ -0,0 +1,34 @@
<?php
if ( !defined( 'ABSPATH' ) )
exit;
function dvortr( $str ) {
return strtr(
$str,
'\',.pyfgcrl/=\\aoeuidhtns-;qjkxbmwvz"<>PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ[]',
'qwertyuiop[]\\asdfghjkl;\'zxcvbnm,./QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?-='
);
}
$j = clean_url( site_url( '/wp-includes/js/jquery/jquery.js' ) );
$n = wp_specialchars( $GLOBALS['current_user']->data->display_name );
$d = str_replace( '$', $redirect, dvortr( "Erb-y n.y ydco dall.b aiacbv Wa ce]-irxajt- dp.u]-$-VIr XajtWzaVv" ) );
wp_die( <<<EOEE
<style type="text/css">
html body { font-family: courier, monospace; }
#hal { text-decoration: blink; }
</style>
<script type="text/javascript" src="$j"></script>
<script type="text/javascript">
/* <![CDATA[ */
var n = '$n';
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('6(4(){2 e=6(\\'#Q\\').v();2 i=\\'\\\\\\',.R/=\\\\\\\\S-;T"<>U?+|V:W[]X{}\\'.u(\\'\\');2 o=\\'Y[]\\\\\\\\Z;\\\\\\'10,./11{}|12:"13<>?-=14+\\'.u(\\'\\');2 5=4(s){r=\\'\\';6.15(s.u(\\'\\'),4(){2 t=16.D();2 c=6.17(t,i);r+=\\'\$\\'==t?n:(-1==c?t:o[c])});j r};2 a=[\\'O.E[18 e.y.19.1a\\',\\'1b 1c. 1d .1e.,1f 1g\\',\\'O.E e.1h 1i 8\\',\\'9\\',\\'0\\'];2 b=[\\'<1j. 1k \$1l\\',\\'1m. 1n 1o 1p\\',\\'1q, 1r. ,1s. 1t\\'];2 w=[];2 h=6(5(\\'#1u\\'));6(5(\\'1v\\')).1w(4(e){7(1x!==e.1y){j}7(x&&x.F){x.F();j G}1z.1A=6(5(\\'#1B\\')).1C(\\'1D\\');j G});2 k=4(){2 l=a.H();7(\\'I\\'==J l){7(m){2 c={};c[5(\\'1E\\')]=5(\\'1F\\');c[5(\\'1G\\')]=5(\\'1H..b\\');6(5(\\'1I 1J\\')).1K(c);p();h.v().1L({1M:1},z,\\'1N\\',4(){h.K()});d(m,L)}j}w=5(l).u(\\'\\');A()};2 A=4(){B=w.H();7(\\'I\\'==J B){7(m){h.M(5(\\'1O 1P\\'));d(k,C)}N{7(a.P){d(p,C);d(k,z)}N{d(4(){p();h.v()},C);d(4(){e.K()},L)}}j}h.M(B.D());d(A,1Q)};2 m=4(){a=b;m=1R;k()};p=4(){2 f=6(\\'p\\').1S(0);2 g=6.1T(f.q).1U();1V(2 g=f.q.P;g>0;g--){7(3==f.q[g-1].1W||\\'1X\\'==f.q[g-1].1Y.1Z()){f.20(f.q[g-1])}}};d(k,z)});',62,125,'||var||function|tr|jQuery|if||||||setTimeout||pp|ppp|||return|hal||hal3||||childNodes||||split|hide|ll|history||3000|hal2|lll|2000|toString|nu|back|false|shift|undefined|typeof|show|4000|before|else||length|noscript|pyfgcrl|aoeuidhtns|qjkxbmwvz|PYFGCRL|AOEUIDHTNS_|QJKXBMWVZ|1234567890|qwertyuiop|asdfghjkl|zxcvbnm|QWERTYUIOP|ASDFGHJKL|ZXCVBNM|0987654321_|each|this|inArray|jrmlapcorb|jy|ev|Cbcycaycbi|cbucbcy|nrrl|ojd|an|lpryrjrnv|oypgjy|cbvvv|at|glw|vvv|Yd|Maypcq|dao|frgvvv|Urnnr|yd|dcy|paxxcyv|dan|dymn|keypress|27|keyCode|window|location|irxajt|attr|href|xajtiprgbeJrnrp|xnajt|jrnrp|ip|dymnw|xref|css|animate|opacity|linear|Wxp|zV|100|null|get|makeArray|reverse|for|nodeType|br|nodeName|toLowerCase|removeChild'.split('|'),0,{}))
/* ]]> */
</script>
<span id="noscript">$d</span>
<blink id="hal">&#x258c;</blink>
EOEE
,
dvortr( 'Eabi.p!' )
);

View File

@@ -0,0 +1,44 @@
jQuery(function($) {
if ( 'undefined' == typeof $.fn.pngFix )
$.fn.pngFix = function() { return this; }
var thickDims = function() {
var tbWindow = $('#TB_window');
var H = $(window).height();
var W = $(window).width();
if ( tbWindow.size() ) {
tbWindow.width( W - 90 ).height( H - 60 );
$('#TB_iframeContent').width( W - 90 ).height( H - 90 );
tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
if ( typeof document.body.style.maxWidth != 'undefined' )
tbWindow.css({'top':'30px','margin-top':'0'});
};
return $('a.thickbox').each( function() {
var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
if ( ! href ) return;
href = href.replace(/&width=[0-9]+/g, '');
href = href.replace(/&height=[0-9]+/g, '');
$(this).attr( 'href', href + '&width=' + ( W - 110 ) + '&height=' + ( H - 100 ) );
});
};
thickDims()
.click( function() {
var alink = $(this).parents('.available-theme').find('.activatelink');
var url = alink.attr('href');
var text = alink.html();
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
$('#TB_closeAjaxWindow').css({'float':'left'});
$('#TB_ajaxWindowTitle').css({'float':'right'})
.append('&nbsp;<a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>');
$('#TB_iframeContent').width('100%');
return false;
} );
$(window).resize( function() { thickDims() } );
});

View File

@@ -13,12 +13,12 @@ jQuery(function($) {
if ( t.is(':visible') ) {
if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
li.css( 'marginLeft', 0 );
t.siblings('h4').children('a').text( widgetsL10n.edit );
t.siblings('div').children('h4').children('a').text( widgetsL10n.edit );
} else {
t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open
if ( width > 250 )
li.css( 'marginLeft', ( width - 250 ) * -1 );
t.siblings('h4').children('a').text( widgetsL10n.cancel );
t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel );
}
t.toggle();
} : function() {
@@ -28,12 +28,12 @@ jQuery(function($) {
if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
if ( width > 250 )
li.animate( { marginLeft: 0 } );
t.siblings('h4').children('a').text( widgetsL10n.edit );
t.siblings('div').children('h4').children('a').text( widgetsL10n.edit );
} else {
t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open
if ( width > 250 )
li.animate( { marginLeft: ( width - 250 ) * -1 } );
t.siblings('h4').children('a').text( widgetsL10n.cancel );
t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel );
}
t.animate( { height: 'toggle' } );
};

39
wp-admin/js/word-count.js Normal file
View File

@@ -0,0 +1,39 @@
// Word count
(function(JQ) {
wpWordCount = {
init : function() {
var t = this, last = 0, co = JQ('#content');
JQ('#wp-word-count').html( wordCountL10n.count.replace( /%d/, '<span id="word-count">0</span>' ) );
t.block = 0;
t.wc(co.val());
co.keyup( function(e) {
if ( e.keyCode == last ) return true;
if ( 13 == e.keyCode || 8 == last || 46 == last ) t.wc(co.val());
last = e.keyCode;
return true;
});
},
wc : function(tx) {
var t = this, w = JQ('#word-count'), tc = 0;
if ( t.block ) return;
t.block = 1;
setTimeout( function() {
if ( tx ) {
tx = tx.replace( /<.[^<>]*?>/g, ' ' ).replace( /&nbsp;/gi, ' ' );
tx = tx.replace( /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g, '' );
tx.replace( /\S\s+/g, function(){tc++;} );
}
w.html(tc.toString());
setTimeout( function() { t.block = 0; }, 2000 );
}, 1 );
}
}
}(jQuery));
jQuery(document).ready( function(){ wpWordCount.init(); } );

92
wp-admin/js/wp-gears.js Normal file
View File

@@ -0,0 +1,92 @@
wpGears = {
createStore : function() {
if ( 'undefined' == typeof google || ! google.gears ) return;
if ( 'undefined' == typeof localServer )
localServer = google.gears.factory.create("beta.localserver");
store = localServer.createManagedStore(this.storeName());
store.manifestUrl = "gears-manifest.php";
store.checkForUpdate();
this.message();
},
getPermission : function() {
if ( 'undefined' != typeof google && google.gears ) {
if ( ! google.gears.factory.hasPermission )
google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' );
try {
this.createStore();
} catch(e) {} // silence if canceled
}
},
storeName : function() {
var name = window.location.protocol + window.location.host;
name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name
name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars
return name;
},
message : function(show) {
var t = this, msg1 = t.I('gears-msg1'), msg2 = t.I('gears-msg2'), msg3 = t.I('gears-msg3'), num = t.I('gears-upd-number'), wait = t.I('gears-wait');
if ( ! msg1 ) return;
if ( 'undefined' != typeof google && google.gears ) {
if ( google.gears.factory.hasPermission ) {
msg1.style.display = msg2.style.display = 'none';
msg3.style.display = 'block';
if ( 'undefined' == typeof store )
t.createStore();
store.oncomplete = function(){wait.innerHTML = (' ' + wpGearsL10n.updateCompleted);};
store.onerror = function(){wait.innerHTML = (' ' + wpGearsL10n.error + ' ' + store.lastErrorMessage);};
store.onprogress = function(e){if(num) num.innerHTML = (' ' + e.filesComplete + ' / ' + e.filesTotal);};
} else {
msg1.style.display = msg3.style.display = 'none';
msg2.style.display = 'block';
}
}
if ( show ) t.I('gears-info-box').style.display = 'block';
},
I : function(id) {
return document.getElementById(id);
}
};
(function() {
if ( 'undefined' != typeof google && google.gears ) return;
var gf = false;
if ( 'undefined' != typeof GearsFactory ) {
gf = new GearsFactory();
} else {
try {
gf = new ActiveXObject('Gears.Factory');
if ( factory.getBuildInfo().indexOf('ie_mobile') != -1 )
gf.privateSetGlobalObject(this);
} catch (e) {
if ( ( 'undefined' != typeof navigator.mimeTypes ) && navigator.mimeTypes['application/x-googlegears'] ) {
gf = document.createElement("object");
gf.style.display = "none";
gf.width = 0;
gf.height = 0;
gf.type = "application/x-googlegears";
document.documentElement.appendChild(gf);
}
}
}
if ( ! gf ) return;
if ( 'undefined' == typeof google ) google = {};
if ( ! google.gears ) google.gears = { factory : gf };
})();

View File

@@ -13,7 +13,6 @@ wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
wp_enqueue_script('link');
wp_enqueue_script('xfn');
wp_enqueue_script('thickbox');
require('admin-header.php');
?>

View File

@@ -28,12 +28,13 @@ case 'delete':
wp_die(__('Cheatin&#8217; uh?'));
$cat_name = get_term_field('name', $cat_ID, 'link_category');
$default_cat_id = get_option('default_link_category');
// Don't delete the default cats.
if ( $cat_ID == get_option('default_link_category') )
if ( $cat_ID == $default_cat_id )
wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
wp_delete_term($cat_ID, 'link_category');
wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
$location = 'edit-link-categories.php';
if ( $referer = wp_get_original_referer() ) {
@@ -73,7 +74,9 @@ case 'editedcat':
$location = $referer;
}
if ( wp_update_term($cat_ID, 'link_category', $_POST) )
$update = wp_update_term($cat_ID, 'link_category', $_POST);
if ( $update && !is_wp_error($update) )
$location = add_query_arg('message', 3, $location);
else
$location = add_query_arg('message', 5, $location);

View File

@@ -30,19 +30,19 @@ switch ($step) {
<input type="hidden" name="step" value="1" />
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<div style="width: 48%;" class="alignleft">
<h3><?php _e('Specify an OPML URL:'); ?></h3>
<input type="text" name="opml_url" size="50" style="width: 90%;" value="http://" />
<h3><label for="opml_url"><?php _e('Specify an OPML URL:'); ?></label></h3>
<input type="text" name="opml_url" id="opml_url" size="50" style="width: 90%;" value="http://" />
</div>
<div style="width: 48%;" class="alignleft">
<h3><?php _e('Or choose from your local disk:'); ?></h3>
<h3><label for="userfile"><?php _e('Or choose from your local disk:'); ?></label></h3>
<input id="userfile" name="userfile" type="file" size="30" />
</div>
</div>
<p style="clear: both; margin-top: 1em;"><?php _e('Now select a category you want to put these links in.') ?><br />
<?php _e('Category:') ?> <select name="cat_id">
<p style="clear: both; margin-top: 1em;"><label for="cat_id"><?php _e('Now select a category you want to put these links in.') ?></label><br />
<?php _e('Category:') ?> <select name="cat_id" id="cat_id">
<?php
$categories = get_terms('link_category', 'get=all');
foreach ($categories as $category) {

View File

@@ -78,6 +78,7 @@ if ( isset($_GET['deleted']) ) {
<h2><?php printf( __( 'Manage Links (<a href="%s">add new</a>)' ), 'link-add.php' ); ?></h2>
<p id="post-search">
<label class="hidden" for="post-search-input"><?php _e( 'Search Links' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" />
</p>
@@ -141,7 +142,7 @@ if ( $links ) {
<table class="widefat">
<thead>
<tr>
<th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
<th scope="col" class="check-column"><input type="checkbox" /></th>
<?php foreach($link_columns as $column_display_name) {
echo $column_display_name;
} ?>

Some files were not shown because too many files have changed in this diff Show More