Commit Graph

355 Commits

Author SHA1 Message Date
Mark Jaquith 93442c1773 Run the attachment_fields_to_save filter even if we don't get the fields we used to get. props nacin. fixes #22774
git-svn-id: https://develop.svn.wordpress.org/trunk@23094 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 05:34:17 +00:00
Andrew Nacin 90e5fd56c0 Fix branchhing in edit_post() where attachment_fields_to_save would only run when the alt text was sent. It should run whenever an attachment is saved. props sc0ttclark. fixes #22774.
git-svn-id: https://develop.svn.wordpress.org/trunk@23088 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-06 03:50:31 +00:00
Andrew Nacin f88b538001 Bring Featured Images back into the main media dialog.
Most users don't realize that the Featured Image meta box exists; if they do, few use it.

Restores the old meta box UI, including the admin_post_thumbnail_html filter. If a plugin is using _wp_post_thumbnail_html() in conjunction with Thickbox elsewhere, it will also magically still work.

Specific underlying changes:
 * Converts the modal view to use the view manager, which means that a call to open() will automatically call render and attach if necessary.
 * Doesn't automatically set a state in wp.media, to allow code to customize the states to be added before activation.

props koopersmith.
fixes #21776.



git-svn-id: https://develop.svn.wordpress.org/trunk@22979 602fd350-edb4-49c9-b593-d223f7449a82
2012-12-03 02:38:10 +00:00
Ryan Boren e06828a6c4 Add a create_posts check to _wp_translate_postdata(). Move the edit_post check to the top of the function.
Props nacin
fixes #22417


git-svn-id: https://develop.svn.wordpress.org/trunk@22950 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-30 14:03:47 +00:00
Andrew Nacin e4759d815d Support attachment_fields_to_save and attachment_fields_to_edit for attachments going through post.php. see #22186. see #21391.
git-svn-id: https://develop.svn.wordpress.org/trunk@22783 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 18:53:00 +00:00
Peter Westwood ebb921d018 Posting: Improve the capability checking _wp_translate_postdata() when updating posts.
* Use the specific post_type's 'edit_post' cap
* Pass the ID of the post being edited.

Fixes #22417


git-svn-id: https://develop.svn.wordpress.org/trunk@22769 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 16:34:57 +00:00
Daryl Koopersmith 8e6aa60fa4 Media: Dynamically generate attachment filters using get_post_mime_types().
Moves `get_post_mime_types()` from `wp-admin/includes/post.php` to `wp-includes/post.php`.

fixes #22514, see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22743 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-21 10:18:59 +00:00
Andrew Nacin 34985fbc7a Revert page on front changes. Reverts [22127] [22129] [22135] [22136]. see #16379.
git-svn-id: https://develop.svn.wordpress.org/trunk@22653 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-19 01:28:32 +00:00
Daryl Koopersmith 62fe5ba600 Media: Add title, caption, and alt text, and attachment info to sidebar.
* Improve sidebar styles.
* Separate the hybrid title/caption field.
* Improve the sidebar image thumbnail.
* Remove filenames from inside the non-image icon thumbnail.
* Properly sync title/caption/alt.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22532 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-10 18:25:04 +00:00
Andrew Nacin 1d1417ec55 Always return an integer from post_exists(). props barrykooij. fixes #21607.
git-svn-id: https://develop.svn.wordpress.org/trunk@22410 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-06 23:27:21 +00:00
Andrew Nacin d3af38c768 Move the static front page saving routine to a single sanitize_option() callback for show_on_front. page_on_front and page_for_posts are now manually set by this callback, and not separately by options.php. see #16379.
git-svn-id: https://develop.svn.wordpress.org/trunk@22136 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-08 21:25:13 +00:00
Andrew Nacin 5ecb1e0d87 Pass the screen context directly to get_sample_permalink_html(). see #16379.
git-svn-id: https://develop.svn.wordpress.org/trunk@22129 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-07 03:44:30 +00:00
Ryan Boren 3368f400e6 Better UI for doing "Page on Front".
Props SergeyBiryukov, lessbloat, nacin.

see #16379


git-svn-id: https://develop.svn.wordpress.org/trunk@22127 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-06 15:19:29 +00:00
Andrew Nacin 620b94181c Remove old autosave collision code from edit_post(). props miqrogroove.
This code, which could block autosaves when drafts had future timestamps,
dates to before autosaves were saved as revisions and is no longer necessary.

fixes #21858.



git-svn-id: https://develop.svn.wordpress.org/trunk@21949 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-22 02:11:09 +00:00
Andrew Nacin 991be145a9 Use the regular post type UI for editing single media items (attachments).
* Attachments now go through post.php, edit_post(), the like, and have show_ui set to true.
 * Taxonomies attached to the media library now appear in the admin menu (if show_ui).
 * Editing, cropping, uploading, etc. is still very rough, but mostly functional.

API-wise:
 * New function: get_taxonomies_for_attachments(). Like get_taxonomies(), for taxonomies specifically registered against attachments.
 * Brings taxonomy support from the posts list table to the media list table. Expect them to converge soon.
 * wp_insert_attachment() now handles taxonomies like wp_insert_post(). Also expect them to converge soon.
 * New edit_form_after_title hook.

props helenyhou, ocean90. see #21391.



git-svn-id: https://develop.svn.wordpress.org/trunk@21948 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-21 22:52:54 +00:00
Andrew Nacin 1c58ef9f33 Updates and fixes to the new button styles. By default, buttons are now the same size as they were in 3.4. Then there is a smaller button (designed for minor elements) and a larger button (designed for things like Publish and Save Changes). Better focus styles. props lessbloat. see #21598.
git-svn-id: https://develop.svn.wordpress.org/trunk@21944 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-21 19:34:23 +00:00
Peter Westwood d86f9f140f Posting: Improve the invalid date protection code based on feedback from nacin.
* Introduce a wp_checkdate() function with a single filter to centralise the code that validates dates.
 * Improve the error message
 * Correctly handle the return value of wp_insert_post which is not always a WP_Error on failure

Fixes #17180


git-svn-id: https://develop.svn.wordpress.org/trunk@21922 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-20 10:46:50 +00:00
Peter Westwood 59dd4b7d2b Posting: Make it much harder to create posts with invalid dates by enforcing the post date tests in the UI and the backend code.
Previously you could quite easily send a new post into the back of beyond by specifying an invalid date like the 30th Feb and this was very confusing.
Sometimes it would seem to work and sometimes the post would end up very far in the past - depending on the mysql version and other factors.

Fixes #17180 props jkudish.


git-svn-id: https://develop.svn.wordpress.org/trunk@21921 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-19 21:43:35 +00:00
Andrew Nacin afbbc9665a Combine some strings. props pavelevap. fixes #21087.
git-svn-id: https://develop.svn.wordpress.org/trunk@21857 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-15 19:57:05 +00:00
Ryan Boren 46f3985c39 Deprecate get_default_post_to_edit(). Props SergeyBiryukov. fixes #21677
git-svn-id: https://develop.svn.wordpress.org/trunk@21800 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-10 20:39:45 +00:00
Daryl Koopersmith 7d6e53317c New button styles.
Using the new buttons:

* Button classes are now stackable.
* All buttons should use a base class of "button".
* Buttons default to the gray style (formerly "button-secondary"). Buttons can add a style by adding additional classes. To make a primary button, add the "button-primary" class.
* Buttons can be rendered in various sizes. In addition to the default size, you can add "button-large", "button-small", or "button-tiny".

For backwards compatibility reasons, "button-primary" and "button-secondary" both work as standalone classes.

get_submit_button() has been adjusted to handle shorthand button classes (i.e. button classes can be passed without the "button-" prefix).

props lessbloat, helenyhou, trepmal, nacin. see #21598.



git-svn-id: https://develop.svn.wordpress.org/trunk@21789 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-08 04:58:34 +00:00
Daryl Koopersmith 3ef72a1dee First pass at integrating featured images with the new media workflow.
Updates the featured image when the publish/update button is clicked (rather than instantly). Uses the existing post_thumbnail_meta_box() function. Does not remove the old featured image meta box JS, ajax handler, or CSS.

see #21776, #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@21770 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-06 08:49:35 +00:00
Ryan Boren 31ec698423 Use get_post() instead of global $post.
Make the $post argument to get_post() optional, defaulting to the current post in The Loop.

Props nacin
see #21309


git-svn-id: https://develop.svn.wordpress.org/trunk@21735 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-04 16:29:28 +00:00
Ryan Boren 01527025c9 Add tags_input, page_template, and post_category get magic to WP_Post.
Deprecate get_post_to_edit() and wp_get_single_post().
Props scribu
see #21309


git-svn-id: https://develop.svn.wordpress.org/trunk@21651 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-28 19:08:28 +00:00
Ryan Boren 9905abe697 Update phpdoc for functions that return WP_Post. Soft deprecate get_page(). see #21309
git-svn-id: https://develop.svn.wordpress.org/trunk@21598 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-23 20:34:41 +00:00
Ryan Boren de06b81360 Remove return ref from all calls to get_post()
Return WP_Post from get_default_post_to_edit()
Replace all calls to get_page() with get_post()
see #21309


git-svn-id: https://develop.svn.wordpress.org/trunk@21597 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-23 20:01:10 +00:00
Andrew Ozz 446b40235f TinyMCE: fix tabbig in and out of the editor, fixes #20834
git-svn-id: https://develop.svn.wordpress.org/trunk@21300 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-22 02:33:53 +00:00
Mark Jaquith 72b9881a85 Standardize our "View Post" new-tab/no-new-tab behavior. Committed this thirtieth day of June, Anno Domini MMXII. May peace and good sense forever reign in this realm. Uh... Amen.
props SergeyBiryukov. fixes #11406.

git-svn-id: https://develop.svn.wordpress.org/trunk@21189 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-30 08:49:26 +00:00
Andrew Nacin ca66a5ca21 Add inline documentation for wp_edit_attachments_query(). props simonwheatley, SergeyBiryukov. fixes #21105.
git-svn-id: https://develop.svn.wordpress.org/trunk@21179 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-29 15:09:14 +00:00
Mark Jaquith abc6fd3848 Pass the post ID to the admin_post_thumbnail_html filter. props helenyhou. fixes #20891
git-svn-id: https://develop.svn.wordpress.org/trunk@21173 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-28 20:41:04 +00:00
Ryan Boren 8c50f982ea Pinking shears
git-svn-id: https://develop.svn.wordpress.org/trunk@20715 602fd350-edb4-49c9-b593-d223f7449a82
2012-05-03 16:41:59 +00:00
Ryan Boren 91edc71696 Pass the upload iframe src url as an arg to sprintf to avoid treating octets as
format specifiers. Fixes setting the featured image on blogs containing spaces in the install path. Props rosshanney. fixes #20443


git-svn-id: https://develop.svn.wordpress.org/trunk@20594 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-25 20:24:20 +00:00
Ryan Boren 03512f97e8 Move deletion of auto-draft posts to the wp_scheduled_delete cron function. Props mgolawala. fixes #19663
git-svn-id: https://develop.svn.wordpress.org/trunk@20440 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-11 20:39:09 +00:00
Andrew Ozz f615043fea Improve _fix_attachment_links(), replace attachment URLs with the real permalink only for published posts, re-save only when there are changes, see #13429
git-svn-id: https://develop.svn.wordpress.org/trunk@20308 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-28 16:02:12 +00:00
Ryan Boren 5648306064 Pass post id to get_upload_iframe_src() instead of relying on a global. Props tott. fixes #20003
git-svn-id: https://develop.svn.wordpress.org/trunk@19999 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-27 19:23:03 +00:00
Ryan Boren 99c65753a4 Add post ID argument to _wp_post_thumbnail_html() rather than relying on a global. Post the ID from wp_ajax_set_post_thumbnail(). Props batmoo. fixes #20003
git-svn-id: https://develop.svn.wordpress.org/trunk@19902 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-10 17:41:37 +00:00
Andrew Nacin 092808ead8 Allow localized commas to be used as tag separators. see #7897.
git-svn-id: https://develop.svn.wordpress.org/trunk@19853 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-07 18:06:12 +00:00
Andrew Nacin ba219cf998 Prefix table name against the post_parent field in _edit_attachments_query_helper() to avoid ambiguous queries. props benbalter. fixes #19779.
git-svn-id: https://develop.svn.wordpress.org/trunk@19720 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-09 15:55:30 +00:00
Ryan Boren a8d77cbae9 User lowercase true, false, null instead of uppercase. Props c3mdigital, mfields. fixes #16302
git-svn-id: https://develop.svn.wordpress.org/trunk@19687 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-05 20:50:54 +00:00
Ryan Boren 54067a5f20 Remove extraneous spaces. Props kenan3008, dimadin. fixes #19501 #19433
git-svn-id: https://develop.svn.wordpress.org/trunk@19596 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-14 17:36:38 +00:00
Ryan Boren 676ba7043e Use one space, not two, after trailing punctuation. fixes #19537
git-svn-id: https://develop.svn.wordpress.org/trunk@19593 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-13 23:45:31 +00:00
Andrew Nacin 83b8af1bc6 Revert [19372] for 3.3. see #13473.
git-svn-id: https://develop.svn.wordpress.org/trunk@19448 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-24 16:06:17 +00:00
Peter Westwood 2304ad1b0e Respect the default comment/ping status for new posts even when someone has hidden the meta box which lets you alter them on a per-post basis.
Fixes #13473 props solarissmoke. 


git-svn-id: https://develop.svn.wordpress.org/trunk@19372 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-21 13:45:10 +00:00
Ryan Boren fd10e500e4 Pinking shears
git-svn-id: https://develop.svn.wordpress.org/trunk@19054 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-24 19:13:23 +00:00
Andrew Nacin c4d4799424 Initialize the post object in get_default_post_to_edit(). props tech163. fixes #18049.
git-svn-id: https://develop.svn.wordpress.org/trunk@18847 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-30 21:35:05 +00:00
Andrew Ozz b969d2ea80 Clean up remnants from having negative Post_IDs, props markjaquith, fixes #18235
git-svn-id: https://develop.svn.wordpress.org/trunk@18823 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-29 21:47:52 +00:00
Andrew Nacin 35edc4264d Release a user's post lock when the user leaves a post. see #18515.
git-svn-id: https://develop.svn.wordpress.org/trunk@18796 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-27 20:52:07 +00:00
Andrew Nacin 4b03f4253b wp_set_post_lock() only takes one argument. see #18515.
git-svn-id: https://develop.svn.wordpress.org/trunk@18790 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-27 06:11:30 +00:00
Jon Cave 83f0e2c349 Add post formats to quick edit and bulk edit. Fixes #18083.
git-svn-id: https://develop.svn.wordpress.org/trunk@18722 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-19 17:02:58 +00:00
Jon Cave 6db13f488f Make use of specific post format support in current_theme_supports(). See #18691.
git-svn-id: https://develop.svn.wordpress.org/trunk@18721 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-19 16:31:33 +00:00