FluentCRM with YITH points tab plus actions

/** * Production Snippet: FluentCRM + YITH Points * – No debug logs * – No capability checks * – Dynamically builds the FluentCRM hash URL */ /** * 1) Add the “Points and Rewards” tab in FluentCRM */ add_action(‘init’,…Continue reading

Admin order – Discount per product

/** * Title: Add Percentage Discount to Order Line Items * Description: Adds percentage discount field to WooCommerce order line items in admin * Author: Claude AI * Version: 1.0 * * @package WPCode Snippets * @category Orders */ //…Continue reading

custom-allow_unfiltered_uploads_for_admins

// Allow specific file types for administrators only. function allow_unfiltered_uploads_for_admins( $mimes ) { if ( current_user_can( ‘administrator’ ) ) { $mimes[‘svg’] = ‘image/svg+xml’; $mimes[‘json’] = ‘application/json’; $mimes[‘xml’] = ‘application/xml’; $mimes[‘html’] = ‘text/html’; $mimes[‘htm’] = ‘text/html’; $mimes[‘js’] = ‘application/javascript’; $mimes[‘css’] =…Continue reading

Enable HTTP Strict Transport Security (HSTS) in WordPress (copy)

/** * Enables the HTTP Strict Transport Security (HSTS) header in WordPress. * Includes preloading with subdomain support. */ function tg_enable_strict_transport_security_hsts_header_wordpress() { header( ‘Strict-Transport-Security: max-age=31536000; includeSubDomains; preload’ ); } add_action( ‘send_headers’, ‘tg_enable_strict_transport_security_hsts_header_wordpress’ );Continue reading

MemberPress: Custom Course Overview Shortcode for Better Preview

use memberpress\courses\models as models; // Register classroom Styles function wpdocs_register_plugin_styles() { wp_enqueue_style( ‘mpcs-fontello-styles’, plugins_url( ‘memberpress-courses/public/fonts/fontello/css/mp-courses.css’ ) ); wp_enqueue_style( ‘mpcs-progress’, plugins_url( ‘memberpress-courses/public/css/progress.css’ ) ); } add_action( ‘wp_enqueue_scripts’, ‘wpdocs_register_plugin_styles’ ); // The “[mepr-mpcs-course-overview]” shortcode add_shortcode( ‘mepr-mpcs-course-overview’, function( $attributes ) { $content =…Continue reading