Created
November 1, 2022 18:50
-
-
Save d4mation/90e44828f2322a9ea8ab7e25f804c71f to your computer and use it in GitHub Desktop.
Revisions
-
d4mation created this gist
Nov 1, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ // Just run this in the console and you're good to go var firstOption = true; jQuery( 'select[name="edd_report_series[0][download]"] option' ).each( function( index, option ) { if ( jQuery( option ).val() == 0 || jQuery( option ).val() == 'all' ) return true; if ( firstOption ) { var $row = jQuery( option ).closest( '.eddar-collection-row' ); firstOption = false; } else { jQuery( '.eddar-collection-add-row' ).click(); var $row = jQuery( '.eddar-collection-row' ).last(); } $row.find( 'select[name*="context"]' ).val( 'earnings_gross' ).trigger( 'change' ); $row.find( 'select[name*="download"]' ).val( jQuery( option ).val() ).trigger( 'change' ).trigger( 'chosen:updated' ); $row.find( 'select[name*="status"]' ).val( 'complete' ).trigger( 'change' ); jQuery( '.eddar-collection-add-row' ).click(); $row = jQuery( '.eddar-collection-row' ).last(); $row.find( 'select[name*="context"]' ).val( 'earnings_gross' ).trigger( 'change' ); $row.find( 'select[name*="download"]' ).val( jQuery( option ).val() ).trigger( 'change' ).trigger( 'chosen:updated' ); $row.find( 'select[name*="status"]' ).val( 'edd_subscription' ).trigger( 'change' ); } );