PluginProbe ʕ •ᴥ•ʔ
Post Views Counter / 1.2.6
Post Views Counter v1.2.6
1.7.13 1.7.12 1.7.11 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.2 1.3.2.1 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.7.0 1.7.1 1.7.10 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9
post-views-counter / js / frontend.js
post-views-counter / js Last commit date
admin-dashboard.js 9 years ago admin-post.js 9 years ago admin-quick-edit.js 9 years ago admin-settings.js 9 years ago chart.min.js 9 years ago frontend.js 9 years ago
frontend.js
44 lines
1 ( function ( $ ) {
2
3 $( document ).ready( function () {
4
5 // rest api request
6 if ( pvcArgsFrontend.mode == 'rest_api' ) {
7
8 var request = {
9 id: pvcArgsFrontend.postID
10 };
11
12 $.ajax( {
13 url: pvcArgsFrontend.requestURL + '?id=' + pvcArgsFrontend.postID,
14 type: 'post',
15 async: true,
16 cache: false,
17 data: request,
18 beforeSend: function ( xhr ) {
19 xhr.setRequestHeader( 'X-WP-Nonce', pvcArgsFrontend.nonce );
20 }
21 } );
22
23 // admin ajax request
24 } else {
25
26 var request = {
27 action: 'pvc-check-post',
28 pvc_nonce: pvcArgsFrontend.nonce,
29 id: pvcArgsFrontend.postID
30 };
31
32 $.ajax( {
33 url: pvcArgsFrontend.requestURL,
34 type: 'post',
35 async: true,
36 cache: false,
37 data: request
38 } );
39
40 }
41
42 } );
43
44 } )( jQuery );