Type: php
Google Adsense
Test Header
MemberPress: Set the order of payment methods
function mepr_rearrange_payment_methods( $payment_methods, $key ) { //Modify the order of the payment methods below according to your needs. You can also remove non needed payment methods $order = array( “PayPal Standard”, “Stripe”, “Authorize.net Profile”, “Offline Payment”, ); $pm_map = array();…Continue reading
MemberPress: Disable Math Captcha on login page
function kill_math_on_login() { remove_all_actions( ‘mepr-forgot-password-form’ ); remove_all_actions( ‘mepr-login-form-before-submit’ ); remove_all_filters( ‘mepr-validate-forgot-password’ ); remove_all_filters( ‘mepr-validate-login’ ); } add_action( ‘plugins_loaded’, ‘kill_math_on_login’ );Continue reading
MemberPress: Change the “Username or E-mail” label on login form
function mepr_change_uname_or_email_text() { return ‘Custom text’; } add_filter(‘mepr-login-uname-or-email-str’, ‘mepr_change_uname_or_email_text’ );Continue reading
Variable Pricing Dropdown
function edd_library_variable_price_dropdown() { function shoestrap_edd_purchase_variable_pricing( $download_id ) { $variable_pricing = edd_has_variable_prices( $download_id ); if ( ! $variable_pricing ) return; $prices = apply_filters( ‘edd_purchase_variable_prices’, edd_get_variable_prices( $download_id ), $download_id ); $type = edd_single_price_option_mode( $download_id ) ? ‘checkbox’ : ‘radio’; do_action( ‘edd_before_price_options’, $download_id…Continue reading
Variable Pricing Dropdown
function edd_library_variable_price_dropdown() { function shoestrap_edd_purchase_variable_pricing( $download_id ) { $variable_pricing = edd_has_variable_prices( $download_id ); if ( ! $variable_pricing ) return; $prices = apply_filters( ‘edd_purchase_variable_prices’, edd_get_variable_prices( $download_id ), $download_id ); $type = edd_single_price_option_mode( $download_id ) ? ‘checkbox’ : ‘radio’; do_action( ‘edd_before_price_options’, $download_id…Continue reading
CSS Asesores via PHP
// Agregar el filtro para editar usuarios function limit_edit_users_for_asesor($allcaps, $cap, $args, $user) { // Solo modificar si el usuario tiene el rol ‘asesor’ if (isset($user->roles) && in_array(‘asesor’, $user->roles)) { // Obtener el ID del usuario a editar $user_id_to_edit = isset($args[2])…Continue reading
Ocultar elementos inservibles
// Ocultar elementos en el admin para asesores function custom_admin_css_for_asesor() { // Obtén el usuario actual $user = wp_get_current_user(); // Verifica si el usuario tiene el rol ‘asesor’ if (in_array(‘asesor’, (array) $user->roles)) { echo ‘ ‘; } } add_action(‘admin_head’, ‘custom_admin_css_for_asesor’);…Continue reading