Changeset 9129
- Timestamp:
- 10/13/2008 02:48:45 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r9053 r9129 681 681 } 682 682 683 // produce HTML for the image alignment radio buttons with the specified one checked 684 /** 685 * {@internal Missing Short Description}} 683 /** 684 * Retrieve HTML for the image alignment radio buttons with the specified one checked. 686 685 * 687 686 * @since unknown … … 707 706 } 708 707 709 // produce HTML for the size radio buttons with the specified one checked 710 /** 711 * {@internal Missing Short Description}} 708 /** 709 * Retrieve HTML for the size radio buttons with the specified one checked. 712 710 * 713 711 * @since unknown … … 724 722 foreach ( $size_names as $size => $name) { 725 723 $downsize = image_downsize($post->ID, $size); 726 724 727 725 // is this size selectable? 728 726 $enabled = ( $downsize[3] || 'full' == $size ); … … 754 752 } 755 753 756 // produce HTML for the Link URL buttons with the default link type as specified 757 /** 758 * {@internal Missing Short Description}} 754 /** 755 * Retrieve HTML for the Link URL buttons with the default link type as specified. 759 756 * 760 757 * @since unknown … … 961 958 962 959 /** 963 * {@internal Missing Short Description}} 964 * 965 * @since unknown 966 * 967 * @param unknown_type $post_id 968 * @param unknown_type $errors 969 * @return unknown 960 * Retrieve HTML for media items of post gallery. 961 * 962 * The HTML markup retrieved will be created for the progress of SWF Upload 963 * component. Will also create link for showing and hiding the form to modify 964 * the image attachment. 965 * 966 * @since unknown 967 * 968 * @param int $post_id Optional. Post ID. 969 * @param array $errors Errors for attachment, if any. 970 * @return string 970 971 */ 971 972 function get_media_items( $post_id, $errors ) { … … 993 994 994 995 /** 995 * {@internal Missing Short Description}}996 * 997 * @since unknown 998 * 999 * @param unknown_type $attachment_id1000 * @param unknown_type $args1001 * @return unknown996 * Retrieve HTML form for modifying the image attachment. 997 * 998 * @since unknown 999 * 1000 * @param int $attachment_id Attachment ID for modification. 1001 * @param string|array $args Optional. Override defaults. 1002 * @return string HTML form for attachment. 1002 1003 */ 1003 1004 function get_media_item( $attachment_id, $args = null ) { … … 1804 1805 } 1805 1806 1806 // support a GET parameter for disabling the flash uploader 1807 /** 1808 * {@internal Missing Short Description}} 1807 /** 1808 * {@internal Missing Short Description}} 1809 * 1810 * Support a GET parameter for disabling the flash uploader. 1809 1811 * 1810 1812 * @since unknown … … 1854 1856 add_action('post-html-upload-ui', 'media_upload_html_bypass'); 1855 1857 1856 // make sure the GET parameter sticks when we submit a form 1857 /** 1858 * {@internal Missing Short Description}} 1858 /** 1859 * {@internal Missing Short Description}} 1860 * 1861 * Make sure the GET parameter sticks when we submit a form. 1859 1862 * 1860 1863 * @since unknown -
trunk/wp-includes/post.php
r9123 r9129 520 520 // expected_slashed ($meta_key) 521 521 $meta_key = stripslashes($meta_key); 522 $meta_value = stripslashes($meta_value);523 522 524 523 if ( $unique && $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) 525 524 return false; 526 525 527 $meta_value = maybe_serialize( $meta_value);526 $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); 528 527 529 528 $wpdb->insert( $wpdb->postmeta, compact( 'post_id', 'meta_key', 'meta_value' ) ); … … 546 545 * 547 546 * @param int $post_id post ID 548 * @param string $ key Metadata name.549 * @param mixed $ value Optional. Metadata value.547 * @param string $meta_key Metadata name. 548 * @param mixed $meta_value Optional. Metadata value. 550 549 * @return bool False for failure. True for success. 551 550 */ 552 function delete_post_meta($post_id, $ key, $value = '') {551 function delete_post_meta($post_id, $meta_key, $meta_value = '') { 553 552 global $wpdb; 554 553 555 554 $post_id = absint( $post_id ); 556 555 557 // expected_slashed ($ key, $value)558 $ key = stripslashes( $key );559 $ value = stripslashes( $value);560 561 if ( empty( $ value ) )562 $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $ key ) );556 // expected_slashed ($meta_key, $meta_value) 557 $meta_key = stripslashes( $meta_key ); 558 $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); 559 560 if ( empty( $meta_value ) ) 561 $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key ) ); 563 562 else 564 $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $ key, $value ) );563 $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $meta_key, $meta_value ) ); 565 564 566 565 if ( !$meta_id ) 567 566 return false; 568 567 569 if ( empty( $ value ) )570 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $ key ) );568 if ( empty( $meta_value ) ) 569 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key ) ); 571 570 else 572 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $ key, $value ) );571 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $meta_key, $meta_value ) ); 573 572 574 573 wp_cache_delete($post_id, 'post_meta'); … … 633 632 // expected_slashed ($meta_key) 634 633 $meta_key = stripslashes($meta_key); 635 $meta_value = stripslashes($meta_value);636 634 637 635 if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) { … … 639 637 } 640 638 641 $meta_value = maybe_serialize( $meta_value);639 $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); 642 640 643 641 $data = compact( 'meta_value' );
Note: See TracChangeset
for help on using the changeset viewer.