← All changes
|
includes/class-convertkit-settings-restrict-content.php
+33
-20
2.2.4
→
2.5.2
View file →
| @@ -64,8 +64,21 @@ | ||
| 64 | 64 | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | + * Returns whether crawlers are permitted to index Member Content in the Plugin settings. | |
| 69 | + * | |
| 70 | + * @since 2.4.1 | |
| 71 | + * | |
| 72 | + * @return bool | |
| 73 | + */ | |
| 74 | + public function permit_crawlers() { | |
| 75 | + | |
| 76 | + return ( $this->settings['permit_crawlers'] === 'on' ? true : false ); | |
| 77 | + | |
| 78 | + } | |
| 79 | + | |
| 80 | + /** | |
| 68 | 81 | * Returns Restrict Content settings value for the given key. |
| 69 | 82 | * |
| 70 | 83 | * @since 2.1.0 |
| 71 | 84 | * |
| @@ -89,21 +102,8 @@ | ||
| 89 | 102 | |
| 90 | 103 | } |
| 91 | 104 | |
| 92 | 105 | /** |
| 93 | - * Returns whether Restrict Content is enabled in the Plugin settings. | |
| 94 | - * | |
| 95 | - * @since 2.1.0 | |
| 96 | - * | |
| 97 | - * @return bool | |
| 98 | - */ | |
| 99 | - public function enabled() { | |
| 100 | - | |
| 101 | - return ( $this->settings['enabled'] === 'on' ? true : false ); | |
| 102 | - | |
| 103 | - } | |
| 104 | - | |
| 105 | - /** | |
| 106 | 106 | * The default settings, used when the ConvertKit Restrict Content Settings haven't been saved |
| 107 | 107 | * e.g. on a new installation. |
| 108 | 108 | * |
| 109 | 109 | * @since 2.1.0 |
| @@ -112,15 +112,28 @@ | ||
| 112 | 112 | */ |
| 113 | 113 | public function get_defaults() { |
| 114 | 114 | |
| 115 | 115 | $defaults = array( |
| 116 | - 'enabled' => '', | |
| 117 | - 'subscribe_text' => __( 'This content is only available to premium subscribers', 'convertkit' ), | |
| 116 | + // Permit Crawlers. | |
| 117 | + 'permit_crawlers' => '', | |
| 118 | + | |
| 119 | + // Restrict by Product. | |
| 120 | + 'subscribe_heading' => __( 'Read this post with a premium subscription', 'convertkit' ), | |
| 121 | + 'subscribe_text' => __( 'This post is only available to premium subscribers. Join today to get access to all posts.', 'convertkit' ), | |
| 122 | + | |
| 123 | + // Restrict by Tag. | |
| 124 | + 'subscribe_heading_tag' => __( 'Subscribe to keep reading', 'convertkit' ), | |
| 125 | + 'subscribe_text_tag' => __( 'This post is free to read but only available to subscribers. Join today to get access to all posts.', 'convertkit' ), | |
| 126 | + | |
| 127 | + // All. | |
| 118 | 128 | 'subscribe_button_label' => __( 'Subscribe', 'convertkit' ), |
| 119 | - 'email_text' => __( 'Already a premium subscriber? Enter the email address used when purchasing below, to receive a login link to access.', 'convertkit' ), | |
| 120 | - 'email_button_label' => __( 'Send email', 'convertkit' ), | |
| 121 | - 'email_check_text' => __( 'Check your email and click the link to login, or enter the code from the email below.', 'convertkit' ), | |
| 122 | - 'no_access_text' => __( 'Your account does not have access to this content. Please use the button below to purchase, or enter the email address you used to purchase the product.', 'convertkit' ), | |
| 129 | + 'email_text' => __( 'Already subscribed?', 'convertkit' ), | |
| 130 | + 'email_button_label' => __( 'Log in', 'convertkit' ), | |
| 131 | + 'email_heading' => __( 'Log in to read this post', 'convertkit' ), | |
| 132 | + 'email_description_text' => __( 'We\'ll email you a magic code to log you in without a password.', 'convertkit' ), | |
| 133 | + 'email_check_heading' => __( 'We just emailed you a log in code', 'convertkit' ), | |
| 134 | + 'email_check_text' => __( 'Enter the code below to finish logging in', 'convertkit' ), | |
| 135 | + 'no_access_text' => __( 'Your account does not have access to this content. Please use the button above to purchase, or enter the email address you used to purchase the product.', 'convertkit' ), | |
| 123 | 136 | ); |
| 124 | 137 | |
| 125 | 138 | /** |
| 126 | 139 | * The default settings, used when the ConvertKit Restrict Content Settings haven't been saved |
| @@ -127,9 +140,9 @@ | ||
| 127 | 140 | * e.g. on a new installation. |
| 128 | 141 | * |
| 129 | 142 | * @since 2.1.0 |
| 130 | 143 | * |
| 131 | - * @param array $defaults | |
| 144 | + * @param array $defaults Default settings. | |
| 132 | 145 | */ |
| 133 | 146 | $defaults = apply_filters( 'convertkit_settings_restrict_content_get_defaults', $defaults ); |
| 134 | 147 | |
| 135 | 148 | return $defaults; |