This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* https://stackoverflow.com/a/62103618/9537649 | |
* https://m.facebook.com/${author}/posts/${postId} | |
*/ | |
function start() { | |
setTimeout(function() { | |
const rand = Math.floor(Math.random() * 767) + 1 + Math.random().toString(36).substr(2, 5); | |
document.querySelector("input[name='comment_text']").value = rand; | |
const submitButton = document.querySelector("button[name='submit']"); | |
submitButton.disabled = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_user_role($id) { | |
$user = new WP_User($id); | |
return array_shift($user->roles); | |
} | |
function verify_user_role_post_status($user_role, $user_id) { | |
if (in_array($user_role, (array) 'subscriber')) { | |
auto_draft_posts_subscriber('draft', $user_id); |