How to remove the hook correctly?
-
I need to remove this hook:
add_action( 'comment_form_before', [ $this, 'comments_link' ] );
From here (class-wcml-comments.php), Code snippet:
public function __construct( woocommerce_wpml $woocommerce_wpml, SitePress $sitepress, WPML_Post_Translation $post_translations, wpdb $wpdb ) { $this->woocommerce_wpml = $woocommerce_wpml; $this->sitepress = $sitepress; $this->post_translations = $post_translations; $this->wpdb = $wpdb; } public function add_hooks() { add_action( 'comment_post', [ $this, 'add_comment_rating' ] ); add_action( 'woocommerce_review_before_comment_meta', [ $this, 'add_comment_flag' ], 9 ); add_filter( 'get_post_metadata', [ $this, 'filter_average_rating' ], 10, 4 ); add_filter( 'comments_clauses', [ $this, 'comments_clauses' ], 10, 2 ); add_action( 'comment_form_before', [ $this, 'comments_link' ] ); add_filter( 'wpml_is_comment_query_filtered', [ $this, 'is_comment_query_filtered' ], 10, 2 ); add_action( 'trashed_comment', [ $this, 'recalculate_average_rating_on_comment_hook' ], 10, 2 ); add_action( 'deleted_comment', [ $this, 'recalculate_average_rating_on_comment_hook' ], 10, 2 ); add_action( 'untrashed_comment', [ $this, 'recalculate_average_rating_on_comment_hook' ], 10, 2 ); //before WCML_Synchronize_Product_Data::sync_product_translations_visibility hook add_action( 'woocommerce_product_set_visibility', [ $this, 'recalculate_comment_rating' ], 9 ); add_filter( 'woocommerce_top_rated_products_widget_args', [ $this, 'top_rated_products_widget_args' ] ); add_filter( 'woocommerce_rating_filter_count', [ $this, 'woocommerce_rating_filter_count' ], 10, 3 ); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to remove the hook correctly?’ is closed to new replies.