some more little codes for restrictions and registrations

This commit is contained in:
asus
2024-03-02 21:43:43 +01:00
parent 7738ad1863
commit 8862bab1bd
16 changed files with 312 additions and 131 deletions

View File

@@ -0,0 +1,22 @@
<?php
function restrict_author_page_CIPF() {
if (!is_author())
return;
global $post;
$author_id = get_the_author_meta( 'ID' );
$current_user_id = get_current_user_id();
if ($current_user_id != $author_id) {
wp_redirect(home_url());
exit;
}
}
add_action('template_redirect', 'restrict_author_page_CIPF');
?>