alch_allowed_editor_protocols

Filter alch_allowed_editor_protocols can be used to change the default protocols that are allowed in the Editor field, which uses those returned by wp_allowed_protocols() as a default value.

This filter is applied just before saving the value to the database.

Example

Say we want our Editor fields to allow only https protocol

function change_alch_allowed_editor_protocols() {
    return array( 'https' );
}

add_filter( 'alch_allowed_editor_protocols', 'change_alch_allowed_editor_protocols' );

In a way it is similar to the alch_allowed_editor_html_tags filter, since both of them control what is going to be stored from the Editor field. The results of both filters are used in the wp_kses before storing the value.

Last updated