Let x be the oxidation number of P in Ba(H2P––O2)2.
Since the overall charge on the compound is 0, the sum of oxidation states of all elements in it should be equal to 0.
Therefore, 2+2(2(1)+x+2(−2))=0
or, x=+1
Hence, the oxidation number of P in Ba(H2P––O2)2 is +1.