__( 'Product page', 'add-to-cart-text' ), self::Archive => __( 'Shop & archives', 'add-to-cart-text' ), }; } /** * Help text for the admin UI. * * @return string */ public function help(): string { return match ( $this ) { self::Single => __( 'Button text on the single product page.', 'add-to-cart-text' ), self::Archive => __( 'Button text in the shop, category pages and product blocks.', 'add-to-cart-text' ), }; } /** * Protected post meta key for per-product texts. * * @return string */ public function product_meta_key(): string { return '_adtct_' . $this->value . '_text'; } /** * Term meta key for per-category texts. * * @return string */ public function term_meta_key(): string { return 'adtct_' . $this->value . '_text'; } /** * Name of the form field in the product editor and on category screens. * * @return string */ public function field_name(): string { return 'adtct_' . $this->value . '_text'; } }