Add upstream

This commit is contained in:
root
2019-10-24 00:12:05 +02:00
parent 85d41e4216
commit ac980f592c
3504 changed files with 1049983 additions and 29971 deletions

View File

@@ -0,0 +1,29 @@
// defines Global ajaxurl if needed
//if ( ( typeof ajaxurl === 'undefined' ) && ( typeof wp.media.view.l10n.mla_strings.ajaxurl === 'string' ) ) {
// var ajaxurl = wp.media.view.l10n.mla_strings.ajaxurl;
//}
if ( typeof ajaxurl === 'undefined' ) {
// Default location at worst
var ajaxurl = '/wp-admin/admin-ajax.php';
// See if we can do better
try {
if ( typeof window._wpMediaViewsL10n === 'object' ) {
if ( typeof window._wpMediaViewsL10n.mla_strings === 'object' ) {
if ( typeof window._wpMediaViewsL10n.mla_strings.ajaxurl === 'string' ) {
var ajaxurl = window._wpMediaViewsL10n.mla_strings.ajaxurl;
} else {
console.log( 'mla-define-ajaxurl-scripts.js window._wpMediaViewsL10n.mla_strings.ajaxurl failed' );
}
} else {
console.log( 'mla-define-ajaxurl-scripts.js window._wpMediaViewsL10n.mla_strings failed' );
}
} else {
console.log( 'mla-define-ajaxurl-scripts.js window._wpMediaViewsL10n failed' );
}
} catch ( error ) {
console.log( 'mla-define-ajaxurl-scripts.js error thrown' );
};
}