plugin development – Should action callbacks start with a verb?

Question

class Singleton {
    public function __construct() {
        // Case #1
        add_action( 'woocommerce_before_shop_loop_item', [ $this, 'open_product_wrapper' ], 10 );
        add_action( 'woocommerce_shop_loop_item_title', [ $this, 'render_product_title' ], 10 );
        
        // Case #2
        add_action( 'woocommerce_before_shop_loop_item', [ $this, 'product_wrapper_open' ], 10 );
        add_action( 'woocommerce_shop_loop_item_title', [ $this, 'product_title' ], 10 );
    }
}

Are there any conventions or should I strive for consistency?

NOTE: In Laravel projects I always use verbs because each method is doing something.

0
user557108 5 months 2022-03-12T07:16:27-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse