I am writing a plugin that creates custom post types, but i want users to be able to turn them on and off via a filter in the functions.php file.

The issue i'm having is that custom post types register_post_type has to be called during init and functions.php is read far after this.

How can I allow users to provide an array using a filter or action that will control which post types register_post_type gets called?

// currently the custom post type constructor has this
if(!post_type_exists($this-&gt;name)) {
  add_action("init", array($this, "register_post_type"));
  add_action("init", array($this, "configure_meta_boxes"));
  add_action("save_post", array($this, "save"));

  add_filter('myplugin_get_shortcodes', array($this, "configure_shortcodes"));
}


The filter works just fine so I know it's being called, but for whatever reason the actions aren't.


Question: core file size with ulimit
Answer: ulimit is a shell builtin, and thus only affects the current shell, and processes started by that shell:

$ type ulimit
ulimit is a shell builtin


From man ulimit:

The  ulimit  utility  shall  set  or report the file-size writing limit
imposed on files written by the shell and its child processes (files of
any  size  may be read). Only a process with appropriate privileges can
increase the limit.


So, yes, child processes are affected.

To set limits permanently or for all processes, edit /etc/security/limits.conf and reboot. The examples in the manpage are fairly good. You just need to add something like:

username - core unlimited