On this page
wxr_cdata( string $str ): string
Wraps given string in XML CDATA tag.
Parameters
$strstring Required-
String to wrap in XML CDATA tag.
Return
string
Source
File: wp-admin/includes/export.php. View all references
function wxr_cdata( $str ) {
if ( ! seems_utf8( $str ) ) {
$str = utf8_encode( $str );
}
// $str = ent2ncr(esc_html($str));
$str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
return $str;
}
Related
Uses
| Uses | Description |
|---|---|
| seems_utf8() wp-includes/formatting.php | Checks to see if a string is utf8 encoded. |
Used By
| Used By | Description |
|---|---|
| wxr_term_meta() wp-admin/includes/export.php | Outputs term meta XML tags for a given term object. |
| wxr_post_taxonomy() wp-admin/includes/export.php | Outputs list of taxonomy terms, in XML tag format, associated with a post. |
| export_wp() wp-admin/includes/export.php | Generates the WXR export file for download. |
| wxr_cat_name() wp-admin/includes/export.php | Outputs a cat_name XML tag from a given category object. |
| wxr_category_description() wp-admin/includes/export.php | Outputs a category_description XML tag from a given category object. |
| wxr_tag_name() wp-admin/includes/export.php | Outputs a tag_name XML tag from a given tag object. |
| wxr_tag_description() wp-admin/includes/export.php | Outputs a tag_description XML tag from a given tag object. |
| wxr_term_name() wp-admin/includes/export.php | Outputs a term_name XML tag from a given term object. |
| wxr_term_description() wp-admin/includes/export.php | Outputs a term_description XML tag from a given term object. |
| wxr_authors_list() wp-admin/includes/export.php | Outputs list of authors with posts. |
| wxr_nav_menu_terms() wp-admin/includes/export.php | Outputs all navigation menu terms. |
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wxr_cdata