In order to be as flexible as possible with your templates, you can use Hook to define your own placeholders. You can also access and manipulate all the placeholders created by the plug-in.
Function for the product template
This hook is only used for the templates with the product type.
1 2 3 4 5 6 |
function atkp_modify_placeholders_callback( $placeholders ) { //Hier können sämtliche Änderungen am „$placeholders“-Array vorgenommen werden. $placeholders['test_titel'] =$placeholders['title']; return $placeholders; } add_filter( 'atkp_modify_placeholders', 'atkp_modify_placeholders_callback'); |
Parameter | Description |
placeholders | The Array with the values. The array corresponds to a data record. |
Return value | The overridden values. |
Function for the picture gallery template
This hook is only used for the templates with the picture gallery type.
1 2 3 4 5 6 |
function atkp_modify_image_placeholders_callback( $placeholders ) { //Hier können sämtliche Änderungen am „$placeholders“-Array vorgenommen werden. $placeholders['test_titel'] =$placeholders['title']; return $placeholders; } add_filter( 'atkp_modify_image_placeholders', 'atkp_modify_image_placeholders_callback'); |
Parameter | Description |
placeholders | An Array consisting of placeholder and value. |
Return values | The overridden placeholders. |
Function for the offer template
This hook is only used with templates with the type Offers.
1 2 3 4 5 6 |
function atkp_modify_offer_placeholders_callback( $placeholders ) { //Hier können sämtliche Änderungen am „$placeholders“-Array vorgenommen werden. $placeholders['test_titel'] =$placeholders['title']; return $placeholders; } add_filter( 'atkp_modify_offer_placeholders', 'atkp_modify_offer_placeholders_callback'); |
Parameter | Description |
placeholders | An Array consisting of placeholder and value. |
Return values | The overridden placeholders. |
You can find more information about the various types of models here.
Tip: Use a plugin like My Custom Functions or a child theme to build your hooks!