Changeset 27739
- Timestamp:
- 03/26/2014 02:56:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/kses.php
r27707 r27739 502 502 global $allowedposttags, $allowedtags, $allowedentitynames; 503 503 504 if ( is_array( $context ) ) 504 if ( is_array( $context ) ) { 505 /** 506 * Filter HTML elements allowed for a given context. 507 * 508 * @since 3.5.0 509 * 510 * @param string $tags Allowed tags, attributes, and/or entities. 511 * @param string $context Context to judge allowed tags by. Allowed values are 'post', 512 * 'data', 'strip', 'entities', 'explicit', or the name of a filter. 513 */ 505 514 return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' ); 515 } 506 516 507 517 switch ( $context ) { 508 518 case 'post': 519 /** This filter is documented in wp-includes/kses.php */ 509 520 return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context ); 510 521 break; … … 513 524 $tags = $allowedtags; 514 525 $tags['a']['rel'] = true; 526 /** This filter is documented in wp-includes/kses.php */ 515 527 return apply_filters( 'wp_kses_allowed_html', $tags, $context ); 516 528 break; 517 529 case 'strip': 530 /** This filter is documented in wp-includes/kses.php */ 518 531 return apply_filters( 'wp_kses_allowed_html', array(), $context ); 519 532 break; 520 533 case 'entities': 534 /** This filter is documented in wp-includes/kses.php */ 521 535 return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context); 522 536 break; 523 537 case 'data': 524 538 default: 539 /** This filter is documented in wp-includes/kses.php */ 525 540 return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context ); 526 541 } … … 541 556 */ 542 557 function wp_kses_hook( $string, $allowed_html, $allowed_protocols ) { 543 $string = apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols); 558 /** 559 * Filter content to be run through kses. 560 * 561 * @since 2.3.0 562 * 563 * @param string $string Content to run through kses. 564 * @param array $allowed_html Allowed HTML elements. 565 * @param array $allowed_protocols Allowed protocol in links. 566 */ 567 $string = apply_filters( 'pre_kses', $string, $allowed_html, $allowed_protocols ); 544 568 return $string; 545 569 } … … 1415 1439 1416 1440 $css_array = explode( ';', trim( $css ) ); 1441 1442 /** 1443 * Filter list of allowed CSS attributes. 1444 * 1445 * @since 2.8.1 1446 * 1447 * @param array $attr List of allowed CSS attributes. 1448 */ 1417 1449 $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float', 1418 1450 'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color',
Note: See TracChangeset
for help on using the changeset viewer.