A unified wall-boundary condition for the pressure-based lattice Boltzmann method (LBM) is proposed. The present approach is developed from the direct-forcing technique in the immersed boundary method and is derived from the equilibrium pressure distribution function. The proposed method can handle many kinds of wall boundaries, such as fixed wall and moving wall boundaries, in the same way. It is found that the new method has the following advantages: (1) simple in concept and easy to implement, (2) higher-order accuracy, (3) mass conservation, and (4) a stable and good convergence rate. Based on this wall-boundary condition, if a solid wall is immersed in a fluid, then by applying Gauss's theorem, the formulas for computing the force and torque acting on the solid wall from fluid flow are derived from the volume integrals over the solid volume instead of from the surface integrals over the solid surface. Based on the pressure-based LBM, inlet and outlet boundary conditions are also proposed. The order of accuracy of the proposed boundary condition is demonstrated with the errors of the velocity field, wall stress, and gradients of velocity and pressure. The steady flow past a circular cylinder is simulated to demonstrate the efficiency and capabilities of the proposed unified method.