Ticket #7527: 7527.r8653.patch
File 7527.r8653.patch, 30.7 KB (added by , 16 years ago) |
---|
-
bookmark.php
1 1 <?php 2 /** 3 * WordPress Bookmark Administration API 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 9 /** 10 * {@internal Missing Short Description}} 11 * 12 * @since unknown 13 * 14 * @return unknown 15 */ 3 16 function add_link() { 4 17 return edit_link(); 5 18 } 6 19 20 /** 21 * {@internal Missing Short Description}} 22 * 23 * @since unknown 24 * 25 * @param unknown_type $link_id 26 * @return unknown 27 */ 7 28 function edit_link( $link_id = '' ) { 8 29 if (!current_user_can( 'manage_links' )) 9 30 wp_die( __( 'Cheatin’ uh?' )); … … 24 45 } 25 46 } 26 47 48 /** 49 * {@internal Missing Short Description}} 50 * 51 * @since unknown 52 * 53 * @return unknown 54 */ 27 55 function get_default_link_to_edit() { 28 56 if ( isset( $_GET['linkurl'] ) ) 29 57 $link->link_url = clean_url( $_GET['linkurl']); … … 40 68 return $link; 41 69 } 42 70 71 /** 72 * {@internal Missing Short Description}} 73 * 74 * @since unknown 75 * 76 * @param unknown_type $link_id 77 * @return unknown 78 */ 43 79 function wp_delete_link($link_id) { 44 80 global $wpdb; 45 81 … … 54 90 return true; 55 91 } 56 92 93 /** 94 * {@internal Missing Short Description}} 95 * 96 * @since unknown 97 * 98 * @param unknown_type $link_id 99 * @return unknown 100 */ 57 101 function wp_get_link_cats($link_id = 0) { 58 102 59 103 $cats = wp_get_object_terms($link_id, 'link_category', 'fields=ids'); … … 61 105 return array_unique($cats); 62 106 } 63 107 108 /** 109 * {@internal Missing Short Description}} 110 * 111 * @since unknown 112 * 113 * @param unknown_type $link_id 114 * @return unknown 115 */ 64 116 function get_link_to_edit( $link_id ) { 65 117 return get_bookmark( $link_id, OBJECT, 'edit' ); 66 118 } 67 119 120 /** 121 * {@internal Missing Short Description}} 122 * 123 * @since unknown 124 * 125 * @param unknown_type $linkdata 126 * @return unknown 127 */ 68 128 function wp_insert_link($linkdata) { 69 129 global $wpdb, $current_user; 70 130 … … 140 200 return $link_id; 141 201 } 142 202 203 /** 204 * {@internal Missing Short Description}} 205 * 206 * @since unknown 207 * 208 * @param unknown_type $link_id 209 * @param unknown_type $link_categories 210 */ 143 211 function wp_set_link_cats($link_id = 0, $link_categories = array()) { 144 212 // If $link_categories isn't already an array, make it one: 145 213 if (!is_array($link_categories) || 0 == count($link_categories)) … … 151 219 wp_set_object_terms($link_id, $link_categories, 'link_category'); 152 220 } // wp_set_link_cats() 153 221 222 /** 223 * {@internal Missing Short Description}} 224 * 225 * @since unknown 226 * 227 * @param unknown_type $linkdata 228 * @return unknown 229 */ 154 230 function wp_update_link($linkdata) { 155 231 $link_id = (int) $linkdata['link_id']; 156 232 -
comment.php
1 1 <?php 2 /** 3 * WordPress Comment Administration API 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 3 9 /** 4 10 * {@internal Missing Short Description}} … … 18 24 } 19 25 20 26 /** 21 * 27 * {@internal Missing Short Description}} 22 28 * 29 * @since unknown 23 30 */ 24 31 function edit_comment() { 25 32 … … 42 49 } 43 50 } 44 51 45 46 52 if (!empty ( $_POST['edit_date'] ) ) { 47 53 $aa = $_POST['aa']; 48 54 $mm = $_POST['mm']; … … 60 66 wp_update_comment( $_POST); 61 67 } 62 68 69 /** 70 * {@internal Missing Short Description}} 71 * 72 * @since unknown 73 * 74 * @param unknown_type $id 75 * @return unknown 76 */ 63 77 function get_comment_to_edit( $id ) { 64 78 if ( !$comment = get_comment($id) ) 65 79 return false; … … 78 92 return $comment; 79 93 } 80 94 95 /** 96 * {@internal Missing Short Description}} 97 * 98 * @since unknown 99 * @uses $wpdb 100 * 101 * @param int $post_id Post ID 102 * @return unknown 103 */ 81 104 function get_pending_comments_num( $post_id ) { 82 105 global $wpdb; 83 106 … … 104 127 return $pending_keyed; 105 128 } 106 129 107 // Add avatars to relevant places in admin, or try to 108 130 /** 131 * Add avatars to relevant places in admin, or try to. 132 * 133 * @since unknown 134 * @uses $comment 135 * 136 * @param string $name User name. 137 * @return string Avatar with Admin name. 138 */ 109 139 function floated_admin_avatar( $name ) { 110 140 global $comment; 111 141 -
dashboard.php
1 1 <?php 2 /** 3 * WordPress Dashboard Widget Administration Panel API 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 3 // Registers dashboard widgets, handles POST data, sets up filters 9 /** 10 * Registers dashboard widgets. 11 * 12 * handles POST data, sets up filters. 13 * 14 * @since unknown 15 */ 4 16 function wp_dashboard_setup() { 5 17 global $wpdb, $wp_dashboard_sidebars; 6 18 $update = false; … … 158 170 update_option( 'dashboard_widget_options', $widget_options ); 159 171 } 160 172 161 // Echoes out the dashboard 173 /** 174 * Displays the dashboard. 175 * 176 * @since unknown 177 */ 162 178 function wp_dashboard() { 163 179 echo "<div id='dashboard-widgets'>\n\n"; 164 180 … … 170 186 echo "<br class='clear' />\n</div>\n\n\n"; 171 187 } 172 188 173 // Makes sidebar_widgets option reflect the dashboard settings 189 /** 190 * Makes sidebar_widgets option reflect the dashboard settings. 191 * 192 * @since unknown 193 * 194 * @return array WordPress Dashboard Widgets list. 195 */ 174 196 function wp_dashboard_sidebars_widgets() { // hackery 175 197 return $GLOBALS['wp_dashboard_sidebars']; 176 198 } 177 199 178 200 // Modifies sidbar params on the fly to set up ids, class names, titles for each widget (called once per widget) 179 201 // Switches widget to edit mode if $_GET['edit'] 202 /** 203 * {@internal Missing Short Description}} 204 * 205 * @since unknown 206 * 207 * @param unknown_type $params 208 * @return unknown 209 */ 180 210 function wp_dashboard_dynamic_sidebar_params( $params ) { 181 211 global $wp_registered_widgets, $wp_registered_widget_controls; 182 212 … … 258 288 259 289 /* Dashboard Widgets */ 260 290 291 /** 292 * Display recent comments dashboard widget content. 293 * 294 * @since unknown 295 * 296 * @param unknown_type $sidebar_args 297 */ 261 298 function wp_dashboard_recent_comments( $sidebar_args ) { 262 299 global $comment; 263 300 extract( $sidebar_args, EXTR_SKIP ); … … 311 348 echo $after_widget; 312 349 } 313 350 314 // $sidebar_args are handled by wp_dashboard_empty() 351 /** 352 * Display incoming links dashboard widget content. 353 * 354 * $sidebar_args are handled by wp_dashboard_empty(). 355 * 356 * @since unknown 357 */ 315 358 function wp_dashboard_incoming_links_output() { 316 359 $widgets = get_option( 'dashboard_widget_options' ); 317 360 @extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP ); … … 371 414 } 372 415 } 373 416 374 // $sidebar_args are handled by wp_dashboard_empty() 417 /** 418 * {@internal Missing Short Description}} 419 * 420 * $sidebar_args are handled by wp_dashboard_empty(). 421 * 422 * @since unknown 423 * 424 * @param int $widget_id 425 */ 375 426 function wp_dashboard_rss_output( $widget_id ) { 376 427 $widgets = get_option( 'dashboard_widget_options' ); 377 428 wp_widget_rss_output( $widgets[$widget_id] ); 378 429 } 379 430 380 // $sidebar_args are handled by wp_dashboard_empty() 431 /** 432 * Display secondary dashboard RSS widget feed. 433 * 434 * $sidebar_args are handled by wp_dashboard_empty(). 435 * 436 * @since unknown 437 * 438 * @return unknown 439 */ 381 440 function wp_dashboard_secondary_output() { 382 441 $widgets = get_option( 'dashboard_widget_options' ); 383 442 @extract( @$widgets['dashboard_secondary'], EXTR_SKIP ); … … 399 458 echo "</ul>\n<br class='clear' />\n"; 400 459 } 401 460 402 // $sidebar_args are handled by wp_dashboard_empty() 461 /** 462 * Display plugins most popular, newest plugins, and recently updated widget text. 463 * 464 * $sidebar_args are handled by wp_dashboard_empty(). 465 * 466 * @since unknown 467 */ 403 468 function wp_dashboard_plugins_output() { 404 469 $popular = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/popular/' ); 405 470 $new = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/new/' ); … … 447 512 } 448 513 } 449 514 450 // Checks to see if all of the feed url in $check_urls are cached. 451 // If $check_urls is empty, look for the rss feed url found in the dashboard widget optios of $widget_id. 452 // If cached, call $callback, a function that echoes out output for this widget. 453 // If not cache, echo a "Loading..." stub which is later replaced by AJAX call (see top of /wp-admin/index.php) 515 /** 516 * Checks to see if all of the feed url in $check_urls are cached. 517 * 518 * If $check_urls is empty, look for the rss feed url found in the dashboard 519 * widget optios of $widget_id. If cached, call $callback, a function that 520 * echoes out output for this widget. If not cache, echo a "Loading..." stub 521 * which is later replaced by AJAX call (see top of /wp-admin/index.php) 522 * 523 * @since unknown 524 * 525 * @param int $widget_id 526 * @param callback $callback 527 * @param array $check_urls RSS feeds 528 * @return bool False on failure. True on success. 529 */ 454 530 function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) { 455 531 $loading = '<p class="widget-loading">' . __( 'Loading…' ) . '</p>'; 456 532 … … 486 562 return true; 487 563 } 488 564 489 // Empty widget used for JS/AJAX created output. 490 // Callback inserts content between before_widget and after_widget. Used when widget is in edit mode. Can also be used for custom widgets. 565 /** 566 * Empty widget used for JS/AJAX created output. 567 * 568 * Callback inserts content between before_widget and after_widget. Used when 569 * widget is in edit mode. Can also be used for custom widgets. 570 * 571 * @since unknown 572 * 573 * @param array $sidebar_args 574 * @param callback $callback Optional. Only used in edit mode. 575 */ 491 576 function wp_dashboard_empty( $sidebar_args, $callback = false ) { 492 577 extract( $sidebar_args, EXTR_SKIP ); 493 578 … … 507 592 echo $after_widget; 508 593 } 509 594 510 /* Dashboard Widgets Controls. S see also wp_dashboard_empty() */595 /* Dashboard Widgets Controls. See also wp_dashboard_empty() */ 511 596 512 // Calls widget_control callback 597 /** 598 * Calls widget control callback. 599 * 600 * @since unknown 601 * 602 * @param int $widget_control_id Registered Widget ID. 603 */ 513 604 function wp_dashboard_trigger_widget_control( $widget_control_id = false ) { 514 605 global $wp_registered_widget_controls; 515 606 if ( is_scalar($widget_control_id) && $widget_control_id && isset($wp_registered_widget_controls[$widget_control_id]) && is_callable($wp_registered_widget_controls[$widget_control_id]['callback']) ) 516 607 call_user_func_array( $wp_registered_widget_controls[$widget_control_id]['callback'], $wp_registered_widget_controls[$widget_control_id]['params'] ); 517 608 } 518 609 519 // Sets up $args to be used as input to wp_widget_rss_form(), handles POST data from RSS-type widgets 610 /** 611 * The RSS dashboard widget control. 612 * 613 * Sets up $args to be used as input to wp_widget_rss_form(). Handles POST data 614 * from RSS-type widgets. 615 * 616 * @since unknown 617 * 618 * @param array $args Expects 'widget_id' and 'form_inputs'. 619 * @return bool|null False if no widget_id is given. Null on success. 620 */ 520 621 function wp_dashboard_rss_control( $args ) { 521 622 extract( $args ); 522 623 if ( !$widget_id ) -
export.php
1 1 <?php 2 /** 3 * WordPress Export Administration API 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 3 // version number for the export format. bump this when something changes that might affect compatibility. 9 /** 10 * Version number for the export format. 11 * 12 * Bump this when something changes that might affect compatibility. 13 * 14 * @since unknown 15 * @var string 16 */ 4 17 define('WXR_VERSION', '1.0'); 5 18 19 /** 20 * {@internal Missing Short Description}} 21 * 22 * @since unknown 23 * 24 * @param unknown_type $author 25 */ 6 26 function export_wp($author='') { 7 27 global $wpdb, $post_ids, $post; 8 28 … … 26 46 $categories = (array) get_categories('get=all'); 27 47 $tags = (array) get_tags('get=all'); 28 48 49 /** 50 * {@internal Missing Short Description}} 51 * 52 * @since unknown 53 * 54 * @param unknown_type $categories 55 */ 29 56 function wxr_missing_parents($categories) { 30 57 if ( !is_array($categories) || empty($categories) ) 31 58 return array(); … … 61 88 } 62 89 unset($categories); 63 90 91 /** 92 * Place string in CDATA tag. 93 * 94 * @since unknown 95 * 96 * @param string $str String to place in XML CDATA tag. 97 */ 64 98 function wxr_cdata($str) { 65 99 if ( seems_utf8($str) == false ) 66 100 $str = utf8_encode($str); … … 72 106 return $str; 73 107 } 74 108 109 /** 110 * {@internal Missing Short Description}} 111 * 112 * @since unknown 113 * 114 * @return string Site URL. 115 */ 75 116 function wxr_site_url() { 76 117 global $current_site; 77 118 … … 85 126 } 86 127 } 87 128 129 /** 130 * {@internal Missing Short Description}} 131 * 132 * @since unknown 133 * 134 * @param object $c Category Object 135 */ 88 136 function wxr_cat_name($c) { 89 137 if ( empty($c->name) ) 90 138 return; … … 92 140 echo '<wp:cat_name>' . wxr_cdata($c->name) . '</wp:cat_name>'; 93 141 } 94 142 143 /** 144 * {@internal Missing Short Description}} 145 * 146 * @since unknown 147 * 148 * @param object $c Category Object 149 */ 95 150 function wxr_category_description($c) { 96 151 if ( empty($c->description) ) 97 152 return; … … 99 154 echo '<wp:category_description>' . wxr_cdata($c->description) . '</wp:category_description>'; 100 155 } 101 156 157 /** 158 * {@internal Missing Short Description}} 159 * 160 * @since unknown 161 * 162 * @param object $t Tag Object 163 */ 102 164 function wxr_tag_name($t) { 103 165 if ( empty($t->name) ) 104 166 return; … … 106 168 echo '<wp:tag_name>' . wxr_cdata($t->name) . '</wp:tag_name>'; 107 169 } 108 170 171 /** 172 * {@internal Missing Short Description}} 173 * 174 * @since unknown 175 * 176 * @param object $t Tag Object 177 */ 109 178 function wxr_tag_description($t) { 110 179 if ( empty($t->description) ) 111 180 return; … … 113 182 echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>'; 114 183 } 115 184 185 /** 186 * {@internal Missing Short Description}} 187 * 188 * @since unknown 189 */ 116 190 function wxr_post_taxonomy() { 117 191 $categories = get_the_category(); 118 192 $tags = get_the_tags(); -
image.php
3 3 * File contains all the administration image manipulation functions. 4 4 * 5 5 * @package WordPress 6 * @subpackage Administration 6 7 */ 7 8 8 9 /** 9 * wp_create_thumbnail() -Create a thumbnail from an Image given a maximum side size.10 * Create a thumbnail from an Image given a maximum side size. 10 11 * 11 * @package WordPress 12 * @param mixed $file Filename of the original image, Or attachment id 13 * @param int $max_side Maximum length of a single side for the thumbnail 14 * @return string Thumbnail path on success, Error string on failure 12 * This function can handle most image file formats which PHP supports. If PHP 13 * does not have the functionality to save in a file of the same format, the 14 * thumbnail will be created as a jpeg. 15 15 * 16 * This function can handle most image file formats which PHP supports. 17 * If PHP does not have the functionality to save in a file of the same format, the thumbnail will be created as a jpeg. 16 * @since unknown 17 * 18 * @param mixed $file Filename of the original image, Or attachment id. 19 * @param int $max_side Maximum length of a single side for the thumbnail. 20 * @return string Thumbnail path on success, Error string on failure. 18 21 */ 19 22 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { 20 21 23 $thumbpath = image_resize( $file, $max_side, $max_side ); 22 24 return apply_filters( 'wp_create_thumbnail', $thumbpath ); 23 25 } 24 26 25 27 /** 26 * wp_crop_image() -Crop an Image to a given size.28 * Crop an Image to a given size. 27 29 * 28 * @package WordPress29 30 * @internal Missing Long Description 30 * @param int $src_file The source file31 * @param int $src_x The start x position to crop from32 * @param int $src_y The start y position to crop from33 * @param int $src_w The width to crop34 * @param int $src_h The height to crop35 * @param int $dst_w The destination width36 * @param int $dst_h The destination height37 * @param int $src_abs If the source crop points are absolute38 * @param int $dst_file The destination file to write to39 * @return string New filepath on success, String error message on failure40 31 * 32 * @since unknown 33 * 34 * @param string|int $src_file The source file or Attachment ID 35 * @param int $src_x The start x position to crop from. 36 * @param int $src_y The start y position to crop from. 37 * @param int $src_w The width to crop. 38 * @param int $src_h The height to crop. 39 * @param int $dst_w The destination width. 40 * @param int $dst_h The destination height. 41 * @param int $src_abs Optional. If the source crop points are absolute. 42 * @param string $dst_file Optional. The destination file to write to. 43 * @return string New filepath on success, String error message on failure. 41 44 */ 42 45 function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) { 43 46 if ( is_numeric( $src_file ) ) // Handle int as attachment ID … … 74 77 } 75 78 76 79 /** 77 * wp_generate_attachment_metadata() - Generate post Image attachment Metadata80 * Generate post Image attachment Metadata. 78 81 * 79 * @package WordPress80 82 * @internal Missing Long Description 81 * @param int $attachment_id Attachment Id to process82 * @param string $file Filepath of the Attached image83 * @return mixed Metadata for attachment84 83 * 84 * @since unknown 85 * 86 * @param int $attachment_id Attachment Id to process 87 * @param string $file Filepath of the Attached image 88 * @return mixed Metadata for attachment 85 89 */ 86 90 function wp_generate_attachment_metadata( $attachment_id, $file ) { 87 91 $attachment = get_post( $attachment_id ); … … 111 115 $metadata['image_meta'] = $image_meta; 112 116 113 117 } 118 114 119 return apply_filters( 'wp_generate_attachment_metadata', $metadata ); 115 120 } 116 121 117 122 /** 118 * wp_load_image() -Load an image which PHP Supports.123 * Load an image which PHP Supports. 119 124 * 120 * @package WordPress121 125 * @internal Missing Long Description 122 * @param string $file Filename of the image to load123 * @return resource The resulting image resource on success, Error string on failure.124 126 * 127 * @since unknown 128 * 129 * @param string $file Filename of the image to load. 130 * @return resource The resulting image resource on success, Error string on failure. 125 131 */ 126 132 function wp_load_image( $file ) { 127 133 if ( is_numeric( $file ) ) … … 144 150 } 145 151 146 152 /** 147 * get_udims() - Calculated the new dimentions for downsampled images153 * Calculated the new dimentions for downsampled images. 148 154 * 149 * @package WordPress 150 * @internal Missing Description 155 * @since unknown 151 156 * @see wp_shrink_dimensions() 152 * @param int $width Current width of the image153 * @param int $height Current height of the image154 * @return mixed Array(height,width) of shrunk dimensions.155 157 * 158 * @param int $width Current width of the image 159 * @param int $height Current height of the image 160 * @return mixed Array(height,width) of shrunk dimensions. 161 * 156 162 */ 157 163 function get_udims( $width, $height) { 158 164 return wp_shrink_dimensions( $width, $height ); 159 165 } 166 160 167 /** 161 * wp_shrink_dimensions() -Calculates the new dimentions for a downsampled image.168 * Calculates the new dimentions for a downsampled image. 162 169 * 163 * @package WordPress 164 * @internal Missing Long Description 165 * @param int $width Current width of the image 166 * @param int $height Current height of the image 167 * @param int $wmax Maximum wanted width 168 * @param int $hmax Maximum wanted height 169 * @return mixed Array(height,width) of shrunk dimensions. 170 * @since unknown 171 * @see wp_constrain_dimensions() 170 172 * 173 * @param int $width Current width of the image 174 * @param int $height Current height of the image 175 * @param int $wmax Maximum wanted width 176 * @param int $hmax Maximum wanted height 177 * @return mixed Array(height,width) of shrunk dimensions. 178 * 171 179 */ 172 180 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { 173 181 return wp_constrain_dimensions( $width, $height, $wmax, $hmax ); 174 182 } 175 183 176 // convert a fraction string to a decimal 184 /** 185 * Convert a fraction string to a decimal. 186 * 187 * @since unknown 188 * 189 * @param string $str 190 * @return int|float 191 */ 177 192 function wp_exif_frac2dec($str) { 178 193 @list( $n, $d ) = explode( '/', $str ); 179 194 if ( !empty($d) ) … … 181 196 return $str; 182 197 } 183 198 184 // convert the exif date format to a unix timestamp 199 /** 200 * Convert the exif date format to a unix timestamp. 201 * 202 * @since unknown 203 * 204 * @param string $str 205 * @return int 206 */ 185 207 function wp_exif_date2ts($str) { 186 // seriously, who formats a date like 'YYYY:MM:DD hh:mm:ss'?187 208 @list( $date, $time ) = explode( ' ', trim($str) ); 188 209 @list( $y, $m, $d ) = explode( ':', $date ); 189 210 190 211 return strtotime( "{$y}-{$m}-{$d} {$time}" ); 191 212 } 192 213 193 // get extended image metadata, exif or iptc as available 214 /** 215 * Get extended image metadata, exif or iptc as available 216 * 217 * @since unknown 218 * 219 * @param string $file 220 * @return bool|array False on failure. Image metadata array on success. 221 */ 194 222 function wp_read_image_metadata( $file ) { 195 223 if ( !file_exists( $file ) ) 196 224 return false; 197 225 198 226 list(,,$sourceImageType) = getimagesize( $file ); 199 227 200 // exif contains a bunch of data we'll probably never need formatted in ways that are difficult to use. 201 // We'll normalize it and just extract the fields that are likely to be useful. Fractions and numbers 202 // are converted to floats, dates to unix timestamps, and everything else to strings. 228 // exif contains a bunch of data we'll probably never need formatted in ways 229 // that are difficult to use. We'll normalize it and just extract the fields 230 // that are likely to be useful. Fractions and numbers are converted to 231 // floats, dates to unix timestamps, and everything else to strings. 203 232 $meta = array( 204 233 'aperture' => 0, 205 234 'credit' => '', … … 213 242 'title' => '', 214 243 ); 215 244 216 // read iptc first, since it might contain data not available in exif such as caption, description etc 245 // read iptc first, since it might contain data not available in exif such 246 // as caption, description etc 217 247 if ( is_callable('iptcparse') ) { 218 248 getimagesize($file, $info); 219 249 if ( !empty($info['APP13']) ) { … … 222 252 $meta['credit'] = trim( $iptc['2#110'][0] ); 223 253 elseif ( !empty($iptc['2#080'][0]) ) // byline 224 254 $meta['credit'] = trim( $iptc['2#080'][0] ); 225 if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created date eand time255 if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created date and time 226 256 $meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]); 227 257 if ( !empty($iptc['2#120'][0]) ) // caption 228 258 $meta['caption'] = trim( $iptc['2#120'][0] ); … … 249 279 if (!empty($exif['ExposureTime'])) 250 280 $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] ); 251 281 } 252 / / FIXME: try other exif libraries if available282 /** @todo FIXME: try other exif libraries if available */ 253 283 254 284 return apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceImageType ); 255 285 256 286 } 257 287 258 // is the file a real image file? 288 /** 289 * Validate that file is an image. 290 * 291 * @since unknown 292 * 293 * @param string $path File path to test if valid image. 294 * @return bool True if valid image, false if not valid image. 295 */ 259 296 function file_is_valid_image($path) { 260 297 $size = @getimagesize($path); 261 298 return !empty($size); 262 299 } 263 300 264 // is the file an image suitable for displaying within a web page? 301 /** 302 * Validate that file is suitable for displaying within a web page. 303 * 304 * @since unknown 305 * @uses apply_filters() Calls 'file_is_displayable_image' on $result and $path. 306 * 307 * @param string $path File path to test. 308 * @return bool True if suitable, false if not suitable. 309 */ 265 310 function file_is_displayable_image($path) { 266 311 $info = @getimagesize($path); 267 312 if ( empty($info) ) -
import.php
44 44 return array( 'file' => $file, 'id' => $id ); 45 45 } 46 46 47 ?> 47 ?> 48 No newline at end of file -
media.php
688 688 'html' => image_link_input_fields($post, get_option('image_default_link_type')), 689 689 'helps' => __('Enter a link URL or click above for presets.'), 690 690 ), 691 691 'menu_order' => array( 692 692 'label' => __('Order'), 693 693 'value' => $edit_post->menu_order 694 694 ), … … 1488 1488 1489 1489 // support a GET parameter for disabling the flash uploader 1490 1490 function media_upload_use_flash($flash) { 1491 1492 1493 1491 if ( array_key_exists('flash', $_REQUEST) ) 1492 $flash = !empty($_REQUEST['flash']); 1493 return $flash; 1494 1494 } 1495 1495 1496 1496 add_filter('flash_uploader', 'media_upload_use_flash'); 1497 1497 1498 1498 function media_upload_flash_bypass() { 1499 1500 1501 1499 echo '<p class="upload-flash-bypass">'; 1500 printf( __('You are using the Flash uploader. Problems? Try the <a href="%s">Browser uploader</a> instead.'), clean_url(add_query_arg('flash', 0)) ); 1501 echo '</p>'; 1502 1502 } 1503 1503 1504 1504 add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); 1505 1505 1506 1506 function media_upload_html_bypass() { 1507 1508 1509 1510 1511 1512 1513 1507 echo '<p class="upload-html-bypass">'; 1508 if ( array_key_exists('flash', $_REQUEST) ) 1509 // the user manually selected the browser uploader, so let them switch back to Flash 1510 printf( __('You are using the Browser uploader. Try the <a href="%s">Flash uploader</a> instead.'), clean_url(add_query_arg('flash', 1)) ); 1511 else 1512 // the user probably doesn't have Flash 1513 printf( __('You are using the Browser uploader.') ); 1514 1514 1515 1515 echo '</p>'; 1516 1516 } 1517 1517 1518 1518 add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); … … 1520 1520 1521 1521 // make sure the GET parameter sticks when we submit a form 1522 1522 function media_upload_bypass_url($url) { 1523 1524 1525 1523 if ( array_key_exists('flash', $_REQUEST) ) 1524 $url = add_query_arg('flash', intval($_REQUEST['flash'])); 1525 return $url; 1526 1526 } 1527 1527 1528 1528 add_filter('media_upload_form_url', 'media_upload_bypass_url'); -
post.php
1 1 <?php 2 2 3 3 /** 4 * _wp_translate_postdata() -Rename $_POST data from form names to DB post columns.4 * Rename $_POST data from form names to DB post columns. 5 5 * 6 6 * Manipulates $_POST directly. 7 7 * … … 189 189 $text = wp_specialchars( stripslashes( urldecode( $_REQUEST['text'] ) ) ); 190 190 $text = funky_javascript_fix( $text); 191 191 $popupurl = clean_url($_REQUEST['popupurl']); 192 193 192 $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 193 } 194 194 195 195 if ( !empty( $_REQUEST['excerpt'] ) ) 196 196 $post_excerpt = wp_specialchars( stripslashes( $_REQUEST['excerpt'] )); … … 220 220 } 221 221 222 222 function get_default_page_to_edit() { 223 224 225 223 $page = get_default_post_to_edit(); 224 $page->post_type = 'page'; 225 return $page; 226 226 } 227 227 228 228 // Get an existing post and format it for editing. -
theme.php
1 1 <?php 2 /** 3 * WordPress Theme Administration API 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 9 /** 10 * {@internal Missing Short Description}} 11 * 12 * @since unknown 13 * 14 * @return unknown 15 */ 3 16 function current_theme_info() { 4 17 $themes = get_themes(); 5 18 $current_theme = get_current_theme(); … … 18 31 return $ct; 19 32 } 20 33 34 /** 35 * {@internal Missing Short Description}} 36 * 37 * @since unknown 38 * 39 * @return unknown 40 */ 21 41 function get_broken_themes() { 22 42 global $wp_broken_themes; 23 43 … … 25 45 return $wp_broken_themes; 26 46 } 27 47 48 /** 49 * {@internal Missing Short Description}} 50 * 51 * @since unknown 52 * 53 * @return unknown 54 */ 28 55 function get_page_templates() { 29 56 $themes = get_themes(); 30 57 $theme = get_current_theme(); … … 52 79 return $page_templates; 53 80 } 54 81 55 ?> 82 ?> 83 No newline at end of file -
widgets.php
1 1 <?php 2 /** 3 * WordPress Widgets Administration API 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 3 // $_search is unsanitized 9 /** 10 * Display list of widgets, either all or matching search. 11 * 12 * @since unknown 13 * 14 * @param unknown_type $show 15 * @param unknown_type $_search Optional. Search for widgets. Should be unsanitized. 16 */ 4 17 function wp_list_widgets( $show = 'all', $_search = false ) { 5 18 global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls; 6 19 if ( $_search ) { … … 148 161 <?php 149 162 } 150 163 151 152 164 /** 165 * {@internal Missing Short Description}} 166 * 167 * @since unknown 168 * 169 * @param unknown_type $sidebar 170 */ 153 171 function wp_list_widget_controls( $sidebar ) { 154 172 add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' ); 155 173 ?> … … 163 181 <?php 164 182 } 165 183 166 184 /** 185 * {@internal Missing Short Description}} 186 * 187 * @since unknown 188 * 189 * @param unknown_type $params 190 * @return unknown 191 */ 167 192 function wp_list_widget_controls_dynamic_sidebar( $params ) { 168 193 global $wp_registered_widgets; 169 194 static $i = 0; … … 182 207 return $params; 183 208 } 184 209 185 /* 186 * Meta widget used to display the control form for a widget. Called from dynamic_sidebar() 210 /** 211 * Meta widget used to display the control form for a widget. 212 * 213 * Called from dynamic_sidebar(). 214 * 215 * @since unknown 216 * 217 * @param unknown_type $sidebar_args 218 * @return unknown 187 219 */ 188 220 function wp_widget_control( $sidebar_args ) { 189 221 global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget; … … 276 308 return $sidebar_args; 277 309 } 278 310 311 /** 312 * {@internal Missing Short Description}} 313 * 314 * @since unknown 315 * 316 * @param unknown_type $string 317 * @return unknown 318 */ 279 319 function wp_widget_control_ob_filter( $string ) { 280 320 if ( false === $beg = strpos( $string, '%BEG_OF_TITLE%' ) ) 281 321 return ''; … … 286 326 return trim( wp_specialchars( strip_tags( $string ) ) ); 287 327 } 288 328 289 ?> 329 ?> 330 No newline at end of file