Custom post type capabilities

$custom_posts_caps = array('edit_custom_post', 'read_custom_post', 'delete_custom_post', 'edit_custom_posts', 'edit_others_custom_posts', 'publish_custom_posts', 'read_private_custom_posts'); _smg_add_cap('administrator', $custom_posts_caps); _smg_add_cap('editor', $custom_posts_caps); 'capabilities' => array( 'edit_post' => 'edit_custom_post', 'read_post' => 'read_custom_post', 'delete_post' => 'delete_custom_post', 'edit_posts' => 'edit_custom_posts', 'edit_others_posts' => 'edit_others_custom_posts', 'publish_posts' => 'publish_custom_posts', 'read_private_posts' => 'read_private_custom_posts' ),

Create and verify a nonce

All of this is created in a class // place this in __construct of the class $this->nonce_name = 'name_' . $my_post_type_slug; $this->nonce_action = 'saving_posttype_' . $my_post_type_slug; add_action('save_post', 'save_my_custom_posttype', 10); // place this in a meta box echo ' '; // your custom save w/ nonce function save_my_custom_posttype($post_id) { if (isset($_POST[…

Adding or Removing Profile Fields

function my_contactmethods( $contactmethods ) { // add $contactmethods[‘twitter’] = ‘Twitter’; $contactmethods[‘facebook’] = ‘Facebook’; $contactmethods[‘blog’] = ‘Blog’; // remove unset($contactmethods[‘aim’]); unset($contactmethods[‘jabber’]); unset($contactmethods[‘yim’]); return $contactmethods; } add_filter(‘user_contactmethods’,’my_contactmethods’,10,1);

Adding a meta_box to all Post Types

$post_types = get_post_types( array( ‘_builtin’ => false ), ‘objects’ ); // Gets all custom types array_push( $post_types, get_post_type_object( ‘post’ ), get_post_type_object( ‘page’) ); // Adds back the ‘post’ and ‘page’ types while ommitting attachments, revisions, menus, etc. foreach ( $post_types as $type ) { add_meta_box( . . . ); }

WP-o-Matic breaks WordPress Related Links

function adminInit() { auth_redirect(); // force display of a certain section $this->section = ($this->setup) ? ((isset($_REQUEST[‘s’]) && $_REQUEST[‘s’]) ? $_REQUEST[‘s’] : $this->sections[0]) : ‘setup’; // if (isset($_SERVER[‘HTTP_USER_AGENT’]) && (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘MSIE’) !== false)) // die(‘Please switch to Firefox / Safari’); wp_enqueue_script(‘prototype’); wp_enqueue_script(‘wpoadmin’, $this->tplpath . ‘/admin.js’, array(‘prototype’), $this->version); if ($this->section == ‘list’)…