This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hook: the_title. | |
| * Modify the product name. | |
| */ | |
| function plugin_republic_the_title( $product_name, $product_id ) { | |
| // Modify the $product_name here | |
| return $product_name; | |
| } | |
| add_filter( 'the_title', 'plugin_republic_the_title', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hook: woocommerce_sale_flash. | |
| * Update the HTML for the Sale! flash. | |
| */ | |
| function plugin_republic_sale_flash( $html, $post, $product ) { | |
| // Modify the $html here | |
| return $html; | |
| } | |
| add_filter( 'woocommerce_sale_flash', 'plugin_republic_sale_flash', 10, 3 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hook: plugin_republic_product_thumbnails_columns. | |
| * Filter the number of columns in the thumbnail gallery. | |
| */ | |
| function plugin_republic_product_thumbnails_columns( $cols ) { | |
| $cols = 3; | |
| return $cols; | |
| } | |
| add_filter( 'woocommerce_product_thumbnails_columns', 'plugin_republic_product_thumbnails_columns' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hook: woocommerce_single_product_image_thumbnail_html. | |
| */ | |
| function plugin_republic_single_product_image_thumbnail_html( $html, $attachment_id ) { | |
| // Modify $html here | |
| return $html; | |
| } | |
| add_filter( 'woocommerce_single_product_image_thumbnail_html', 'plugin_republic_single_product_image_thumbnail_html', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hook: woocommerce_single_product_image_gallery_classes. | |
| * Example usage: filter classes for image gallery | |
| */ | |
| function plugin_republic_single_product_image_gallery_classes( $classes ) { | |
| $classes[] = 'extra-class'; | |
| return $classes; | |
| } | |
| add_filter( 'woocommerce_single_product_image_gallery_classes', 'plugin_republic_single_product_image_gallery_classes' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hook: woocommerce_before_single_product. | |
| * | |
| * @hooked woocommerce_output_all_notices - 10 | |
| * add_action( 'woocommerce_before_single_product', 'woocommerce_output_all_notices', 10 ); | |
| */ | |
| do_action( 'woocommerce_before_single_product' ); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| remove_filter( 'woocommerce_short_description', 'custom_callback', 10 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( $hook_name, $callback_function, $priority, $args ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_short_description', 'plugin_republic_short_description', 5 ); | |
| function plugin_republic_short_description( $short_description ) { | |
| $short_description = sprintf( | |
| '%s<p>Special offer!</p>', | |
| $short_description | |
| ); | |
| return $short_description; | |
| } |