ID <= 0 ) { return $actions; } $user_id = (int) $user_object->ID; /** * Filters whether the "View activity footprint" row action is shown * for a user in the classic Users list table. * * Return false to suppress the action — e.g. to scope it to a role, * or to hide it on the current user's own row. Default true for any * chromeless request that reaches this filter (where the row is * already gated by the `list_users` capability the table requires). * * @param bool $show Whether to show the action. Default true. * @param WP_User $user_object The user the row represents. */ if ( ! apply_filters( 'openstation_user_footprint_row_action', true, $user_object ) ) { return $actions; } // Graceful fallback target, followed only when JS is off or on a // modifier / middle click: the profile-edit screen for this user // (own profile uses profile.php). Inside the shell the chromeless // bridge preventDefaults the click and opens the footprint instead. $fallback_url = get_current_user_id() === $user_id ? admin_url( 'profile.php' ) : add_query_arg( 'user_id', $user_id, admin_url( 'user-edit.php' ) ); $actions['os-footprint'] = sprintf( '%4$s', esc_url( $fallback_url ), $user_id, esc_attr( $user_object->display_name ), esc_html__( 'View activity footprint', 'desktop-mode' ) ); return $actions; } add_filter( 'user_row_actions', 'openstation_user_footprint_row_action', 10, 2 );