Skip to content

Instantly share code, notes, and snippets.

@petertwise
Created December 18, 2018 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petertwise/5c06b4e574abfc637d67d04e01086c78 to your computer and use it in GitHub Desktop.
Save petertwise/5c06b4e574abfc637d67d04e01086c78 to your computer and use it in GitHub Desktop.
Running a diff between categories admin screen with YIKES Simple Taxonomy Ordering with and without ACF
diff --git a/test-yikes-drag-drop.html b/test-yikes-drag-drop-withACF.html
index 90c9158..c3b6358 100644
--- a/test-yikes-drag-drop.html
+++ b/test-yikes-drag-drop-withACF.html
@@ -34,10 +34,15 @@ img.emoji {
padding: 0 !important;
}
</style>
-<link rel='stylesheet' href='http://testwp.localhost/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load%5B%5D=dashicons,admin-bar,common,forms,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets&amp;load%5B%5D=,site-icon,l10n,buttons,wp-auth-check&amp;ver=5.0.1' type='text/css' media='all' />
+<link rel='stylesheet' href='http://testwp.localhost/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load%5B%5D=dashicons,admin-bar,common,forms,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-pointer,widgets&amp;load%5B%5D=,site-icon,l10n,buttons,wp-auth-check,wp-color-picker&amp;ver=5.0.1' type='text/css' media='all' />
<!--[if lte IE 7]>
<link rel='stylesheet' id='ie-css' href='http://testwp.localhost/wp-admin/css/ie.min.css?ver=5.0.1' type='text/css' media='all' />
<![endif]-->
+<link rel='stylesheet' id='acf-global-css' href='http://testwp.localhost/wp-content/plugins/advanced-custom-fields/assets/css/acf-global.css?ver=5.7.9' type='text/css' media='all' />
+<link rel='stylesheet' id='acf-input-css' href='http://testwp.localhost/wp-content/plugins/advanced-custom-fields/assets/css/acf-input.css?ver=5.7.9' type='text/css' media='all' />
+<link rel='stylesheet' id='select2-css' href='http://testwp.localhost/wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.min.css?ver=4.0' type='text/css' media='all' />
+<link rel='stylesheet' id='acf-datepicker-css' href='http://testwp.localhost/wp-content/plugins/advanced-custom-fields/assets/inc/datepicker/jquery-ui.min.css?ver=1.11.4' type='text/css' media='all' />
+<link rel='stylesheet' id='acf-timepicker-css' href='http://testwp.localhost/wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.css?ver=1.6.1' type='text/css' media='all' />
<script type="text/javascript">
window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/11\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/11\/svg\/","svgExt":".svg","source":{"concatemoji":"http:\/\/testwp.localhost\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.0.1"}};
!function(a,b,c){function d(a,b){var c=String.fromCharCode;l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,a),0,0);var d=k.toDataURL();l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,b),0,0);var e=k.toDataURL();return d===e}function e(a){var b;if(!l||!l.fillText)return!1;switch(l.textBaseline="top",l.font="600 32px Arial",a){case"flag":return!(b=d([55356,56826,55356,56819],[55356,56826,8203,55356,56819]))&&(b=d([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]),!b);case"emoji":return b=d([55358,56760,9792,65039],[55358,56760,8203,9792,65039]),!b}return!1}function f(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var g,h,i,j,k=b.createElement("canvas"),l=k.getContext&&k.getContext("2d");for(j=Array("flag","emoji"),c.supports={everything:!0,everythingExceptFlag:!0},i=0;i<j.length;i++)c.supports[j[i]]=e(j[i]),c.supports.everything=c.supports.everything&&c.supports[j[i]],"flag"!==j[i]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[j[i]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(h=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",h,!1),a.addEventListener("load",h,!1)):(a.attachEvent("onload",h),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),g=c.source||{},g.concatemoji?f(g.concatemoji):g.wpemoji&&g.twemoji&&(f(g.twemoji),f(g.wpemoji)))}(window,document,window._wpemojiSettings);
@@ -45,9 +50,16 @@ img.emoji {
<script type='text/javascript'>
/* <![CDATA[ */
-var userSettings = {"url":"\/","uid":"1","time":"1545151198","secure":""};/* ]]> */
+var userSettings = {"url":"\/","uid":"1","time":"1545151230","secure":""};/* ]]> */
</script>
-<script type='text/javascript' src='http://testwp.localhost/wp-admin/load-scripts.php?c=1&amp;load%5B%5D=jquery-core,jquery-migrate,utils&amp;ver=5.0.1'></script>
+<script type='text/javascript' src='http://testwp.localhost/wp-admin/load-scripts.php?c=1&amp;load%5B%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-resizable&amp;ver=5.0.1'></script>
+<script type='text/javascript' src='http://testwp.localhost/wp-content/plugins/advanced-custom-fields/assets/js/acf-input.min.js?ver=5.7.9'></script>
+<script type='text/javascript' src='http://testwp.localhost/wp-content/plugins/advanced-custom-fields/assets/inc/select2/4/select2.full.min.js?ver=4.0'></script>
+<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/jquery/ui/datepicker.min.js?ver=1.11.4'></script>
+<script type='text/javascript'>
+jQuery(document).ready(function(jQuery){jQuery.datepicker.setDefaults({"closeText":"Close","currentText":"Today","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"nextText":"Next","prevText":"Previous","dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"dateFormat":"MM d, yy","firstDay":1,"isRTL":false});});
+</script>
+<script type='text/javascript' src='http://testwp.localhost/wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js?ver=1.6.1'></script>
<link id="wp-admin-canonical" rel="canonical" href="http://testwp.localhost/wp-admin/edit-tags.php?taxonomy=category" />
<script>
if ( window.history.replaceState ) {
@@ -119,9 +131,12 @@ var userSettings = {"url":"\/","uid":"1","time":"1545151198","secure":""};/* ]]>
<li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" id="menu-tools">
<a href='tools.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-tools'><br /></div><div class='wp-menu-name'>Tools</div></a>
<ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Tools</li><li class="wp-first-item"><a href='tools.php' class="wp-first-item">Available Tools</a></li><li><a href='import.php'>Import</a></li><li><a href='export.php'>Export</a></li><li><a href='tools.php?page=export_personal_data'>Export Personal Data</a></li><li><a href='tools.php?page=remove_personal_data'>Erase Personal Data</a></li></ul></li>
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" id="menu-settings">
- <a href='options-general.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-settings'><br /></div><div class='wp-menu-name'>Settings </div></a>
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Settings </li><li class="wp-first-item"><a href='options-general.php' class="wp-first-item">General</a></li><li><a href='options-writing.php'>Writing</a></li><li><a href='options-reading.php'>Reading</a></li><li><a href='options-discussion.php'>Discussion</a></li><li><a href='options-media.php'>Media</a></li><li><a href='options-permalink.php'>Permalinks</a></li><li><a href='privacy.php'>Privacy </a></li><li><a href='options-general.php?page=yikes-simple-taxonomy-ordering'>Simple Tax. Ordering</a></li></ul></li><li id="collapse-menu" class="hide-if-no-js"><button type="button" id="collapse-button" aria-label="Collapse Main menu" aria-expanded="true"><span class="collapse-button-icon" aria-hidden="true"></span><span class="collapse-button-label">Collapse menu</span></button></li></ul>
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings" id="menu-settings">
+ <a href='options-general.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-settings'><br /></div><div class='wp-menu-name'>Settings </div></a>
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Settings </li><li class="wp-first-item"><a href='options-general.php' class="wp-first-item">General</a></li><li><a href='options-writing.php'>Writing</a></li><li><a href='options-reading.php'>Reading</a></li><li><a href='options-discussion.php'>Discussion</a></li><li><a href='options-media.php'>Media</a></li><li><a href='options-permalink.php'>Permalinks</a></li><li><a href='privacy.php'>Privacy </a></li><li><a href='options-general.php?page=yikes-simple-taxonomy-ordering'>Simple Tax. Ordering</a></li></ul></li>
+ <li class="wp-has-submenu wp-not-current-submenu menu-top toplevel_page_edit?post_type=acf-field-group menu-top-last" id="toplevel_page_edit-post_type-acf-field-group">
+ <a href='edit.php?post_type=acf-field-group' class="wp-has-submenu wp-not-current-submenu menu-top toplevel_page_edit?post_type=acf-field-group menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-welcome-widgets-menus'><br /></div><div class='wp-menu-name'>Custom Fields</div></a>
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Custom Fields</li><li class="wp-first-item"><a href='edit.php?post_type=acf-field-group' class="wp-first-item">Field Groups</a></li><li><a href='post-new.php?post_type=acf-field-group'>Add New</a></li><li><a href='edit.php?post_type=acf-field-group&#038;page=acf-tools'>Tools</a></li><li><a href='edit.php?post_type=acf-field-group&#038;page=acf-settings-info'>Info</a></li></ul></li><li id="collapse-menu" class="hide-if-no-js"><button type="button" id="collapse-button" aria-label="Collapse Main menu" aria-expanded="true"><span class="collapse-button-icon" aria-hidden="true"></span><span class="collapse-button-label">Collapse menu</span></button></li></ul>
</div>
</div>
<div id="wpcontent">
@@ -410,6 +425,84 @@ try{document.forms.addtag['tag-name'].focus();}catch(e){}
Version 5.0.1 </p>
<div class="clear"></div>
</div>
+<script type="text/javascript">
+(function($) {
+
+ // vars
+ var view = 'add';
+
+ // add missing spinners
+ var $submit = $('input.button-primary');
+ if( !$submit.next('.spinner').length ) {
+ $submit.after('<span class="spinner"></span>');
+ }
+
+
+ // vars
+ var $form = $('#addtag');
+ var $fields = $('#acf-term-fields');
+ var html = '';
+
+ // Store a copy of the $fields html used later to replace after AJAX request.
+ // Hook into 'prepare' action to allow ACF core helpers to first modify DOM.
+ // Fixes issue where hidden #acf-hidden-wp-editor is initialized again.
+ acf.addAction('prepare', function(){
+ html = $fields.html();
+ }, 6);
+
+ // WP triggers click as primary action
+ $submit.on('click', function( e ){
+
+ // validate
+ var valid = acf.validateForm({
+ form: $form,
+ event: e,
+ reset: true
+ });
+
+ // if not valid, stop event and allow validation to continue
+ if( !valid ) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ }
+ });
+
+ // listen to AJAX add-tag complete
+ $(document).ajaxComplete(function(event, xhr, settings) {
+
+ // bail early if is other ajax call
+ if( settings.data.indexOf('action=add-tag') == -1 ) {
+ return;
+ }
+
+ // bail early if response contains error
+ if( xhr.responseText.indexOf('wp_error') !== -1 ) {
+ return;
+ }
+
+ // action for 3rd party customization
+ acf.doAction('remove', $fields);
+
+ // reset HTML
+ $fields.html( html );
+
+ // action for 3rd party customization
+ acf.doAction('append', $fields);
+
+ // reset unload
+ acf.unload.reset();
+ });
+
+
+})(jQuery);
+</script>
+<script type="text/javascript">
+acf.data = {"screen":null,"post_id":null,"nonce":"8f4593a0ae","admin_url":"http:\/\/testwp.localhost\/wp-admin\/","ajaxurl":"http:\/\/testwp.localhost\/wp-admin\/admin-ajax.php","validation":null,"wp_version":"5.0.1","acf_version":"5.7.9","browser":"chrome","locale":"en_US","rtl":false,"mimeTypeIcon":"http:\/\/testwp.localhost\/wp-includes\/images\/media\/default.png","mimeTypes":{"jpg|jpeg|jpe":"image\/jpeg","gif":"image\/gif","png":"image\/png","bmp":"image\/bmp","tiff|tif":"image\/tiff","ico":"image\/x-icon","asf|asx":"video\/x-ms-asf","wmv":"video\/x-ms-wmv","wmx":"video\/x-ms-wmx","wm":"video\/x-ms-wm","avi":"video\/avi","divx":"video\/divx","flv":"video\/x-flv","mov|qt":"video\/quicktime","mpeg|mpg|mpe":"video\/mpeg","mp4|m4v":"video\/mp4","ogv":"video\/ogg","webm":"video\/webm","mkv":"video\/x-matroska","3gp|3gpp":"video\/3gpp","3g2|3gp2":"video\/3gpp2","txt|asc|c|cc|h|srt":"text\/plain","csv":"text\/csv","tsv":"text\/tab-separated-values","ics":"text\/calendar","rtx":"text\/richtext","css":"text\/css","htm|html":"text\/html","vtt":"text\/vtt","dfxp":"application\/ttaf+xml","mp3|m4a|m4b":"audio\/mpeg","aac":"audio\/aac","ra|ram":"audio\/x-realaudio","wav":"audio\/wav","ogg|oga":"audio\/ogg","flac":"audio\/flac","mid|midi":"audio\/midi","wma":"audio\/x-ms-wma","wax":"audio\/x-ms-wax","mka":"audio\/x-matroska","rtf":"application\/rtf","js":"application\/javascript","pdf":"application\/pdf","class":"application\/java","tar":"application\/x-tar","zip":"application\/zip","gz|gzip":"application\/x-gzip","rar":"application\/rar","7z":"application\/x-7z-compressed","psd":"application\/octet-stream","xcf":"application\/octet-stream","doc":"application\/msword","pot|pps|ppt":"application\/vnd.ms-powerpoint","wri":"application\/vnd.ms-write","xla|xls|xlt|xlw":"application\/vnd.ms-excel","mdb":"application\/vnd.ms-access","mpp":"application\/vnd.ms-project","docx":"application\/vnd.openxmlformats-officedocument.wordprocessingml.document","docm":"application\/vnd.ms-word.document.macroEnabled.12","dotx":"application\/vnd.openxmlformats-officedocument.wordprocessingml.template","dotm":"application\/vnd.ms-word.template.macroEnabled.12","xlsx":"application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsm":"application\/vnd.ms-excel.sheet.macroEnabled.12","xlsb":"application\/vnd.ms-excel.sheet.binary.macroEnabled.12","xltx":"application\/vnd.openxmlformats-officedocument.spreadsheetml.template","xltm":"application\/vnd.ms-excel.template.macroEnabled.12","xlam":"application\/vnd.ms-excel.addin.macroEnabled.12","pptx":"application\/vnd.openxmlformats-officedocument.presentationml.presentation","pptm":"application\/vnd.ms-powerpoint.presentation.macroEnabled.12","ppsx":"application\/vnd.openxmlformats-officedocument.presentationml.slideshow","ppsm":"application\/vnd.ms-powerpoint.slideshow.macroEnabled.12","potx":"application\/vnd.openxmlformats-officedocument.presentationml.template","potm":"application\/vnd.ms-powerpoint.template.macroEnabled.12","ppam":"application\/vnd.ms-powerpoint.addin.macroEnabled.12","sldx":"application\/vnd.openxmlformats-officedocument.presentationml.slide","sldm":"application\/vnd.ms-powerpoint.slide.macroEnabled.12","onetoc|onetoc2|onetmp|onepkg":"application\/onenote","oxps":"application\/oxps","xps":"application\/vnd.ms-xpsdocument","odt":"application\/vnd.oasis.opendocument.text","odp":"application\/vnd.oasis.opendocument.presentation","ods":"application\/vnd.oasis.opendocument.spreadsheet","odg":"application\/vnd.oasis.opendocument.graphics","odc":"application\/vnd.oasis.opendocument.chart","odb":"application\/vnd.oasis.opendocument.database","odf":"application\/vnd.oasis.opendocument.formula","wp|wpd":"application\/wordperfect","key":"application\/vnd.apple.keynote","numbers":"application\/vnd.apple.numbers","pages":"application\/vnd.apple.pages"},"select2L10n":{"matches_1":"One result is available, press enter to select it.","matches_n":"%d results are available, use up and down arrow keys to navigate.","matches_0":"No matches found","input_too_short_1":"Please enter 1 or more characters","input_too_short_n":"Please enter %d or more characters","input_too_long_1":"Please delete 1 character","input_too_long_n":"Please delete %d characters","selection_too_long_1":"You can only select 1 item","selection_too_long_n":"You can only select %d items","load_more":"Loading more results&hellip;","searching":"Searching&hellip;","load_fail":"Loading failed"},"google_map_api":"https:\/\/maps.googleapis.com\/maps\/api\/js?libraries=places&ver=3&callback&language=en_US","datePickerL10n":{"closeText":"Done","currentText":"Today","nextText":"Next","prevText":"Prev","weekHeader":"Wk","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesMin":["S","M","T","W","T","F","S"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},"dateTimePickerL10n":{"timeOnlyTitle":"Choose Time","timeText":"Time","hourText":"Hour","minuteText":"Minute","secondText":"Second","millisecText":"Millisecond","microsecText":"Microsecond","timezoneText":"Time Zone","currentText":"Now","closeText":"Done","selectText":"Select","amNames":["AM","A"],"pmNames":["PM","P"]}};
+acf.l10n = [];
+</script>
+<script type="text/javascript">
+acf.doAction('prepare');
+</script>
<div id="wp-auth-check-wrap" class="hidden">
<div id="wp-auth-check-bg"></div>
<div id="wp-auth-check">
@@ -446,10 +539,16 @@ var authcheckL10n = {"beforeunload":"Your session has expired. You can log in ag
/* ]]> */
</script>
<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/wp-auth-check.min.js?ver=5.0.1'></script>
-<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/jquery/ui/core.min.js?ver=1.11.4'></script>
-<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/jquery/ui/widget.min.js?ver=1.11.4'></script>
-<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/jquery/ui/mouse.min.js?ver=1.11.4'></script>
-<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/jquery/ui/sortable.min.js?ver=1.11.4'></script>
+<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/jquery/ui/draggable.min.js?ver=1.11.4'></script>
+<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/jquery/ui/slider.min.js?ver=1.11.4'></script>
+<script type='text/javascript' src='http://testwp.localhost/wp-includes/js/jquery/jquery.ui.touch-punch.js?ver=0.2.2'></script>
+<script type='text/javascript' src='http://testwp.localhost/wp-admin/js/iris.min.js?ver=1.0.7'></script>
+<script type='text/javascript'>
+/* <![CDATA[ */
+var wpColorPickerL10n = {"clear":"Clear","clearAriaLabel":"Clear color","defaultString":"Default","defaultAriaLabel":"Select default color","pick":"Select Color","defaultLabel":"Color value"};
+/* ]]> */
+</script>
+<script type='text/javascript' src='http://testwp.localhost/wp-admin/js/color-picker.min.js?ver=5.0.1'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var simple_taxonomy_ordering_data = {"ajax_url":"http:\/\/testwp.localhost\/wp-admin\/admin-ajax.php","preloader_url":"http:\/\/testwp.localhost\/wp-admin\/images\/wpspin_light.gif"};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment