default-design
5 months ago
popup
5 months ago
slidein
3 years ago
sshare
5 months ago
class-hustle-meta-base-content.php
3 years ago
class-hustle-meta-base-design.php
3 years ago
class-hustle-meta-base-display.php
6 years ago
class-hustle-meta-base-emails.php
4 months ago
class-hustle-meta-base-integrations.php
3 years ago
class-hustle-meta-base-settings.php
3 years ago
class-hustle-meta-base-visibility.php
5 months ago
class-hustle-meta-base-content.php
63 lines
| 1 | <?php |
| 2 | /** |
| 3 | * File for Hustle_Meta_Base_Content class. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.2.0 |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * Hustle_Meta_Base_Content is the base class for the "content" meta of modules. |
| 11 | * This class should handle what's related to the "content" meta. |
| 12 | * |
| 13 | * @since 4.2.0 |
| 14 | */ |
| 15 | class Hustle_Meta_Base_Content extends Hustle_Meta { |
| 16 | |
| 17 | /** |
| 18 | * Get the defaults for this meta. |
| 19 | * |
| 20 | * @since 4.0.0 |
| 21 | * @return array |
| 22 | */ |
| 23 | public function get_defaults() { |
| 24 | $data = array( |
| 25 | 'module_name' => '', |
| 26 | 'title' => '', |
| 27 | 'sub_title' => '', |
| 28 | 'main_content' => '', |
| 29 | 'feature_image' => '', |
| 30 | 'background_image' => '', |
| 31 | 'show_never_see_link' => '0', |
| 32 | 'never_see_link_text' => __( 'Never see this message again.', 'hustle' ), |
| 33 | 'show_cta' => '0', |
| 34 | 'cta_label' => '', |
| 35 | 'cta_url' => '', |
| 36 | 'cta_target' => 'blank', |
| 37 | 'cta_two_label' => 'Close', |
| 38 | 'cta_two_url' => '', |
| 39 | 'cta_two_target' => 'close', |
| 40 | 'cta_helper_show' => '0', |
| 41 | 'cta_helper_text' => '', |
| 42 | ); |
| 43 | |
| 44 | if ( ! empty( $this->module->module_type ) && 'embedded' === $this->module->module_type ) { |
| 45 | $data['cta_two_label'] = ''; |
| 46 | $data['cta_two_target'] = 'blank'; |
| 47 | } |
| 48 | |
| 49 | return $data; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Returns whether the module has CTA active. |
| 54 | * |
| 55 | * @since 4.3.1 |
| 56 | * |
| 57 | * @return boolean |
| 58 | */ |
| 59 | public function has_cta() { |
| 60 | return '1' === $this->data['show_cta']; |
| 61 | } |
| 62 | } |
| 63 |