/** * Plugin Name: Metabolic Syndrome Assessment * Description: Shortcode [metabolic_syndrome] that displays Metabolic Syndrome factors and a Refresh button. * Version: 1.0 */ // 1) AJAX Handler (only for logged-in users) add_action(‘wp_ajax_get_mets_data’, ‘handle_get_mets_data’); function handle_get_mets_data() { if (!is_user_logged_in()) {…Continue reading
add_filter(‘wwlc_allowed_user_roles’, function($allowed_roles) { $allowed_roles[] = ‘editor’; // Add your custom role here return $allowed_roles; });Continue reading
/** * Plugin Name: CVD Risk Assessment * Description: Shortcode [cvd_risk_assessment] with a gauge, “Calculating” status, integer display for HDL/TC/eGFR, and delegated Refresh. * Version: 1.0 */ // 1) AJAX Handler (requires login) add_action(‘wp_ajax_get_cvd_data’,’handle_get_cvd_data’); function handle_get_cvd_data(){ if(!is_user_logged_in()){ wp_send_json_error([‘message’=>’Not logged in’]);…Continue reading
add_action(‘admin_init’, ‘restrict_product_creation’); function restrict_product_creation() { $product_count = wp_count_posts(‘product’)->publish; if ($product_count >= 10) { add_action(‘admin_footer’, function() { echo ‘ ‘; }); add_filter(‘wp_insert_post_data’, function($data, $postarr) { if ($data[‘post_type’] === ‘product’ && $data[‘post_status’] !== ‘trash’) { wp_die(‘You have reached the maximum limit of…Continue reading
/** * Plugin Name: Hemodynamic Vitals Plugin * Description: Provides [hemo_form] and [hemo_table] shortcodes to collect and display blood pressure & heart rate, with Bootstrap alerts and Syncfusion table. * Version: 1.0 */ if(!defined(‘ABSPATH’)){ exit; } /********************************************************* * BLOCK 1…Continue reading
/********************************************************* * BLOCK 2 * Additional shortcodes: [bp_stage_syncfusion], [bp_chart], [bp_interpretation] * plus a helper function => bp_get_latest_reading() *********************************************************/ /** * HELPER => bp_get_latest_reading() * Returns { systolic, diastolic } or null if none found */ if(!function_exists(‘bp_get_latest_reading’)){ function bp_get_latest_reading(){ if(!is_user_logged_in()) return…Continue reading
use PODeviceDetector\API\Device; $test = true; $remove = true;Continue reading
function restrict_bp_members_directory() { if (function_exists(‘bp_is_members_directory’) && bp_is_members_directory() && !current_user_can(‘administrator’)) { wp_redirect(home_url()); // Redirige vers la page d’accueil exit; } } add_action(‘bp_template_redirect’, ‘restrict_bp_members_directory’);Continue reading
function bulk_update_shipping_zones_vayots_dzor() { global $wpdb; // Define the shipping zones and their corresponding state codes $zones = array( ‘Ագարակաձոր’ => [‘code’ => ‘AG1’, ‘price’ => 9600], ‘Ազատեկ’ => [‘code’ => ‘AR2’, ‘price’ => 11600], ‘Ախտա’ => [‘code’ => ‘AI3’, ‘price’…Continue reading