Skip to content

Commit 9f0b735

Browse files
authored
Merge pull request #32 from WordPress-Phoenix/bug/wp-hooks
Fix wp.hooks conflict
2 parents 9cfd023 + ccb8789 commit 9f0b735

3 files changed

Lines changed: 29 additions & 29 deletions

File tree

inc/class-assets.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ public static function inline_js_header() {
892892
<?php self::selectize_js(); ?>
893893
!function( t, o ) {
894894
"use strict";
895-
t.wp = t.wp || {}, t.wp.hooks = t.wp.hooks || new function() {
895+
t.wpop = t.wpop || {}, t.wpop.hooks = t.wpop.hooks || new function() {
896896
function t( t, o, i, n ) {
897897
var e, r, p;
898898
if ( a[t][o] ) if ( i ) if ( e = a[t][o], n ) for ( p = e.length; p--; ) (r = e[p]).callback === i && r.context === n && e.splice( p, 1 ); else for ( p = e.length; p--; ) e[p].callback === i && e.splice( p, 1 ); else a[t][o] = []
@@ -937,7 +937,7 @@ function i( t, o, i ) {
937937
}
938938
}( window ), jQuery( document ).ready( function( t ) {
939939
var o;
940-
wp.hooks.addAction( "wpopPreInit", p ), wp.hooks.addAction( "wpopInit", r, 5 ), wp.hooks.addAction( "wpopFooterScripts", c ), wp.hooks.addAction( "wpopInit", l ), wp.hooks.addAction( "wpopInit", f ), wp.hooks.addAction( "wpopInit", e, 100 ), wp.hooks.addAction( "wpopSectionNav", n ), wp.hooks.addAction( "wpopPwdClear", d ), wp.hooks.addAction( "wpopImgUpload", u ), wp.hooks.addAction( "wpopImgRemove", w ), wp.hooks.addAction( "wpopSubmit", a ), wp.hooks.doAction( "wpopPreInit" );
940+
wpop.hooks.addAction( "wpopPreInit", p ), wpop.hooks.addAction( "wpopInit", r, 5 ), wpop.hooks.addAction( "wpopFooterScripts", c ), wpop.hooks.addAction( "wpopInit", l ), wpop.hooks.addAction( "wpopInit", f ), wpop.hooks.addAction( "wpopInit", e, 100 ), wpop.hooks.addAction( "wpopSectionNav", n ), wpop.hooks.addAction( "wpopPwdClear", d ), wpop.hooks.addAction( "wpopImgUpload", u ), wpop.hooks.addAction( "wpopImgRemove", w ), wpop.hooks.addAction( "wpopSubmit", a ), wpop.hooks.doAction( "wpopPreInit" );
941941

942942
var i = wp.template( "wpop-media-stats" );
943943

@@ -1026,15 +1026,15 @@ function w( o, i ) {
10261026
}
10271027

10281028
t( "#wpopNav li a" ).click( function( t ) {
1029-
wp.hooks.doAction( "wpopSectionNav", this, t )
1030-
} ), wp.hooks.doAction( "wpopInit" ), t( 'input[type="submit"]' ).click( function( t ) {
1031-
wp.hooks.doAction( "wpopSubmit", this, t )
1029+
wpop.hooks.doAction( "wpopSectionNav", this, t )
1030+
} ), wpop.hooks.doAction( "wpopInit" ), t( 'input[type="submit"]' ).click( function( t ) {
1031+
wpop.hooks.doAction( "wpopSubmit", this, t )
10321032
} ), t( ".pwd-clear" ).click( function( t ) {
1033-
wp.hooks.doAction( "wpopPwdClear", this, t )
1033+
wpop.hooks.doAction( "wpopPwdClear", this, t )
10341034
} ), t( ".img-upload" ).on( "click", function( t ) {
1035-
wp.hooks.doAction( "wpopImgUpload", this, t )
1035+
wpop.hooks.doAction( "wpopImgUpload", this, t )
10361036
} ), t( ".img-remove" ).on( "click", function( t ) {
1037-
wp.hooks.doAction( "wpopImgRemove", this, t )
1037+
wpop.hooks.doAction( "wpopImgRemove", this, t )
10381038
} )
10391039
} );
10401040
</script>
@@ -1083,7 +1083,7 @@ public static function inline_js_footer() {
10831083

10841084
<script type="text/javascript">
10851085
jQuery( document ).ready( function() {
1086-
wp.hooks.doAction( 'wpopFooterScripts' );
1086+
wpop.hooks.doAction( 'wpopFooterScripts' );
10871087
} );
10881088
</script>
10891089
<?php

unminified-assets-v3/scripts.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
! function( t, n ) {
66
"use strict";
7-
t.wp = t.wp || {}, t.wp.hooks = t.wp.hooks || new function() {
7+
t.wp = t.wp || {}, t.wpop.hooks = t.wpop.hooks || new function() {
88
function t( t, n, r, i ) {
99
var e, o, c;
1010
if ( f[t][n] ) {
@@ -74,57 +74,57 @@ jQuery( document ).ready(
7474
function( $ ) {
7575
var wpModal;
7676
registerAllActions();
77-
wp.hooks.doAction( 'wpopPreInit' );
77+
wpop.hooks.doAction( 'wpopPreInit' );
7878
var mediaStats = wp.template( 'wpop-media-stats' );
7979

8080
$( '#wpopNav li a' ).click(
8181
function( evt ) {
82-
wp.hooks.doAction( 'wpopSectionNav', this, evt ); // reg. here to allow "click" from hash to select a section
82+
wpop.hooks.doAction( 'wpopSectionNav', this, evt ); // reg. here to allow "click" from hash to select a section
8383
}
8484
);
8585

86-
wp.hooks.doAction( 'wpopInit' ); // main init
86+
wpop.hooks.doAction( 'wpopInit' ); // main init
8787

8888
$( 'input[type="submit"]' ).click(
8989
function( evt ) {
90-
wp.hooks.doAction( 'wpopSubmit', this, evt );
90+
wpop.hooks.doAction( 'wpopSubmit', this, evt );
9191
}
9292
);
9393

9494
$( '.pwd-clear' ).click(
9595
function( evt ) {
96-
wp.hooks.doAction( 'wpopPwdClear', this, evt );
96+
wpop.hooks.doAction( 'wpopPwdClear', this, evt );
9797
}
9898
);
9999

100100
$( '.img-upload' ).on(
101101
'click', function( event ) {
102-
wp.hooks.doAction( 'wpopImgUpload', this, event );
102+
wpop.hooks.doAction( 'wpopImgUpload', this, event );
103103
}
104104
);
105105

106106
$( '.img-remove' ).on(
107107
'click', function( event ) {
108-
wp.hooks.doAction( 'wpopImgRemove', this, event );
108+
wpop.hooks.doAction( 'wpopImgRemove', this, event );
109109
}
110110
);
111111

112112
function registerAllActions() {
113-
wp.hooks.addAction( 'wpopPreInit', nixHashJumpJank );
114-
wp.hooks.addAction( 'wpopInit', handleInitHashSelection, 5 );
115-
wp.hooks.addAction( 'wpopFooterScripts', initIrisColorSwatches );
116-
wp.hooks.addAction( 'wpopInit', initSelectizeInputs );
117-
wp.hooks.addAction( 'wpopInit', initMediaUploadField );
113+
wpop.hooks.addAction( 'wpopPreInit', nixHashJumpJank );
114+
wpop.hooks.addAction( 'wpopInit', handleInitHashSelection, 5 );
115+
wpop.hooks.addAction( 'wpopFooterScripts', initIrisColorSwatches );
116+
wpop.hooks.addAction( 'wpopInit', initSelectizeInputs );
117+
wpop.hooks.addAction( 'wpopInit', initMediaUploadField );
118118

119-
wp.hooks.addAction( 'wpopInit', wpopDisableSpinner, 100 );
119+
wpop.hooks.addAction( 'wpopInit', wpopDisableSpinner, 100 );
120120

121-
wp.hooks.addAction( 'wpopSectionNav', handleSectionNavigation );
121+
wpop.hooks.addAction( 'wpopSectionNav', handleSectionNavigation );
122122

123-
wp.hooks.addAction( 'wpopPwdClear', doPwdFieldClear );
124-
wp.hooks.addAction( 'wpopImgUpload', doMediaUpload );
125-
wp.hooks.addAction( 'wpopImgRemove', doMediaRemove );
123+
wpop.hooks.addAction( 'wpopPwdClear', doPwdFieldClear );
124+
wpop.hooks.addAction( 'wpopImgUpload', doMediaUpload );
125+
wpop.hooks.addAction( 'wpopImgRemove', doMediaRemove );
126126

127-
wp.hooks.addAction( 'wpopSubmit', wpopShowSpinner );
127+
wpop.hooks.addAction( 'wpopSubmit', wpopShowSpinner );
128128
}
129129

130130
/* CORE */

wpop-init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @authors 🌵 WordPress Phoenix 🌵 / Seth Carstens, David Ryan
66
* @package wpop
7-
* @version 4.1.7
7+
* @version 4.1.8
88
* @license GPL-2.0+ - please retain comments that express original build of this file by the author.
99
*/
1010

0 commit comments

Comments
 (0)