Commit 20cc3d57 authored by Romain Duminil's avatar Romain Duminil

#42 Fix bug

parent 4bffa330
......@@ -46,9 +46,9 @@ class CommunityProject
function redirect_if_not_author()
{
if ( isset( $_GET['post'] ) && $_GET['action'] === 'edit' )
if ( isset( $_GET['post'] ) && $_GET['action'] === 'edit' && get_post( $_GET['post'] )->post_type === "project" )
{
if( ! current_user_can( 'publish_posts' ) && get_post()->post_author != get_current_user_id() )
if( ! current_user_can( 'publish_posts' ) && get_post($_GET['post'])->post_author != get_current_user_id() )
{
wp_redirect( admin_url() );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment