Changeset 32013
- Timestamp:
- 04/04/2015 06:22:30 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-press-this.php
r31992 r32013 9 9 10 10 /** 11 * Press This class 11 * Press This class. 12 12 * 13 13 * @since 4.2.0 … … 39 39 public function site_settings() { 40 40 return array( 41 // Used to trigger the bookmarklet update notice. 42 // Needs to be set here and in get_shortcut_link() in wp-includes/link-template.php. 41 /* 42 * Used to trigger the bookmarklet update notice. Needs to be set here and in 43 * get_shortcut_link() in wp-includes/link-template.php. 44 */ 43 45 'version' => '8', 44 46 … … 252 254 253 255 if ( ! is_wp_error( $source_tmp_file ) && file_exists( $source_tmp_file ) ) { 256 254 257 // Get the content of the source page from the tmp file.. 255 256 258 $source_content = wp_kses( 257 259 @file_get_contents( $source_tmp_file ), … … 290 292 } 291 293 294 /** 295 * Utility method to limit an array to 50 values. 296 * 297 * @ignore 298 * @since 4.2.0 299 * 300 * @param array $value Array to limit. 301 * @return array Original array if fewer than 50 values, limited array, empty array otherwise. 302 */ 292 303 private function _limit_array( $value ) { 293 304 if ( is_array( $value ) ) { … … 302 313 } 303 314 315 /** 316 * Utility method to limit the length of a given string to 5,000 characters. 317 * 318 * @ignore 319 * @since 4.2.0 320 * 321 * @param string $value String to limit. 322 * @return bool|int|string If boolean or integer, that value. If a string, the original value 323 * if fewer than 5,000 characters, a truncated version, otherwise an 324 * empty string. 325 */ 304 326 private function _limit_string( $value ) { 305 327 $return = ''; … … 321 343 } 322 344 345 /** 346 * Utility method to limit a given URL to 2,048 characters. 347 * 348 * @ignore 349 * @since 4.2.0 350 * 351 * @param string $url URL to check for length and validity. 352 * @return string Escaped URL if of valid length (< 2048) and makeup. Empty string otherwise. 353 */ 323 354 private function _limit_url( $url ) { 324 355 if ( ! is_string( $url ) ) { … … 349 380 } 350 381 382 /** 383 * Utility method to limit image source URLs. 384 * 385 * Excluded URLs include share-this type buttons, loaders, spinners, spacers, WP interface images, 386 * tiny buttons or thumbs, mathtag.com or quantserve.com images, or the WP stats gif. 387 * 388 * @ignore 389 * @since 4.2.0 390 * 391 * @param string $src Image source URL. 392 * @return string If not matched an excluded URL type, the original URL, empty string otherwise. 393 */ 351 394 private function _limit_img( $src ) { 352 395 $src = $this->_limit_url( $src ); … … 384 427 } 385 428 429 /** 430 * Limit embed source URLs to specific providers. 431 * 432 * Not all core oEmbed providers are supported. Supported providers include YouTube, Vimeo, 433 * Vine, Daily Motion, SoundCloud, and Twitter. 434 * 435 * @ignore 436 * @since 4.2.0 437 * 438 * @param string $src Embed source URL. 439 * @return string If not from a supported provider, an empty string. Otherwise, a reformattd embed URL. 440 */ 386 441 private function _limit_embed( $src ) { 387 442 $src = $this->_limit_url( $src ); … … 415 470 } 416 471 472 /** 473 * Process a meta data entry from the source. 474 * 475 * @ignore 476 * @since 4.2.0 477 * 478 * @param string $meta_name Meta key name. 479 * @param mixed $meta_value Meta value. 480 * @param array $data Associative array of source data. 481 * @return array Processed data array. 482 */ 417 483 private function _process_meta_entry( $meta_name, $meta_value, $data ) { 418 484 if ( preg_match( '/:?(title|description|keywords|site_name)$/', $meta_name ) ) { … … 544 610 } 545 611 546 // Fetch and gather <link> data 612 // Fetch and gather <link> data. 547 613 if ( empty( $data['_links'] ) ) { 548 614 $data['_links'] = array();
Note: See TracChangeset
for help on using the changeset viewer.