add_action(‘mepr-event-subscription-stopped’, function($event) { $subscription = $event->get_data(); $user = $subscription->user(); $wp_user = get_user_by(‘id’, $user->ID); if(!$wp_user) { return; } // Remove role $wp_user->remove_role( ‘subscriber’ ); // Add role $wp_user->add_role( ‘editor’ ); });Continue reading
// allow Editors to access Memberpress function add_memberpress(){ $role = get_role(‘editor’); $role->add_cap(‘remove_users’); } add_action(‘admin_init’,’add_memberpress’);Continue reading
function mpimp_load_expanded_coupon_importer() { global $mpimp; $mpimp->importers[‘couponaffiliate’] = ‘MpimpExtendedCouponsImporter’; } add_action(‘admin_init’, ‘mpimp_load_expanded_coupon_importer’, 110); //has to be after the MP hook function runs class MpimpExtendedCouponsImporter extends MpimpCouponsImporter { public function form() { } public function import($row,$args) { $ea_active = is_plugin_active(‘easy-affiliate/easy-affiliate.php’) ? true…Continue reading
function mepr_newuser_approve_override($user_id) { // Define an array of membership IDs for which the verification step should be skipped. $auto_approve = array(123, 456, 789); if(!class_exists(‘MeprOptions’)) { return; } if(!isset($_POST[‘mepr_product_id’]) && !isset($_POST[‘manage_sub_accounts_form’])) { return $user_id; } $product_id = isset($_POST[‘mepr_product_id’])?$_POST[‘mepr_product_id’]:false; if(isset($_POST[‘manage_sub_accounts_form’]) || ($product_id…Continue reading
add_shortcode( ‘mpcs_user_courses_progress’, function() { $user_id = get_current_user_id(); $courses = get_posts(array( ‘posts_per_page’ => -1, ‘post_type’ => ‘mpcs-course’ )); ob_start(); echo ‘ ‘; foreach ( $courses as $course ) { $course = new memberpress\courses\models\Course($course->ID); $progress = $course->user_progress($user_id); if ( $progress < 100…Continue reading
add_filter( ‘jetpack_remove_login_form’, ‘__return_true’ );Continue reading
add_action(‘woocommerce_before_customer_login_form’, ‘custom_login_message’); function custom_login_message() { echo ‘ Welcome! Please log in to access your account. Note: A valid subscription is required to access your account. ‘; }Continue reading
/* WordPress Sitemap deaktivieren BEGIN */ add_filter( ‘wp_sitemaps_enabled’, ‘__return_false’ ); /* WordPress Sitemap deaktivieren END */ /* WordPress Autoupdates deaktivieren BEGIN */ if ( ! defined( ‘AUTOMATIC_UPDATER_DISABLED’ ) ) { define( ‘AUTOMATIC_UPDATER_DISABLED’, true ); } /* WordPress Autoupdates deaktivieren END…Continue reading
//* Deshabilita la etiqueta de generator add_filter(‘the_generator’, ‘__return_empty_string’); //* Evitar que se sobreescriban temas al actualizar define( ‘CORE_UPGRADE_SKIP_NEW_BUNDLED’, true ); //* Deshabilitar links update_option( ‘link_manager_enabled’, 0 );Continue reading
add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 5); add_filter(‘use_block_editor_for_post’, ‘__return_false’, 5);Continue reading