• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WooCommerce a2z

WooCommerce a2z

WooCommerce

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / ActionScheduler_WPCommentCleaner::init() – Initialize the class and attach callbacks.

You appear to be a bot. Output may be restricted

Description

Initialize the class and attach callbacks.

Usage

ActionScheduler_WPCommentCleaner::init();

Parameters

Returns

void

Source

File name: woocommerce/packages/action-scheduler/classes/ActionScheduler_WPCommentCleaner.php
Lines:

1 to 16 of 16
  public static function init() {
    if ( empty( self::$wp_comment_logger ) ) {
      self::$wp_comment_logger = new ActionScheduler_wpCommentLogger();
    }

    add_action( self::$cleanup_hook, array( __CLASS__, 'delete_all_action_comments' ) );

    // While there are orphaned logs left in the comments table, we need to attach the callbacks which filter comment counts.
    add_action( 'pre_get_comments', array( self::$wp_comment_logger, 'filter_comment_queries' ), 10, 1 );
    add_action( 'wp_count_comments', array( self::$wp_comment_logger, 'filter_comment_count' ), 20, 2 ); // run after WC_Comments::wp_count_comments() to make sure we exclude order notes and action logs
    add_action( 'comment_feed_where', array( self::$wp_comment_logger, 'filter_comment_feed' ), 10, 2 );

    // Action Scheduler may be displayed as a Tools screen or WooCommerce > Status administration screen
    add_action( 'load-tools_page_action-scheduler', array( __CLASS__, 'register_admin_notice' ) );
    add_action( 'load-woocommerce_page_wc-status', array( __CLASS__, 'register_admin_notice' ) );
  }
 

 View on GitHub View on Trac

Published: 6th April 2020 | Last updated: 6th April 2020

Primary Sidebar

Information

Function name: ActionScheduler_WPCommentCleaner::init
Class ref: ActionScheduler_WPCommentCleaner
Plugin ref: WooCommerce
Version: 5.2.2
Sourcefile: packages/action-scheduler/classes/ActionScheduler_WPCommentCleaner.php
File ref: packages/action-scheduler/classes/ActionScheduler_WPCommentCleaner.php
Deprecated?: No
API Letters: A,I,W

Footer

WooCommerce a2z
WooCommerce a2z
WooCommerce
WordPress 5.7.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites