public/ckeditor/4.4dev/core/filter.js
function( newRules, featureName, overrideCustom ) {
			// Check arguments and constraints. Clear cache.
			if ( !beforeAddingRule( this, newRules, overrideCustom ) )
				return false;

			var i, ret;

			if ( typeof newRules == 'string' )
				newRules = parseRulesString( newRules );
			else if ( newRules instanceof CKEDITOR.style ) {
				// If style has the cast method defined, use it and abort.
				if ( newRules.toAllowedContentRules )
					return this.allow( newRules.toAllowedContentRules( this.editor ), featureName, overrideCustom );

				newRules = convertStyleToRules( newRules );
			} else if ( CKEDITOR.tools.isArray( newRules ) ) {
				for ( i = 0; i < newRules.length; ++i )
					ret = this.allow( newRules[ i ], featureName, overrideCustom );
				return ret; // Return last status.
			}

			addAndOptimizeRules( this, newRules, featureName, this.allowedContent, this._.allowedRules );

			return true;
		}
function( newRules, featureName, overrideCustom ) {
			// Check arguments and constraints. Clear cache.
			if ( !beforeAddingRule( this, newRules, overrideCustom ) )
				return false;

			var i, ret;

			if ( typeof newRules == 'string' )
				newRules = parseRulesString( newRules );
			else if ( newRules instanceof CKEDITOR.style ) {
				// If style has the cast method defined, use it and abort.
				if ( newRules.toAllowedContentRules )
					return this.allow( newRules.toAllowedContentRules( this.editor ), featureName, overrideCustom );

				newRules = convertStyleToRules( newRules );
			} else if ( CKEDITOR.tools.isArray( newRules ) ) {
				for ( i = 0; i < newRules.length; ++i )
					ret = this.allow( newRules[ i ], featureName, overrideCustom );
				return ret; // Return last status.
			}

			addAndOptimizeRules( this, newRules, featureName, this.allowedContent, this._.allowedRules );

			return true;
		}
function ( newRules , featureName , overrideCustom ) { // Check arguments and constraints. Clear cache. if ( ! beforeAddingRule ( this , newRules , overrideCustom ) ) return false ; var i , ret ; if ( typeof newRules == 'string' ) newRules = parseRulesString ( newRules ) ; else if ( newRules instanceof CKEDITOR . style ) { // If style has the cast method defined, use it and abort. if ( newRules . toAllowedContentRules ) return this . allow ( newRules . toAllowedContentRules ( this . editor ) , featureName , overrideCustom ) ; newRules = convertStyleToRules ( newRules ) ; } else if ( CKEDITOR . tools . isArray ( newRules ) ) { for ( i = 0 ; i < newRules . length ; ++ i ) ret = this . allow ( newRules [ i ] , featureName , overrideCustom ) ; return ret ; // Return last status. } addAndOptimizeRules ( this , newRules , featureName , this . allowedContent , this . _ . allowedRules ) ; return true ; }
Adds allowed content rules to the filter.

Read about rules formats in [Allowed Content Rules guide](#!/guide/dev_allowed_content_rules).

// Add a basic rule for custom image feature (e.g. 'MyImage' button).
editor.filter.allow( 'img[!src,alt]', 'MyImage' );

// Add rules for two header styles allowed by 'HeadersCombo'.
var header1Style = new CKEDITOR.style( { element: 'h1' } ),
header2Style = new CKEDITOR.style( { element: 'h2' } );
editor.filter.allow( [ header1Style, header2Style ], 'HeadersCombo' );

@param {CKEDITOR.filter.allowedContentRules} newRules Rule(s) to be added.
@param {String} [featureName] Name of a feature that allows this content (most often plugin/button/command name).
@param {Boolean} [overrideCustom] By default this method will reject any rules
if {@link CKEDITOR.config#allowedContent} is defined to avoid overriding it.
Pass `true` to force rules addition.
@returns {Boolean} Whether the rules were accepted.
Adds allowed content rules to the filter .