Is there a way to pass an argument to a view without using the url? UPDATE: Shawn's answer is correct but I'd like to mention for anyone else looking to implement it. The arguments must match the contextual filters you've added, in the same order.



Right now I'm embedding views using    

print views_embed_view('customview', 'customblock');


in a block. Is there a way that I can still embed a view in a block and pass in a parameter to it. I'd like to create a filter like this

print views_embed_view('customview', 'customblock', 'customcategory');


Is this possible?
Yes, your example does exactly what you're wanting. Read the docs on views_embed_view...


  "...: Any additional parameters will be passed as arguments."