/** * 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
echo ‘hello’; //this page is new-record if ( ! post_password_required() ) { // Code to fetch and print CFs, such as: $key_1_value_1 = get_post_meta( $post->ID, ‘key_1’, true ); echo $key_1_value_1; } echo ‘ ‘; echo ‘ ‘; echo ‘ ‘;…Continue reading
add_filter( ‘the_content’, function ( $content ) { // Return early if it isn’t the home page or the blog page. if ( ! is_home() && ! is_front_page() ) { return $content; } return str_replace( ‘Continue reading