Skip to main content
get post type by $post object
Source Link
CRavon
  • 149
  • 9

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 12 );
function remove_row_actions_staff( $actions, $post ){
  //This line stops function execution if user has some admin capabilities 
  if( current_user_can( 'edit_users''administrator' ) ):
    return $actions;
   endif; 

  if( get_post_type$post->post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions_staff( $actions ){
  //This line stops function execution if user has some admin capabilities 
  if( current_user_can( 'edit_users' ) ):
    return $actions;
   endif; 

  if( get_post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 2 );
function remove_row_actions_staff( $actions, $post ){
  //This line stops function execution if user has some admin capabilities 
  if( current_user_can( 'administrator' ) ):
    return $actions;
   endif; 

  if( $post->post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}
fixed void return
Source Link
CRavon
  • 149
  • 9

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions_staff( $actions ){
  //This line stops function execution if user has some admin capabilities 
  if( current_user_can( 'edit_users' ) ):
    return;return $actions;
   endif; 

  if( get_post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions_staff( $actions ){
  //This line stops function execution if user has some admin capabilities 
  if( current_user_can( 'edit_users' ) ):
    return;
   endif; 

  if( get_post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions_staff( $actions ){
  //This line stops function execution if user has some admin capabilities 
  if( current_user_can( 'edit_users' ) ):
    return $actions;
   endif; 

  if( get_post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}
typo
Source Link
CRavon
  • 149
  • 9

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions_staff( $actions ){
  //This line stopstops function execution if user has some admin capabilities 
  if( current_user_can( 'edit_users' ) ):
    return;
   endif; 

  if( get_post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions_staff( $actions ){
  //This line stop function execution if user has some admin capabilities 
  if( current_user_can( 'edit_users' ) ):
    return;
   endif; 

  if( get_post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}

You can add a condition on capabilities in order to exclude the admin from the unset action for example

add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
function remove_row_actions_staff( $actions ){
  //This line stops function execution if user has some admin capabilities 
  if( current_user_can( 'edit_users' ) ):
    return;
   endif; 

  if( get_post_type() === 'wiki-testimonials' )
    unset( $actions['view'] );
    unset( $actions['edit'] );
  return $actions;
}
Source Link
CRavon
  • 149
  • 9
Loading