Deprecated

This function has been deprecated. This function was replaced by @see AnsPressFormValidate::sanitize_description() instead.

ap_sanitize_description_field( string $content )

Description #

Sanitize AnsPress question and answer description field for database.

Parameters #

  • $content
    string (Required) Post content.

Changelog #

VersionDescription
4.1.0This function was replaced by @see AnsPressFormValidate::sanitize_description().
3.0.0Introduced.

Source #

File: includes/deprecated.php

function ap_sanitize_description_field( $content ) {
	_deprecated_function( __FUNCTION__, '4.1.0', 'AnsPress\Form\Validate::sanitize_description()' );

	$content = str_replace( '<!--more-->', '', $content );
	$content = preg_replace_callback( '/<pre.*?>(.*?)<\/pre>/imsu', 'ap_sanitize_description_field_pre_content', $content );
	$content = preg_replace_callback( '/<code.*?>(.*?)<\/code>/imsu', 'ap_sanitize_description_field_code_content', $content );
	$content = wp_kses( $content, ap_form_allowed_tags() );
	$content = sanitize_post_field( 'post_content', $content, 0, 'db' );
	return $content;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment