woocommerce-multilingual
/
addons
/
wpml-dependencies
/
lib
/
classes
/
privacy
/
class-wpml-privacy-content.php
class-wpml-core-privacy-content.php
4 weeks ago
class-wpml-privacy-content-factory.php
4 weeks ago
class-wpml-privacy-content.php
4 weeks ago
class-wpml-privacy-content.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | abstract class WPML_Privacy_Content implements IWPML_Action { |
| 4 | |
| 5 | public function add_hooks() { |
| 6 | add_action( 'admin_init', array( $this, 'privacy_policy' ) ); |
| 7 | } |
| 8 | |
| 9 | public function privacy_policy() { |
| 10 | if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | $policy_text_content = $this->get_privacy_policy(); |
| 15 | if ( $policy_text_content ) { |
| 16 | if ( is_array( $policy_text_content ) ) { |
| 17 | $policy_text_content = '<p>' . implode( '</p><p>', $policy_text_content ) . '</p>'; |
| 18 | } |
| 19 | wp_add_privacy_policy_content( $this->get_plugin_name(), $policy_text_content ); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | abstract protected function get_plugin_name(); |
| 24 | |
| 25 | abstract protected function get_privacy_policy(); |
| 26 | } |
| 27 |