23 lines
328 B
PHP
23 lines
328 B
PHP
<?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');
|
|
|
|
|
|
|
|
?>
|