Location: everywhere
MemberPress: Hide the Cancel Link in the Account Page for a Period of Time
function mepr_remove_cancel_link( $link, $sub ) { $time = strtotime( $sub->created_at ); if( time() < strtotime( "+3 months", $time ) ) { return ''; } return $link; } add_filter( 'mepr_custom_cancel_link', 'mepr_remove_cancel_link', 10, 2 );Continue reading
MemberPress: Remove the Pause link for specific membership
function mepr_remove_pause_link( $output, $sub ) { if( ‘123’ == $sub->product_id ) { return; } return $output; } add_filter( ‘mepr_custom_pause_link’, ‘mepr_remove_pause_link’, 10, 2 );Continue reading
Disable WP Texturize
add_filter( ‘run_wptexturize’, ‘__return_false’ );Continue reading
home
Task Management System by Mayuri K. Toggle navigation > Attendance > More Projects > Database Logout > Attendance Logout Mayuri K. Profile LogoutContinue reading
Untitled Snippet
ChatBot Err (copy)
function generate_chat_response( $last_prompt, $conversation_history ) { // OpenAI API URL and key $api_url = ‘https://api.openai.com/v1/chat/completions’; $api_key = ‘sk-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 ‘; // Replace with your actual API key // Headers for the OpenAI API $headers = [ ‘Content-Type’ => ‘application/json’, ‘Authorization’ =>…Continue reading
Show Active Plugins First
add_filter(‘views_plugins’, function($views) { global $wp_list_table; if (!is_network_admin() && isset($wp_list_table->items)) { $all_plugins = $wp_list_table->items; $active_plugins = get_option(‘active_plugins’); $reordered_plugins = array(); // Add active plugins first foreach ($all_plugins as $plugin_file => $plugin_data) { if (in_array($plugin_file, $active_plugins)) { $reordered_plugins[$plugin_file] = $plugin_data; } }…Continue reading
Auto-Collapse Long Comments
add_filter( ‘comment_text’, function( $comment_content ) { $max_length = 100; // Set the maximum length of the comment to display without collapsing if ( strlen( $comment_content ) > $max_length ) { $short_content = substr( $comment_content, 0, $max_length ) . ‘…’; $full_content…Continue reading
Replace Post Title with ACF field
function sync_acf_post_title($post_id, $post, $update) { $acf_name = get_field(‘name’, $post_id); // Get the value of the “name” ACF field $acf_vorname = get_field(‘vorname’, $post_id); // Get the value of the “vorname” ACF field $post_type = get_post_type($post_id); if ($acf_name && $post_type === “kontakte”)…Continue reading