Based on the new version of the gedanken experiment proposed by Sorce and Wald, we investigate the weak cosmic censorship conjecture (WCCC) for a Reissner-Nordstr{o}m-Anti-de Sitter (RN-AdS) black hole under the perturbation of extra matter fields. Firstly, we propose that the cosmological constant can be effectively derived from the matter fields and its value varies with the matter fields perturbing the black hole. Meanwhile, we assume that the perturbation satisfies the stability condition. This condition means that after a long time of the perturbation, the black hole solution also belongs to the family of the RN-AdS solution. After that, based on both the stability condition and the null energy condition, while using the off-shell variation method, the first-order and the second-order perturbation inequalities are derived respectively when the cosmological constant is considered as a dynamic variable. It is the first time to extend the two perturbation inequalities to contain the term of the press and volume of thermodynamics. Finally, we perform the two perturbation inequalities into testing the WCCC for the RN-AdS black hole under the second-order approximation of the perturbation. It is shown that if the variation of the cosmological constant is caused by the matter fields, while the stability condition and the null energy condition are all satisfied, the black hole cannot be destroyed after the perturbation. In other words, the WCCC for the RN-AdS black hole is valid under the second-order approximation of the perturbation.