| 1 |
<?php |
| 2 |
/** |
| 3 |
* This class will provide all kind of helper methods. |
| 4 |
*/ |
| 5 |
class NotificationX_ToggleFields { |
| 6 |
|
| 7 |
public static function common_fields(){ |
| 8 |
$common_fields = apply_filters( 'nx_meta_common_fields', array( |
| 9 |
'conversion_position', |
| 10 |
'delay_before', |
| 11 |
'display_last', |
| 12 |
'display_from', |
| 13 |
'display_for', |
| 14 |
'delay_between', |
| 15 |
'loop', |
| 16 |
'notification_preview', |
| 17 |
'conversion_size' |
| 18 |
) ); |
| 19 |
return $common_fields; |
| 20 |
} |
| 21 |
|
| 22 |
public static function common_sections(){ |
| 23 |
$common_sections = apply_filters( 'nx_meta_common_sections', array( |
| 24 |
'image', |
| 25 |
) ); |
| 26 |
return $common_sections; |
| 27 |
} |
| 28 |
|
| 29 |
public static function woocommerce(){ |
| 30 |
|
| 31 |
$fields = self::common_fields(); |
| 32 |
$fields[] = 'conversion_from'; |
| 33 |
$sections = self::common_sections(); |
| 34 |
$sections[] = 'themes'; |
| 35 |
$sections[] = 'conversion_link_options'; |
| 36 |
|
| 37 |
return apply_filters( 'nx_woocommerce_toggle_fields', array( |
| 38 |
'fields' => $fields, |
| 39 |
'sections' => $sections, |
| 40 |
)); |
| 41 |
} |
| 42 |
|
| 43 |
public static function woocommerce_hide(){ |
| 44 |
return apply_filters( 'nx_woocommerce_toggle_fields', array( |
| 45 |
'fields' => [ 'comments_template' ], |
| 46 |
'sections' => [], |
| 47 |
)); |
| 48 |
} |
| 49 |
|
| 50 |
public static function edd(){ |
| 51 |
$fields = self::common_fields(); |
| 52 |
$fields[] = 'conversion_from'; |
| 53 |
|
| 54 |
$sections = self::common_sections(); |
| 55 |
$sections[] = 'themes'; |
| 56 |
$sections[] = 'conversion_link_options'; |
| 57 |
|
| 58 |
return apply_filters( 'nx_edd_toggle_fields', array( |
| 59 |
'fields' => $fields, |
| 60 |
'sections' => $sections, |
| 61 |
)); |
| 62 |
} |
| 63 |
|
| 64 |
public static function edd_hide(){ |
| 65 |
return apply_filters( 'nx_edd_toggle_fields', array( |
| 66 |
'fields' => [ 'comments_template' ], |
| 67 |
'sections' => [], |
| 68 |
)); |
| 69 |
} |
| 70 |
|
| 71 |
public static function reviews(){ |
| 72 |
$fields = self::common_fields(); |
| 73 |
|
| 74 |
return apply_filters( 'nx_reviews_toggle_fields', array( |
| 75 |
'fields' => array_merge( $fields, array( 'reviews_source' ) ), |
| 76 |
'sections' => array( 'image' ) |
| 77 |
)); |
| 78 |
} |
| 79 |
|
| 80 |
public static function stats(){ |
| 81 |
$fields = self::common_fields(); |
| 82 |
|
| 83 |
return apply_filters( 'nx_stats_toggle_fields', array( |
| 84 |
'fields' => array_merge( $fields, array( 'stats_source' ) ), |
| 85 |
'sections' => array( 'image' ) |
| 86 |
)); |
| 87 |
} |
| 88 |
|
| 89 |
} |
| 90 |
|