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 | |
// For User Profile Picture | |
add_filter( 'mpp_gutenberg_user_role', function( $role ) { | |
return 'subscribers'; | |
} ); | |
// For Gutenberg | |
add_filter( 'rest_user_query', function( $args, $r ) { | |
if( isset( $args['who'] ) && 'authors' == $args['who'] ) { | |
$args['who'] = 'subscribers'; |
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
add_filter( 'bp_core_fetch_avatar', 'mpp_bp_avatar', 10, 2 ); | |
function mpp_bp_avatar( $img, $params ) { | |
// Determine if user has an avatar override | |
$avatar_override = get_user_option( 'metronet_avatar_override', $params[ 'item_id' ] ); | |
if ( !$avatar_override || $avatar_override != 'on' ) return $img; | |
$profile_post_id = absint( get_user_option( 'metronet_post_id', $params[ 'item_id' ] ) ); | |
if ( 0 === $profile_post_id || 'mt_pp' !== get_post_type( $profile_post_id ) ) { |
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 | |
/** | |
* Conditionally load the default theme.json file. | |
* | |
* Assumes directory structure of /theme-name/skins/skin-name/theme.json (see switch statement below). | |
* | |
* @package coaching-pro | |
*/ | |
/** |
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( 'gform_form_tag', 'gform_form_tag_autocomplete', 11, 2 ); | |
function gform_form_tag_autocomplete( $form_tag, $form ) { | |
if ( is_admin() ) return $form_tag; | |
if ( GFFormsModel::is_html5_enabled() ) { | |
$form_tag = str_replace( '>', ' autocomplete="off">', $form_tag ); | |
} | |
return $form_tag; | |
} | |
add_filter( 'gform_field_content', 'gform_form_input_autocomplete', 11, 5 ); |
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 | |
/* | |
This shortcode will display the members list and additional content based on the defined attributes. | |
*/ | |
function pmpromd_shortcode($atts, $content=null, $code="") | |
{ | |
// $atts ::= array of attributes | |
// $content ::= text within enclosing form of shortcode element | |
// $code ::= the shortcode found, when == callback name | |
// examples: [pmpro_member_directory show_avatar="false" show_email="false" levels="1,2"] |
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
.soliloquy-item:before { | |
display: block; | |
content: ''; | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
right: 0; | |
top: 0; | |
z-index: 9; | |
background: #212121; |
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 | |
/** | |
* Sort the membership directory by lastname first, then first name. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_custom_directory_sql_parts( $parts ) { |
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 | |
/** | |
* Adds a notes tab in the admin area and in the order CSV export. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
/** |
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 | |
function my_pmprorh_init() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; | |
} | |
// Define the fields. | |
$fields = array(); | |
$fields[] = new PMProRH_Field( |
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 | |
/** | |
* Move custom company field to the top of the billing information section if it exists. | |
*/ | |
function pmpro_move_company_to_billing() { | |
if ( is_page( 'paiement-dadhesion' ) && wp_script_is( 'jquery', 'done' ) ) { | |
?> | |
<script> | |
jQuery( '#company_div' ).prependTo( '.pmpro_checkout-field-bfirstname' ); | |
</script> |