Wppool
  • Home
  • Products
    • Privacy Policy
  • DreamLab
  • Bundle
  • Offer
  • Help Centre
    • Support
+ Join Our Community Log In
Site Logo
  • Home
  • Products
    • Privacy Policy
  • DreamLab
  • Bundle
  • Offer
  • Help Centre
    • Support
My Account
  • WP Dark Mode
    WP Dark Mode

    A stunning WordPress Dark Mode experience

  • FlexTable
    FlexTablehot Wppool

    Automatically sync Google Spreadsheets with WP tables

  • FormyChat
    FormyChat

    Send contact form leads to WhatsApp

  • Stock Sync
    FlexStock hot Wppool

    Sync WooCommerce stock with Google Sheet and manage easily

  • Order Sync
    FlexOrder new ⚡

    Manage WooCommerce orders from Google Sheets

  • Easy Video Reviews
    Easy Video Reviews

    Get powerful video testimonials with ease and boost sales

  • EchoRewards
    EchoRewards new ⚡

    Referral Plugin for WooCommerce

  • Jisi Meet
    Jitsi Meet

    Webinar & video conferences within WordPress

  • FlexSync for Shopify
    FlexSync for Shopify new ⚡

    Manage Shopify inventory from Google Sheets

  • ArchiveMaster
    ArchiveMaster new ⚡

    Speed up your WooCommerce store by archiving old orders.

  • Chat Widgets
    OMG Chat Widget

    Let customers contact via any social channel

  • Stock Notifier
    Stock Notifier for WooCommerce

    Send alerts to customer when product is back in stock

  • Docs
  • Blogs
  • Video Tutorials
  • Join Community
  • Support & Contact

.

WP Dark Mode Documentation

29
  • WP Dark Mode – Common Issues & Troubleshooting
  • WP Dark Mode: PHP Hooks
  • How to Boost WP Dark Mode Performance
  • How to use Dark Mode in Classic Editor
  • How to enable Show Switch Delay and Auto-hide Switch on Idle
  • How to Get Started with WP Dark Mode (Free & Ultimate)
  • How to add a floating dark mode switch to your site
  • How to adjust your dark mode color scheme
  • How to Use a Dark Mode Color Preset
  • How to Build Your Custom Color Preset in Dark Mode
  • How to Use a Custom Dark Mode Switch
  • How to Use a Custom Dark Mode Switch (Advanced)
  • How to a Use Dark Mode Switch in Your Website Menu
  • How to Enable Content Switches Using WP Dark Mode
  • How to Exclude/Include Specific Elements in Dark Mode
  • How to Exclude Dark Mode on Specific Pages
  • How to Use Custom CSS Support in Dark Mode
  • How to Use the Image Replacement Feature of WP Dark Mode
  • How to Use the Video Replacement Feature of WP Dark Mode
  • How to Display Dark Mode Switch Using Elementor Widget
  • How to Display Dark Mode Switch Using Gutenberg Block
  • How to Adjust the Font Size on Your Website
  • How to Display Dark Mode Switch Using Shortcode
  • How to Change Your Website Background in Dark Mode
  • How to Display Social Sharing Buttons in Dark Mode
  • WP Dark Mode for Developers (Methods and Hooks)
  • How to Rollback Your WordPress Plugin to An Older Version
  • Use of Cookies in WP Dark Mode and their Applications
  • WPDarkMode JavaScript API

FlexTable - Sheets to WP Table Live Sync

24
  • FlexTable Performance Optimization
  • How to Enable Smart Caching in FlexTable
  • How to add buttons in WordPress tables
  • What is FlexTable – Sheets to WP Table Live Sync?
  • How to install and use Google Sheets to WP Table Live Sync
  • How to create a new table with Google Sheets to WP Table Live Sync
  • How to use shortcode to create tables in WordPress with Sheets to WP Table Live Sync
  • How to use Google Sheets to WP Table Live Sync with Gutenberg block
  • How To Display Tables Directly From Elementor With Google Sheets To WP Table Live Sync
  • How to create a new table theme with Sheets to WP Table
  • How to Customize Table Theme with Sheets to WP Table Live Sync
  • How to hide table rows and columns of Google Sheets table
  • How to use custom CSS support in Google Sheets to WP Table Live Sync
  • How to use the multiple tab feature on Google Sheets to WP Table Live Sync
  • How to import background and font color on Google Sheets to WP Table Live Sync
  • How to import images from Google Sheets to WordPress table with Sheets to WP Table Live
  • How to sync Google Sheets links with WordPress tables
  • How to customize table pagination in WordPress
  • How to Sort and Merge Cells in WordPress Tables.
  • How to Enable Optimized Loading (Pro)
  • How to change table styles (theme customization)
  • FlexTable Advanced Use-Cases (Importing Codes, Sticky Header, Line Break and More)
  • What impact does FlexTable have on SEO and Performance?
  • Why Does the Page Need to be Refreshed to Display Updates on the Website?

Stock Sync for WooCommerce with Google Sheet

9
  • How To Install Stock Sync for WooCommerce with Google Sheets
  • How To Install & Setup Stock Sync for WooCommerce with Google Sheets Ultimate
  • How to sync WooCommerce stock with Google Sheets
  • How to manage WooCommerce product details from Google Sheets
  • How to Bulk Edit WooCommerce products from Google Sheets
  • How to Add WooCommerce products from Google Sheets
  • How to Sync WooCommerce Product Image with Google Sheets
  • How to Sync WooCommerce Custom Fields with Stock Sync with Google Sheet for WooCommerce
  • Possible Errors and Solutions

Order Sync with Google Sheets for WooCommerce - FlexOrder

11
  • How to Install FlexOrder – Free & Ultimate
  • How To Setup FlexOrder
  • How to Sync Custom Order Statuses with Google Sheets
  • How to Sync Order Notes from Google Sheets
  • How to Display Products in Separate Rows in FlexOrder
  • How to Bulk Edit WooCommerce Orders Using Google Sheets
  • How to export WooCommerce orders to Google Sheets
  • How to manage WooCommerce orders from Google Sheets
  • How To Update WooCommerce Orders from Google Sheets
  • How To Sync WooCommerce Custom Order Fields
  • Known Errors & Solutions

Webinar and Video Conference with Jitsi Meet

19
  • How to Enable Meeting from Frontend with Jitsi Meet
  • How to install and use Jitsi Meet
  • How to activate Jitsi Meet PRO
  • How to get the app ID, API key, and private key in Jitsi Meet
  • How to create a meeting on Jitsi Meet Pro
  • How meeting registration works in Jitsi Meet
  • How recurring meeting works in Jitsi Meet
  • How to use shortcode to display meeting with Jitsi Meet
  • How to display Meeting directly from Gutenberg block and Elementor with Jitsi Meet
  • How to Use Jitsi Meet Free, JaaS 8×8 & Self Hosted Server
  • How to record meeting on Jitsi Meet
  • How to Add Jitsi Meeting in Dokan Multivendor Plugin with Jitsi Meet Multivendor Addon
  • How to Add Jitsi Meeting in MultiVendorX with Jitsi Meet Multivendor Addon
  • How to Add Jitsi Meeting in WCFM Marketplace with Jitsi Meet Multivendor Addon
  • How to do live streaming in Jitsi Meet
  • How to Add a Jitsi Meeting in Tutor LMS
  • How To Add a Jitsi Meeting in LearnPress
  • How to add Meeting in LearnDash LMS with Jitsi Meet
  • How to use LearnDash and Tutor LMS in Jitsi Meet

FormyChat Documentation

11
  • How to add Ninja Form to WhatsApp with FormyChat
  • How to Modify FormyChat Form Fields with the “formychat_form_fields” Hook
  • How to Customize FormyChat Widget
  • How to create Multi-Agent Chat Support Widget
  • How to create multiple floating chat widgets
  • How to install and setup FormyChat Ultimate
  • How to send contact form data to WhatsApp
  • How to install and setup FormyChat
  • How to send Contact Form 7 data to WhatsApp
  • How to send contact form leads to email
  • How to setup and customize the welcome popup (greetings widget)

Easy Video Reviews Documentation

14
  • How to get started with Easy Video Reviews (Onboarding steps)
  • How to collect a testimonial from customers
  • How to add testimonials on your website
  • How to update your Easy Video Reviews settings
  • How to create a Wall of Love testimonial page using Review Gallery
  • How to use Gutenberg for collecting and displaying video testimonials
  • How to use Elementor for collecting and displaying video testimonials
  • How to collect testimonials with a floating review widget
  • How to download testimonials with Easy Video Reviews
  • How to translate testimonial fields in Easy Video Reviews
  • How to create and edit review form fields
  • How to collect customer testimonials on WooCommerce
  • How to collect video testimonials on Easy Digital Downloads (EDD)
  • Advanced customizations: Javascript triggers, dynamic tag for testimonial recorder, HTML attribute for recorder button

EchoRewards

1
  • EchoRewards Documentation

OMG Chat Widget

4
  • How to use OMG Chat Widget in any WordPress website
  • How to use OMG Chat Widget in WooCommerce Multivendor Marketplace (WCFM Marketplace)
  • How to use OMG Chat Widget in Dokan – Best WooCommerce Multivendor Marketplace Solution
  • How to use OMG Chat Widget in MultiVendorX (Formerly WC Vendor Marketplace)

ArchiveMaster Documentation

10
  • How to Enable the PDO SQLite Extension in Your Server’s PHP Configuration
  • What is ArchiveMaster
  • How to Install & Use ArchiveMaster
  • How to Create an Amazon RDS Database for ArchiveMaster
  • How to Connect Amazon RDS Remote Database with ArchiveMaster
  • How to Enable Automatic Archiving for Old Orders
  • How to Archive Old order with ArchiveMaster
  • Choosing the Right AWS RDS Plan
  • How to Reset and Recover Your RDS Database Password
  • How to Export Old Orders Using ArchiveMaster

Revio Documentation

1
  • How to get started with Revio (Onboarding steps)
  • Home
  • Documentation
  • WP Dark Mode Documentation
  • WP Dark Mode: PHP Hooks
View Categories

WP Dark Mode: PHP Hooks

This guide lists all available Action and Filter Hooks in the WP Dark Mode plugin, with examples and best practices for extending or customizing its functionality.


🔧 Action Hooks #

1. Core Plugin Actions #

/**

 * Fires when the dark mode plugin is fully loaded

 */

do_action( ‘wp_dark_mode_loaded’ );

// Example:

add_action( ‘wp_dark_mode_loaded’, ‘my_custom_dark_mode_init’ );

function my_custom_dark_mode_init() {

    add_custom_dark_mode_styles();

    register_custom_dark_mode_settings();

}

2. Social Share Actions #

/** Fires before the social share buttons are rendered */

do_action( ‘before_wpdm_social_share’ );

/** Fires after the social share buttons are rendered */

do_action( ‘after_wpdm_social_share’ );

// Example:

add_action( ‘before_wpdm_social_share’, ‘add_custom_social_share_header’ );

function add_custom_social_share_header() {

    echo ‘<div class=”custom-share-header”>Share this page:</div>’;

}

3. Theme Support Actions #

/**

 * Fires when a theme supports dark mode

 * @param string $theme_slug The current theme’s slug

 */

do_action( ‘wp_dark_mode_theme_supports’, $theme_slug );

// Example:

add_action( ‘wp_dark_mode_theme_supports’, ‘custom_theme_dark_mode_setup’ );

function custom_theme_dark_mode_setup( $theme_slug ) {

    if ( ‘my-custom-theme’ === $theme_slug ) {

        add_theme_specific_dark_mode_styles();

    }

}


🎛️ Filter Hooks #

1. Core Configuration Filters #

/** Filter the default dark mode options */

apply_filters( ‘wp_dark_mode_default_options’, $options );

// Example:

add_filter( ‘wp_dark_mode_default_options’, ‘custom_dark_mode_options’ );

function custom_dark_mode_options( $options ) {

    $options[‘custom_setting’] = ‘value’;

    return $options;

}

2. Style and Script Filters #

/** Filter the dark mode inline styles */

apply_filters( ‘wp_dark_mode_inline_styles’, $css );

/** Filter the dark mode inline scripts */

apply_filters( ‘wp_dark_mode_inline_scripts’, $js );

// Example:

add_filter( ‘wp_dark_mode_inline_styles’, ‘add_custom_dark_mode_styles’ );

function add_custom_dark_mode_styles( $css ) {

    $css .= ‘.custom-element { background-color: #1a1a1a; color: #ffffff; }’;

    return $css;

}

3. Element Exclusion Filters #

/** Filter whether an element should be excluded from dark mode */

apply_filters( ‘wp_dark_mode_is_excluded’, false );

/** Filter the list of excluded elements */

apply_filters( ‘wp_dark_mode_excluded_elements’, $excluded );

// Example:

add_filter( ‘wp_dark_mode_excluded_elements’, ‘custom_excluded_elements’ );

function custom_excluded_elements( $excluded ) {

    $excluded[] = ‘.my-custom-element’;

    $excluded[] = ‘#specific-id’;

    return $excluded;

}

4. Theme Support Filters #

/** Filter the list of supported themes */

apply_filters( ‘wp_dark_mode_supported_themes’, $themes );

// Example:

add_filter( ‘wp_dark_mode_supported_themes’, ‘add_custom_theme_support’ );

function add_custom_theme_support( $themes ) {

    $themes[] = ‘my-custom-theme’;

    return $themes;

}

5. Social Share Filters #

/** Filter the social share count */

apply_filters( ‘wpdm_social_share_count’, $count );

/** Filter the social share channels */

apply_filters( ‘wpdm_social_share_channels’, $channels );

// Example:

add_filter( ‘wpdm_social_share_channels’, ‘custom_social_channels’ );

function custom_social_channels( $channels ) {

    $channels[‘custom_platform’] = [

        ‘name’ => ‘Custom Platform’,

        ‘icon’ => ‘custom-icon’,

        ‘url’  => ‘https://custom-platform.com/share’

    ];

    return $channels;

}

6. Performance Filters #

/** Filter whether scripts should be loaded in footer */

apply_filters( ‘wp_dark_mode_loads_scripts_in_footer’, $load_in_footer );

// Example:

add_filter( ‘wp_dark_mode_loads_scripts_in_footer’, ‘__return_true’ );

7. Preset Styles Filters #

/** Filter the dark mode preset styles */

apply_filters( ‘wp_dark_mode_preset_styles’, $styles );

// Example:

add_filter( ‘wp_dark_mode_preset_styles’, ‘custom_preset_styles’ );

function custom_preset_styles( $styles ) {

    $styles[‘custom_preset’] = [

        ‘name’   => ‘Custom Preset’,

        ‘colors’ => [

            ‘bg’   => ‘#1a1a1a’,

            ‘text’ => ‘#ffffff’

        ]

    ];

    return $styles;

}


🧠 Best Practices #

✅ Hook Priority #

Ensure your filter runs at the right moment:

add_filter( ‘wp_dark_mode_excluded_elements’, ‘my_custom_elements’, 20 );

🚀 Performance #

Cache output-heavy filters:

add_filter( ‘wp_dark_mode_inline_styles’, ‘cached_custom_styles’ );

function cached_custom_styles( $css ) {

    static $cached_css = null;

    if ( null === $cached_css ) {

        $cached_css = generate_custom_styles();

    }

    return $css . $cached_css;

}

🔒 Security #

Escape all output:

add_filter( ‘wp_dark_mode_inline_styles’, ‘secure_custom_styles’ );

function secure_custom_styles( $css ) {

    $custom_color = esc_attr( get_theme_mod( ‘custom_dark_color’, ‘#000000’ ) );

    return $css . “.custom-element { background-color: {$custom_color}; }”;

}

🤝 Compatibility #

Check for function availability:

add_filter( ‘wp_dark_mode_default_options’, ‘conditional_custom_options’ );

function conditional_custom_options( $options ) {

    if ( function_exists( ‘wp_dark_mode_is_ultimate’ ) && wp_dark_mode_is_ultimate() ) {

        $options[‘premium_feature’] = ‘value’;

    }

    return $options;

}


💡 Summary #

These hooks give you deep customization power over:

  • Dark mode appearance & behavior
  • Social share controls
  • Theme & plugin integrations
  • Custom CSS/JS enhancements
  • Performance optimization

Make sure to follow WordPress standards and test thoroughly when adding your customizations!

What are your Feelings
Share This Article :
  • Facebook
  • X
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on May 28, 2025
WP Dark Mode – Common Issues & TroubleshootingHow to Boost WP Dark Mode Performance

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


Table of Contents
  • 🔧 Action Hooks
    • 1. Core Plugin Actions
    • 2. Social Share Actions
    • 3. Theme Support Actions
  • 🎛️ Filter Hooks
    • 1. Core Configuration Filters
    • 2. Style and Script Filters
    • 3. Element Exclusion Filters
    • 4. Theme Support Filters
    • 5. Social Share Filters
    • 6. Performance Filters
    • 7. Preset Styles Filters
  • 🧠 Best Practices
    • ✅ Hook Priority
    • 🚀 Performance
    • 🔒 Security
    • 🤝 Compatibility
  • 💡 Summary

Products

  • WP Dark Mode
    WP Dark Mode
  • FlexTable
    FlexTable
  • FormyChat
    FormyChat
  • Stock Sync
    FlexStock
  • FlexOrder
    FlexOrder
  • Easy Video Reviews
    Easy Video Reviews
  • EchoRewards
    EchoRewards
  • Jisi Meet
    Jitsi Meet Video Meeting
  • FlexSync for Shopify
    FlexSync for Shopify
  • ArchiveMaster
    ArchiveMaster
  • Chat Widgets
    OMG Chat Widget
  • Stock Notifier
    Stock Notifier for WooCommerce

Links

  • Home
  • Blog
  • About Us
  • Support
  • Affiliates
  • Influencer Program
  • Careers
  • Privacy Policy
  • Terms of Service

Our Blog

customer referral program
May 28, 2025
7 Best Customer Referral Program Ideas with EchoRewards
Ninja Chat integrations with FormyChat
May 22, 2025
How to Connect Ninja Forms to WhatsApp: A Simple Guide to Instant Lead Notificat
How to Export WooCommerce Products with FlexStock
May 22, 2025
How to Export WooCommerce Products with FlexStock

Logo

Experience remarkable WordPress products with a new level of power, beauty, and human-centered designs.

© 2025 WPPOOL . All Right Reserved.

Our site uses cookies to give you a personalized experience through curated contents, and suggestions. More information