function mp_custom_membership_info() { if (!is_user_logged_in()) { return ‘You need to be logged in to view this information.’; } global $wpdb; $user_id = get_current_user_id(); // Query to get all active MemberPress transactions for the current user $transactions = $wpdb->get_results($wpdb->prepare( “SELECT txn.*,…Continue reading
function mepr_account_nav_courses_link($link) { if (current_user_can(‘administrator’)) { // Set the user-role-based condition return ‘/admin-courses/’; // If the user matches the user-role-based condition, apply this URL } else { return ‘/user-courses/’; // If the user DOESN’T match the user-role-based condition, apply this…Continue reading
function mepr_account_nav_courses_link($link) { // Change the link URL from the default to the new courses URL return ‘/courses/’; } add_filter(‘mepr-account-nav-courses-link’, ‘mepr_account_nav_courses_link’);Continue reading
add_action(‘admin_head’, function() { echo ‘ ‘; });Continue reading
add_filter( ‘wp_calculate_image_srcset’, ‘__return_false’ );Continue reading
/** * Shortcode [targets_priority] * Displays an improved Bootstrap table with color-coded progress bars/badges. */ function crx_targets_priority_shortcode($atts) { if (!is_user_logged_in()) { return “ Please log in to see your priority ranking. “; } global $wpdb; $T = crx_get_targets(); $user_id =…Continue reading
/** * Zeigt den Cookie-Banner, wenn ein Element mit der Klasse ‘cmplz-show-banner’ geklickt wird. */ function cmplz_show_banner_on_click() { ?>Continue reading
add_action(“breakdance_register_template_types_and_conditions”, function () { if (function_exists(“trp_get_languages”)) { $lang_list_full = trp_get_languages(); $lang_list = array(); foreach($lang_list_full as $key => $value) { $lang_list[] = $key; } \Breakdance\ConditionsAPI\register([ “supports” => [“element_display”, “templating”], “slug” => “TranslatePress4bd-condition”, // MUST BE UNIQUE “label” => “Language”, “category” =>…Continue reading
// 1️⃣ Admin Menüpunkt für die globale Einstellungsseite hinzufügen function my_custom_global_settings() { add_menu_page( ‘Globale Einstellungen’, // Seitentitel ‘Globale Daten’, // Menüpunkt-Name ‘manage_options’, // Berechtigung ‘global-settings’, // Slug ‘my_global_settings_page’, // Callback-Funktion ‘dashicons-admin-generic’, // Icon 80 // Position im Menü ); }…Continue reading
function disable_editor_for_selected_post_types() { $disabled_post_types = array(‘post’, ‘page’); // Liste der zu deaktivierenden Post-Typen foreach ($disabled_post_types as $post_type) { remove_post_type_support($post_type, ‘editor’); } } add_action(‘init’, ‘disable_editor_for_selected_post_types’);Continue reading