Theory of elastic inhomogeneities in electromagnetic materials