Changeset 42047
- Timestamp:
- 10/31/2017 02:53:44 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/wp-api.js
r41678 r42047 804 804 'use strict'; 805 805 806 var wpApiSettings = window.wpApiSettings || {}; 806 var wpApiSettings = window.wpApiSettings || {}, 807 trashableTypes = [ 'Comment', 'Media', 'Comment', 'Post', 'Page', 'Status', 'Taxonomy', 'Type' ]; 807 808 808 809 /** … … 812 813 /** @lends WPApiBaseModel.prototype */ 813 814 { 814 initialize: function( attributes, options ) { 815 816 // Initialize the model. 817 initialize: function() { 815 818 816 819 /** 817 * Determine if a model requires ?force=true to actually delete them. 818 */ 819 if ( 820 ! _.isEmpty( 821 _.filter( 822 this.endpoints, 823 function( endpoint ) { 824 return ( 825 826 // Does the method support DELETE? 827 'DELETE' === endpoint.methods[0] && 828 829 // Exclude models that support trash (Post, Page). 830 ( 831 ! _.isUndefined( endpoint.args.force ) && 832 ! _.isUndefined( endpoint.args.force.description ) && 833 'Whether to bypass trash and force deletion.' !== endpoint.args.force.description 834 ) 835 ); 836 } 837 ) 838 ) 839 ) { 820 * Types that don't support trashing require passing ?force=true to delete. 821 * 822 */ 823 if ( -1 === _.indexOf( trashableTypes, this.name ) ) { 840 824 this.requireForceForDelete = true; 841 825 }
Note: See TracChangeset
for help on using the changeset viewer.