This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" /> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: [ CoursePress 2 ] - Email Notifications on Completion | |
* Plugin URI: https://premium.wpmudev.org/ | |
* Description: Sends an email notification to the Student upon Course Completion | |
* Author: Alessandro Kaounas @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org/ | |
* License: GPLv2 or later | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 1. Go to Settings > Permalinks and select any page as home page | |
* Then use the following code | |
* | |
* You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. | |
* Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. | |
* If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, | |
* give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, | |
* so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'ms_model_relationship_create_ms_relationship_before', 'ms_controller_member_assign_memberships_done_cb', 99, 4 ); | |
function ms_controller_member_assign_memberships_done_cb( $membership_id, $user_id, $gateway_id, $move_from_id ) { | |
$course = array( | |
// 'membership_id' => 'course_id' | |
'1324' => 6656, | |
'9087' => 22345 | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### We are adding telephone number as custom field | |
1. Go to /wp-content/plugins/membership/app/view/templates/ and copy all 4 files. | |
2. Go to /wp-content/themes/YOUR_CURRENT_THEME/ and create a new folder called membership2, then paste all 4 files inside the new created membership2 folder | |
3. Open membership_registration_form.php and put the following: membership_registration_form.php | |
4. Now open the membership_account.php file and put the following: membership_account.php | |
5. Finally need to add some code: mu-plugin.php | |
## You can add those codes in your functions.php in the theme, | |
## if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- functions.php --> | |
<?php | |
add_action( 'wp_enqueue_scripts', 'theme_custom_style_script', 11 ); | |
function theme_custom_style_script() { | |
wp_enqueue_style( 'dynamic-css', admin_url('admin-ajax.php').'?action=dynamic_css', '', VERSION); | |
} | |
add_action('wp_ajax_dynamic_css', 'dynamic_css'); | |
add_action('wp_ajax_nopriv_dynamic_css', 'dynamic_css'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Example: User ID | |
*/ | |
add_filter( 'ms_helper_listtable_member_get_columns', function( $columns ) { | |
$columns['user_id'] = 'User ID'; | |
return $columns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Example: Member first name and last name and sorting ASC and DESC | |
*/ | |
add_filter( 'ms_helper_listtable_billing_get_columns', function( $columns, $currency ) { | |
$columns['first_name'] = 'First Name'; | |
$columns['last_name'] = 'Last Name'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'user_register', 'assign_membership_on_register', 10, 1 ); | |
function assign_membership_on_register( $user_id ) { | |
$membership = array( | |
// 'role' => 'membership ID' | |
'abc' => 123, | |
'xyz' => 456 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'ms_model_membership_create_new_user_validation_errors', | |
'new_pw_validation_rule', | |
20, 2 | |
); | |
function new_pw_validation_rule( $validation_errors, $obj ) | |
{ |