some more little codes for restrictions and registrations
This commit is contained in:
22
plugins/fipfcard_plugin/php/author_restriction.php
Normal file
22
plugins/fipfcard_plugin/php/author_restriction.php
Normal 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');
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user