20 lines
429 B
JavaScript
20 lines
429 B
JavaScript
|
|
jQuery(document).ready( function($) {
|
||
|
|
|
||
|
|
var time = parseInt(mark_as_read_auto_js.time) * 1000;
|
||
|
|
if(time == '') {
|
||
|
|
time = 10000; // default to 10 seconds
|
||
|
|
}
|
||
|
|
|
||
|
|
setTimeout( function() {
|
||
|
|
|
||
|
|
var data = {
|
||
|
|
action: 'mark_post_as_read',
|
||
|
|
post_read: mark_as_read_auto_js.post_id
|
||
|
|
};
|
||
|
|
$.post(mark_as_read_auto_js.ajaxurl, data, function(response) {
|
||
|
|
// post has been marked as read
|
||
|
|
});
|
||
|
|
|
||
|
|
}, time );
|
||
|
|
|
||
|
|
});
|