Can one create multiple Custom Post Types with a for loop?
You have a problem with scopes in your code and you misuse actions, I guess. Let me explain… Let’s take a look at this part of code: for($i =1; $i <= $options_foo[‘num_post_types’]; $i++) { global $options_foo; $singular = $options_foo[‘post_type_names’][$i][‘singular’]; $plural = $options_foo[‘post_type_names’][$i][‘plural’]; add_action(‘init’, function(){ global $singular; What it does, is: You loop through all options … Read more