I'm very new to WordPress & overall coding. I'm changing the current Similar Products on the single product pages to a selectable list and I've been trying to use a list of slugs from our products to post IDs, but I only found how to do it with an array of post IDs. How do I convert a list of slugs inputted on the editing page for each product to an array or post IDs? Below is the query I've been using.
$pc = new WP_Query( array( 'post_type' => 'any', 'post__in' => array( 6036, 6127 ), 'post_status' => 'publish', 'orderby'=>'title', 'order'=>'ASC' ) );