#37258 closed defect (bug) (duplicate)
Missing parameter in getNodes method of wp.mce.views
| Reported by: | programmin | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Editor | Version: | 4.6 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
In current WP, and in last few versions, calling a view's getNodes with callback, expects a callback that will take:
editor, this, $( this ).find( '.wpview-content' ).get( 0 )
as arguments.
https://core.trac.wordpress.org/browser/tags/4.5.3/src/wp-includes/js/mce-view.js#L379
In current WP 4.6 beta, this same getNodes function expects a callback to accept only editor, and this as arguments:
getNodes: function( callback, rendered ) { this.getEditors( function( editor ) { var self = this; $( editor.getBody() ) .find( '[data-wpview-text="' + self.encodedText + '"]' ) .filter( function() { var data; if ( rendered == null ) { return true; } data = $( this ).data( 'rendered' ) === true; return rendered ? data : ! data; } ) .each( function() { callback.call( self, editor, this ); } ); } ); },
Was there a reason for this breaking change, a reworking of wp-views system? Or just removing the redundant parameter?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the ticket! Let's close this in favour of #36434, which is still open? There's a patch there as well.