  We first obtain the $D$-dimensional asymptotically AdS charged black hole
solution in general nonlinear electrodynamics (NLED). We then use the
Hamilton-Jacobi method to describe the motion in curved spacetime of a scalar
particle and a fermion, which, as we show, satisfy the same Hamilton-Jacobi
equation. With absorbing a charged particle, the variation of the generic
charged NLED black hole is calculated in the normal and extended phase spaces.
In the normal phase space, where the cosmological constant and dimensionful
parameters in NLED are fixed, the first and second laws of thermodynamics are
satisfied. In the extended phase space, where the cosmological constant and
dimensionful parameters in NLED are treated as thermodynamic variables, the
first law of thermodynamics is also satisfied. However, the black hole entropy
can either increase or decrease depending on the changes in the dimensionful
parameters. Furthermore, we find that the weak cosmic censorship conjecture is
valid for the extremal and near-extremal black holes in the both phase spaces.
