get the content type 'machine name' by the 'human readable name ' I have a content type whose human readable name is Post your blog. How can I get the content type machine name by the human readable name?

Is there a function in Drupal 7, or do I have to query the node_type table to get what I want?
You can easily build a query to achieve this. However, as Molot mentioned, you have to handle human readable names that aren't unique.


  $machine_name = db_select('node_type', 'n')
  ->fields('n', array('type'))
      ->condition('name', 'Basic page')
      ->execute()->fetchField();