  We study Einstein's gravity coupled to nonlinear electrodynamics with two
parameters in Anti-de Sitter spacetime. Magnetically charged black holes in an
extended phase space is investigated. We obtain the mass and metric functions,
their asymptotic and corrections to the Reissner--Nordstr\"{o}m metric function
when the cosmological constant vanishes. The first law of black hole
thermodynamics in extended phase space is formulated and the magnetic potential
and the thermodynamic conjugate to the coupling are obtained. We proved the
generalized Smarr relation. The heat capacity and the Gibbs free energy are
computed and phase transitions are studied. It was shown that the electric
field of charged objects at the origin and electrostatic self-energy are finite
within the nonlinear electrodynamics proposed.
