When any notice or advertisement relating to any cause, matter or thing in any court of record shall be required by law or the order of any court to be published, the same, when duly published, shall be paid for by the party at whose instance it was published, which payment, or so much thereof as shall be deemed reasonable, may be taxed as other costs, or otherwise allowed by the proper courts, in the course of the proceedings to which such advertisement relates.