Replace  function with core WordPress