Skip to content

Instantly share code, notes, and snippets.

@maksbd19
maksbd19 / pmpro_default_role.php
Created February 16, 2015 11:24
Assign a default role with the PMPro membership plan
/*
subscriber will be assigned to default role when they sign up
*/
function my_pmpro_after_change_membership_level($level_id, $user_id)
{
if($level_id > 0){
$role = get_option('pmpro_role_for_id_'.$level_id);
@justintadlock
justintadlock / register-post-type.php
Last active July 17, 2024 10:14
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public