Whenever a city having a population of less than 2,500 inhabitants adopts an ordinance code containing all ordinances and amendments previously adopted and amendments and new ordinances to bring the codification up to the date of adoption, instead of publishing such code, amendments, and new ordinances pursuant to Section 36933, the city council may cause the code, amendments, and new ordinances to be adopted by reference as provided in Sections 50022.1 to 50022.8 inclusive of this code. Thereafter all ordinances amending the code shall be published pursuant to Section 36933.