@@ -1214,8 +1214,6 @@ discard block |
||
| 1214 | 1214 | * the correct WordPress options API (old plugin stored options wierdly) |
| 1215 | 1215 | * |
| 1216 | 1216 | * @since 1.0.0 |
| 1217 | - * @param string $yikes_inc_easy_mailchimp_extender The name of this plugin. |
|
| 1218 | - * @param string $version The version of this plugin. |
|
| 1219 | 1217 | */ |
| 1220 | 1218 | public function check_for_old_yks_mc_options() { |
| 1221 | 1219 | $old_plugin_options = get_option( 'ykseme_storage' ); |
@@ -1250,8 +1248,6 @@ discard block |
||
| 1250 | 1248 | * the correct WordPress options API (old plugin stored options wierdly) |
| 1251 | 1249 | * |
| 1252 | 1250 | * @since 1.0.0 |
| 1253 | - * @param string $yikes_inc_easy_mailchimp_extender The name of this plugin. |
|
| 1254 | - * @param string $version The version of this plugin. |
|
| 1255 | 1251 | */ |
| 1256 | 1252 | public function display_options_migrate_notice() { |
| 1257 | 1253 | |
@@ -492,10 +492,10 @@ discard block |
||
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | /** |
| 495 | - * Dismiss the migrate options notice (incase the user wants to do things manually) |
|
| 496 | - * |
|
| 497 | - * @since 6.0.0 |
|
| 498 | - **/ |
|
| 495 | + * Dismiss the migrate options notice (incase the user wants to do things manually) |
|
| 496 | + * |
|
| 497 | + * @since 6.0.0 |
|
| 498 | + **/ |
|
| 499 | 499 | public function yikes_easy_mailchimp_dismiss_option_migrate() { |
| 500 | 500 | // delete the options and allow the user to manually updadte things |
| 501 | 501 | |
@@ -626,10 +626,10 @@ discard block |
||
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | /** |
| 629 | - * Localize Script |
|
| 630 | - * Pass our imported list data, to the JS file |
|
| 631 | - * to build the drop down list in the modal |
|
| 632 | - */ |
|
| 629 | + * Localize Script |
|
| 630 | + * Pass our imported list data, to the JS file |
|
| 631 | + * to build the drop down list in the modal |
|
| 632 | + */ |
|
| 633 | 633 | public function tinymce_yikes_easy_mc() { |
| 634 | 634 | // check capabilities |
| 635 | 635 | if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) { |
@@ -857,9 +857,9 @@ discard block |
||
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | /** |
| 860 | - * Register our admin pages |
|
| 861 | - * used to display data back to the user |
|
| 862 | - **/ |
|
| 860 | + * Register our admin pages |
|
| 861 | + * used to display data back to the user |
|
| 862 | + **/ |
|
| 863 | 863 | public function register_admin_pages() { |
| 864 | 864 | |
| 865 | 865 | /* Top Level Menu 'Easy MailChimp' */ |
@@ -1013,82 +1013,82 @@ discard block |
||
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | 1015 | /** |
| 1016 | - * Generate YIKES Inc. Easy MailChimp Manage Forms Page |
|
| 1017 | - * |
|
| 1018 | - * @since 1.0.0 |
|
| 1019 | - */ |
|
| 1016 | + * Generate YIKES Inc. Easy MailChimp Manage Forms Page |
|
| 1017 | + * |
|
| 1018 | + * @since 1.0.0 |
|
| 1019 | + */ |
|
| 1020 | 1020 | function generateManageFormsPage() { |
| 1021 | 1021 | require_once YIKES_MC_PATH . 'admin/partials/menu/manage-forms.php'; // include our manage forms page |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | /** |
| 1025 | - * Generate YIKES Inc. Easy MailChimp Manage Lists Page |
|
| 1026 | - * |
|
| 1027 | - * @since 1.0.0 |
|
| 1028 | - */ |
|
| 1025 | + * Generate YIKES Inc. Easy MailChimp Manage Lists Page |
|
| 1026 | + * |
|
| 1027 | + * @since 1.0.0 |
|
| 1028 | + */ |
|
| 1029 | 1029 | function generateManageListsPage() { |
| 1030 | 1030 | require_once YIKES_MC_PATH . 'admin/partials/menu/manage-lists.php'; // include our lists page |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | 1033 | /** |
| 1034 | - * Generate YIKES Inc. Easy MailChimp Account Details Page |
|
| 1035 | - * |
|
| 1036 | - * @since 1.0.0 |
|
| 1037 | - */ |
|
| 1034 | + * Generate YIKES Inc. Easy MailChimp Account Details Page |
|
| 1035 | + * |
|
| 1036 | + * @since 1.0.0 |
|
| 1037 | + */ |
|
| 1038 | 1038 | function generateAccountDetailsPage() { |
| 1039 | 1039 | require_once YIKES_MC_PATH . 'admin/partials/menu/account-details.php'; // include our account details page |
| 1040 | 1040 | } |
| 1041 | 1041 | |
| 1042 | 1042 | /** |
| 1043 | - * Generate YIKES Inc. Easy MailChimp Support Page |
|
| 1044 | - * |
|
| 1045 | - * @since 1.0.0 |
|
| 1046 | - */ |
|
| 1043 | + * Generate YIKES Inc. Easy MailChimp Support Page |
|
| 1044 | + * |
|
| 1045 | + * @since 1.0.0 |
|
| 1046 | + */ |
|
| 1047 | 1047 | function generateSupportPage() { |
| 1048 | 1048 | require_once YIKES_MC_PATH . 'admin/partials/menu/support.php'; // include our options page |
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | 1051 | /** |
| 1052 | - * Generate YIKES Inc. Easy MailChimp Edit Form Page |
|
| 1053 | - * |
|
| 1054 | - * @since 1.0.0 |
|
| 1055 | - */ |
|
| 1052 | + * Generate YIKES Inc. Easy MailChimp Edit Form Page |
|
| 1053 | + * |
|
| 1054 | + * @since 1.0.0 |
|
| 1055 | + */ |
|
| 1056 | 1056 | function generateEditFormPage() { |
| 1057 | 1057 | require_once YIKES_MC_PATH . 'admin/partials/edit-form.php'; // include our options page |
| 1058 | 1058 | } |
| 1059 | 1059 | |
| 1060 | 1060 | /** |
| 1061 | - * Generate YIKES Inc. Easy MailChimp Welcome Page |
|
| 1062 | - * |
|
| 1063 | - * @since 1.0.0 |
|
| 1064 | - */ |
|
| 1061 | + * Generate YIKES Inc. Easy MailChimp Welcome Page |
|
| 1062 | + * |
|
| 1063 | + * @since 1.0.0 |
|
| 1064 | + */ |
|
| 1065 | 1065 | function generateWelcomePage() { |
| 1066 | 1066 | require_once YIKES_MC_PATH . 'admin/partials/welcome-page/welcome.php'; // include our options page |
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | 1069 | /** |
| 1070 | - * Generate YIKES Inc. Easy MailChimp View List Page |
|
| 1071 | - * |
|
| 1072 | - * @since 1.0.0 |
|
| 1073 | - */ |
|
| 1070 | + * Generate YIKES Inc. Easy MailChimp View List Page |
|
| 1071 | + * |
|
| 1072 | + * @since 1.0.0 |
|
| 1073 | + */ |
|
| 1074 | 1074 | function generateViewListPage() { |
| 1075 | 1075 | require_once YIKES_MC_PATH . 'admin/partials/view-list.php'; // include our options page |
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | 1078 | /** |
| 1079 | - * Generate YIKES Inc. Easy MailChimp View User Page |
|
| 1080 | - * |
|
| 1081 | - * @since 1.0.0 |
|
| 1082 | - */ |
|
| 1079 | + * Generate YIKES Inc. Easy MailChimp View User Page |
|
| 1080 | + * |
|
| 1081 | + * @since 1.0.0 |
|
| 1082 | + */ |
|
| 1083 | 1083 | function generateViewUserPage() { |
| 1084 | 1084 | require_once YIKES_MC_PATH . 'admin/partials/view-user.php'; // include our options page |
| 1085 | 1085 | } |
| 1086 | 1086 | |
| 1087 | 1087 | /** |
| 1088 | - * Register our plugin settings, and display them on our settings page |
|
| 1089 | - * |
|
| 1090 | - * @since v.5.4 |
|
| 1091 | - **/ |
|
| 1088 | + * Register our plugin settings, and display them on our settings page |
|
| 1089 | + * |
|
| 1090 | + * @since v.5.4 |
|
| 1091 | + **/ |
|
| 1092 | 1092 | function yikes_easy_mc_settings_init() { |
| 1093 | 1093 | |
| 1094 | 1094 | /* Register General Settings Section */ |
@@ -1204,9 +1204,9 @@ discard block |
||
| 1204 | 1204 | } |
| 1205 | 1205 | |
| 1206 | 1206 | /** |
| 1207 | - * Options Sanitization & Validation |
|
| 1208 | - * @since complete re-write |
|
| 1209 | - **/ |
|
| 1207 | + * Options Sanitization & Validation |
|
| 1208 | + * @since complete re-write |
|
| 1209 | + **/ |
|
| 1210 | 1210 | function yikes_mc_validate_api_key( $input ) { |
| 1211 | 1211 | if( $input === '' ) { |
| 1212 | 1212 | update_option( 'yikes-mc-api-validation' , 'invalid_api_key' ); |
@@ -1248,20 +1248,20 @@ discard block |
||
| 1248 | 1248 | } |
| 1249 | 1249 | |
| 1250 | 1250 | /** |
| 1251 | - * Generate YIKES Inc. Easy Forms for MailChimp Options Page |
|
| 1252 | - * |
|
| 1253 | - * @since 1.0.0 |
|
| 1254 | - */ |
|
| 1251 | + * Generate YIKES Inc. Easy Forms for MailChimp Options Page |
|
| 1252 | + * |
|
| 1253 | + * @since 1.0.0 |
|
| 1254 | + */ |
|
| 1255 | 1255 | function generatePageOptions() { |
| 1256 | 1256 | require_once YIKES_MC_PATH . 'admin/partials/menu/options.php'; // include our options page |
| 1257 | 1257 | } |
| 1258 | 1258 | |
| 1259 | 1259 | /** |
| 1260 | - * Check if users API key is valid, if not |
|
| 1261 | - * this function will apply a disabled attribute |
|
| 1262 | - * to form fields. (input, dropdowns, buttons etc.) |
|
| 1263 | - * @since v5.5 re-write |
|
| 1264 | - **/ |
|
| 1260 | + * Check if users API key is valid, if not |
|
| 1261 | + * this function will apply a disabled attribute |
|
| 1262 | + * to form fields. (input, dropdowns, buttons etc.) |
|
| 1263 | + * @since v5.5 re-write |
|
| 1264 | + **/ |
|
| 1265 | 1265 | public function is_user_mc_api_valid_form( $echo=true ) { |
| 1266 | 1266 | if( $echo == true ) { |
| 1267 | 1267 | if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { |
@@ -1301,7 +1301,7 @@ discard block |
||
| 1301 | 1301 | * Migrate our old options , to the new options API |
| 1302 | 1302 | * moving from 5.5 and beyond.. |
| 1303 | 1303 | * @since |
| 1304 | - */ |
|
| 1304 | + */ |
|
| 1305 | 1305 | public function migrate_old_yks_mc_options() { |
| 1306 | 1306 | // include our migrate options helper file |
| 1307 | 1307 | include_once YIKES_MC_PATH . 'admin/partials/upgrade-helpers/upgrade-migrate-options.php'; |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | /** |
| 1311 | 1311 | Admin Notices |
| 1312 | 1312 | - Notifications displayed at the top of admin pages, back to the user |
| 1313 | - **/ |
|
| 1313 | + **/ |
|
| 1314 | 1314 | |
| 1315 | 1315 | /** |
| 1316 | 1316 | * Check for existing plugin options |
@@ -1369,12 +1369,12 @@ discard block |
||
| 1369 | 1369 | * - http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search |
| 1370 | 1370 | */ |
| 1371 | 1371 | function findMCListID($id, $array) { |
| 1372 | - foreach ($array as $key => $val) { |
|
| 1373 | - if ($val['id'] === $id) { |
|
| 1374 | - return $key; |
|
| 1375 | - } |
|
| 1376 | - } |
|
| 1377 | - return null; |
|
| 1372 | + foreach ($array as $key => $val) { |
|
| 1373 | + if ($val['id'] === $id) { |
|
| 1374 | + return $key; |
|
| 1375 | + } |
|
| 1376 | + } |
|
| 1377 | + return null; |
|
| 1378 | 1378 | } // end |
| 1379 | 1379 | |
| 1380 | 1380 | /* Ajax Migrate Options */ |
@@ -1727,9 +1727,9 @@ discard block |
||
| 1727 | 1727 | } |
| 1728 | 1728 | |
| 1729 | 1729 | /** |
| 1730 | - * Custom action hook for our extensions to hook into |
|
| 1731 | - * @parameter get_current_screen() current screen information |
|
| 1732 | - */ |
|
| 1730 | + * Custom action hook for our extensions to hook into |
|
| 1731 | + * @parameter get_current_screen() current screen information |
|
| 1732 | + */ |
|
| 1733 | 1733 | do_action( 'yikes-mailchimp-admin-sidebar', get_current_screen() ); |
| 1734 | 1734 | |
| 1735 | 1735 | } |
@@ -2773,12 +2773,12 @@ discard block |
||
| 2773 | 2773 | } |
| 2774 | 2774 | |
| 2775 | 2775 | /** |
| 2776 | - * Return an array of MailChimp lists associated with this account |
|
| 2777 | - * |
|
| 2778 | - * Used when deleting the sites MailChimp cache stored |
|
| 2779 | - * @since 6.0.2 |
|
| 2780 | - * @return $list_id_array - array of list id's to loop over |
|
| 2781 | - */ |
|
| 2776 | + * Return an array of MailChimp lists associated with this account |
|
| 2777 | + * |
|
| 2778 | + * Used when deleting the sites MailChimp cache stored |
|
| 2779 | + * @since 6.0.2 |
|
| 2780 | + * @return $list_id_array - array of list id's to loop over |
|
| 2781 | + */ |
|
| 2782 | 2782 | public function get_mailchimp_list_ids_on_account() { |
| 2783 | 2783 | $api_key = yikes_get_mc_api_key(); |
| 2784 | 2784 | if( ! $api_key ) { |
@@ -2888,19 +2888,19 @@ discard block |
||
| 2888 | 2888 | } |
| 2889 | 2889 | |
| 2890 | 2890 | /** |
| 2891 | - * Hook in and display our support page/knowledge base articles |
|
| 2892 | - * on the support page |
|
| 2893 | - * @since 6.0.3.8 |
|
| 2894 | - */ |
|
| 2891 | + * Hook in and display our support page/knowledge base articles |
|
| 2892 | + * on the support page |
|
| 2893 | + * @since 6.0.3.8 |
|
| 2894 | + */ |
|
| 2895 | 2895 | public function hook_and_display_kb_article_RSS() { |
| 2896 | 2896 | // include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-articles-RSS.php' ); |
| 2897 | 2897 | include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-article-links.php' ); |
| 2898 | 2898 | } |
| 2899 | 2899 | |
| 2900 | 2900 | /** |
| 2901 | - * Check the users version number, and display a notice to upgrade the databse if needed |
|
| 2902 | - * @since 6.0.4 |
|
| 2903 | - */ |
|
| 2901 | + * Check the users version number, and display a notice to upgrade the databse if needed |
|
| 2902 | + * @since 6.0.4 |
|
| 2903 | + */ |
|
| 2904 | 2904 | public function check_yikes_mc_table_version() { |
| 2905 | 2905 | if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) { |
| 2906 | 2906 | require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php'; |
@@ -23,6 +23,10 @@ discard block |
||
| 23 | 23 | * @since 6.0.0 |
| 24 | 24 | * @$integration_type - pass in the type of checkbox integration |
| 25 | 25 | */ |
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * @param string $integration_type |
|
| 29 | + */ |
|
| 26 | 30 | public function is_user_already_subscribed( $integration_type ) { |
| 27 | 31 | // first check if the user is logged in |
| 28 | 32 | if( is_user_logged_in() ) { |
@@ -69,6 +73,10 @@ discard block |
||
| 69 | 73 | * @$email - users email address entered into the form |
| 70 | 74 | * @$integration_type - pass in the type of checkbox integration |
| 71 | 75 | */ |
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * @param string $integration_type |
|
| 79 | + */ |
|
| 72 | 80 | public function is_new_registration_already_subscribed( $email , $integration_type ) { |
| 73 | 81 | // first check if the user is logged in |
| 74 | 82 | $checkbox_options = get_option( 'optin-checkbox-init' , '' ); |
@@ -233,6 +241,10 @@ discard block |
||
| 233 | 241 | * before continuing |
| 234 | 242 | * @since 6.0.0 |
| 235 | 243 | */ |
| 244 | + |
|
| 245 | + /** |
|
| 246 | + * @param string $type |
|
| 247 | + */ |
|
| 236 | 248 | public function was_checkbox_checked( $type ) { |
| 237 | 249 | // was sign-up checkbox checked - return the value |
| 238 | 250 | return ( isset( $_POST[ 'yikes_mailchimp_checkbox_'.$type ] ) && $_POST[ 'yikes_mailchimp_checkbox_'.$type ] == 1 ); |
@@ -102,10 +102,10 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | - * Get the checkbox for the given integration and render it on the front end |
|
| 106 | - * @return string |
|
| 107 | - * @since 6.0.0 |
|
| 108 | - */ |
|
| 105 | + * Get the checkbox for the given integration and render it on the front end |
|
| 106 | + * @return string |
|
| 107 | + * @since 6.0.0 |
|
| 108 | + */ |
|
| 109 | 109 | public function yikes_get_checkbox() { |
| 110 | 110 | // enqueue our checkbox styles whenever the checkbox is displayed |
| 111 | 111 | wp_enqueue_style( 'yikes-easy-mailchimp-checkbox-integration-styles', plugin_dir_url( __FILE__ ) . '../css/yikes-inc-easy-mailchimp-checkbox-integration.min.css' ); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * a new integration type is submitted |
| 136 | 136 | * |
| 137 | 137 | * @since 6.0.0 |
| 138 | - **/ |
|
| 138 | + **/ |
|
| 139 | 139 | public function subscribe_user_integration( $email, $type, $merge_vars ) { |
| 140 | 140 | // get checkbox data |
| 141 | 141 | $checkbox_options = get_option( 'optin-checkbox-init' , '' ); |
@@ -198,9 +198,9 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
| 201 | - * Build merge varaibles array |
|
| 202 | - * @since 6.0.0 |
|
| 203 | - */ |
|
| 201 | + * Build merge varaibles array |
|
| 202 | + * @since 6.0.0 |
|
| 203 | + */ |
|
| 204 | 204 | public function user_merge_vars( WP_User $user ) { |
| 205 | 205 | // start with user_login as name, since that's always known |
| 206 | 206 | $merge_vars = array( |
@@ -240,10 +240,10 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | |
| 242 | 242 | /** |
| 243 | - * Alter the registraton complete message |
|
| 244 | - * if the registration form checkbox integration is toggled on |
|
| 245 | - * @since 6.0.0 |
|
| 246 | - **/ |
|
| 243 | + * Alter the registraton complete message |
|
| 244 | + * if the registration form checkbox integration is toggled on |
|
| 245 | + * @since 6.0.0 |
|
| 246 | + **/ |
|
| 247 | 247 | public function yikes_reg_complete_msg( $errors, $redirect_to ) { |
| 248 | 248 | if( isset( $errors->errors['registered'] ) ) { |
| 249 | 249 | $email_error = get_option( 'yikes_register_subscription_error' , '' ); |
@@ -262,8 +262,8 @@ discard block |
||
| 262 | 262 | unset( $tmp ); |
| 263 | 263 | delete_option( 'yikes_register_subscription_error' ); |
| 264 | 264 | } |
| 265 | - } |
|
| 266 | - return $errors; |
|
| 265 | + } |
|
| 266 | + return $errors; |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * @param array $anonymous_data |
| 42 | 42 | * @param int $user_id |
| 43 | 43 | * @param string $trigger |
| 44 | - * @return boolean |
|
| 44 | + * @return boolean|null |
|
| 45 | 45 | */ |
| 46 | 46 | public function subscribe_from_bbpress( $anonymous_data, $user_id, $trigger ) { |
| 47 | 47 | $user_data = get_userdata( $user_id ); |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * Outputs a checkbox |
|
| 31 | - */ |
|
| 30 | + * Outputs a checkbox |
|
| 31 | + */ |
|
| 32 | 32 | public function output_checkbox() { |
| 33 | 33 | if( $this->is_user_already_subscribed( $this->type ) == '1' ) { |
| 34 | 34 | return; |
@@ -40,7 +40,6 @@ |
||
| 40 | 40 | * @param string $user_login |
| 41 | 41 | * @param string $user_password |
| 42 | 42 | * @param string $user_email |
| 43 | - * @param array $usermeta |
|
| 44 | 43 | */ |
| 45 | 44 | public function subscribe_from_buddypress_form( $user_id, $user_login, $user_password, $user_email ) { |
| 46 | 45 | if ( $this->was_checkbox_checked( $this->type ) === false ) { |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * Outputs a checkbox, if user is not already subscribed |
|
| 22 | - */ |
|
| 21 | + * Outputs a checkbox, if user is not already subscribed |
|
| 22 | + */ |
|
| 23 | 23 | public function output_checkbox() { |
| 24 | 24 | if( $this->is_user_already_subscribed( $this->type ) == '1' ) { |
| 25 | 25 | return; |
@@ -41,7 +41,6 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | - * @param array $meta |
|
| 45 | 44 | * |
| 46 | 45 | * @return array |
| 47 | 46 | */ |
@@ -57,7 +56,7 @@ discard block |
||
| 57 | 56 | /** |
| 58 | 57 | * @param int $payment_id The ID of the payment |
| 59 | 58 | * |
| 60 | - * @return bool|string |
|
| 59 | + * @return false|null |
|
| 61 | 60 | */ |
| 62 | 61 | public function subscribe_from_edd_purchase( $payment_id ) { |
| 63 | 62 | $meta = get_post_meta( $payment_id , '_yikes_easy_mc_optin' , true ); |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * Outputs a checkbox |
|
| 31 | - */ |
|
| 30 | + * Outputs a checkbox |
|
| 31 | + */ |
|
| 32 | 32 | public function output_checkbox() { |
| 33 | 33 | if( $this->is_user_already_subscribed( $this->type ) == '1' ) { |
| 34 | 34 | return; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | * |
| 36 | 36 | * @param int $user_id |
| 37 | 37 | * |
| 38 | - * @return bool|string |
|
| 38 | + * @return false|null |
|
| 39 | 39 | */ |
| 40 | 40 | public function subscribe_from_registration( $user_id ) { |
| 41 | 41 | // was sign-up checkbox checked? |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * Outputs a checkbox |
|
| 28 | - */ |
|
| 27 | + * Outputs a checkbox |
|
| 28 | + */ |
|
| 29 | 29 | public function output_checkbox() { |
| 30 | 30 | echo $this->yikes_get_checkbox(); |
| 31 | 31 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @param int $user_id |
| 37 | 37 | * |
| 38 | 38 | * @return bool|string |
| 39 | - */ |
|
| 39 | + */ |
|
| 40 | 40 | public function subscribe_from_registration( $user_id ) { |
| 41 | 41 | // was sign-up checkbox checked? |
| 42 | 42 | if ( $this->was_checkbox_checked( $this->type ) === false ) { |
@@ -154,17 +154,17 @@ |
||
| 154 | 154 | public function findMCListIndex( $id, $array, $tag ) { |
| 155 | 155 | if( $tag == 'tag' ) { |
| 156 | 156 | foreach( $array as $key => $val ) { |
| 157 | - if ( $val['tag'] === $id ) { |
|
| 158 | - return $key; |
|
| 159 | - } |
|
| 160 | - } |
|
| 161 | - return null; |
|
| 157 | + if ( $val['tag'] === $id ) { |
|
| 158 | + return $key; |
|
| 159 | + } |
|
| 160 | + } |
|
| 161 | + return null; |
|
| 162 | 162 | } else { |
| 163 | 163 | foreach ( $array as $key => $val ) { |
| 164 | - if ( $val['id'] == $id ) { |
|
| 165 | - return $key; |
|
| 166 | - } |
|
| 167 | - } |
|
| 164 | + if ( $val['id'] == $id ) { |
|
| 165 | + return $key; |
|
| 166 | + } |
|
| 167 | + } |
|
| 168 | 168 | return null; |
| 169 | 169 | } |
| 170 | 170 | } // end |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | class Yikes_Inc_Easy_Mailchimp_Extender_Helper { |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | - * Helper functions to help out with extensions (still fleshing out) |
|
| 11 | - * @since 6.0 |
|
| 12 | - * @ Parameters (array of data) |
|
| 13 | - * - Section ID - id of the section, should be a slug style text ie: 'custom-section' |
|
| 14 | - * - Link Text - Visible text for this link ie: 'Custom Section' |
|
| 15 | - * - Dashicon - class of the icon you would like to use for this link |
|
| 16 | - **/ |
|
| 10 | + * Helper functions to help out with extensions (still fleshing out) |
|
| 11 | + * @since 6.0 |
|
| 12 | + * @ Parameters (array of data) |
|
| 13 | + * - Section ID - id of the section, should be a slug style text ie: 'custom-section' |
|
| 14 | + * - Link Text - Visible text for this link ie: 'Custom Section' |
|
| 15 | + * - Dashicon - class of the icon you would like to use for this link |
|
| 16 | + **/ |
|
| 17 | 17 | public static function add_edit_form_section_link( $link_array=array() ) { |
| 18 | 18 | if( !empty( $link_array ) ) { |
| 19 | 19 | $link_data = wp_parse_args( array() , $link_array ); |
@@ -36,17 +36,17 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | - * Helper functions to help out with extensions (still fleshing out) |
|
| 40 | - * @since 6.0 |
|
| 41 | - * @ Parameters: |
|
| 42 | - * - Section ID - id of the section, should be a slug style text ie: 'custom-section' |
|
| 43 | - * - Class - class file to call function from? |
|
| 44 | - * - Main Callback - call back for main section |
|
| 45 | - * - Main Section Title - main section title |
|
| 46 | - * - Sidebar Callback - callback for the sidebar section |
|
| 47 | - * - Sidebar Title - title of the sidebar section |
|
| 48 | - * - Class - class to reference funtions out of (optiona, if left blank functions should be defined in functions.php (or outside of a class)) |
|
| 49 | - **/ |
|
| 39 | + * Helper functions to help out with extensions (still fleshing out) |
|
| 40 | + * @since 6.0 |
|
| 41 | + * @ Parameters: |
|
| 42 | + * - Section ID - id of the section, should be a slug style text ie: 'custom-section' |
|
| 43 | + * - Class - class file to call function from? |
|
| 44 | + * - Main Callback - call back for main section |
|
| 45 | + * - Main Section Title - main section title |
|
| 46 | + * - Sidebar Callback - callback for the sidebar section |
|
| 47 | + * - Sidebar Title - title of the sidebar section |
|
| 48 | + * - Class - class to reference funtions out of (optiona, if left blank functions should be defined in functions.php (or outside of a class)) |
|
| 49 | + **/ |
|
| 50 | 50 | public static function add_edit_form_section( $section_array=array() ) { |
| 51 | 51 | if( !empty( $section_array ) ) { |
| 52 | 52 | $section_data = wp_parse_args( array() , $section_array ); |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * Check if the custom section is single or two columns (with sidebar) |
|
| 63 | - * @since 6.0 |
|
| 64 | - * @Parameters: |
|
| 65 | - * - Section Data - the array of data associated with the custom field you've set up |
|
| 66 | - */ |
|
| 62 | + * Check if the custom section is single or two columns (with sidebar) |
|
| 63 | + * @since 6.0 |
|
| 64 | + * @Parameters: |
|
| 65 | + * - Section Data - the array of data associated with the custom field you've set up |
|
| 66 | + */ |
|
| 67 | 67 | public static function is_custom_section_two_column( $custom_section_data ) { |
| 68 | 68 | // print_r( $custom_section_data ); |
| 69 | 69 | $value = ( isset( $custom_section_data['sidebar_title'] ) && isset( $custom_section_data['sidebar_fields'] ) && !empty( $custom_section_data['sidebar_fields'] ) ) ? true : false; |
@@ -356,9 +356,9 @@ discard block |
||
| 356 | 356 | ?></ul><?php |
| 357 | 357 | } |
| 358 | 358 | /** |
| 359 | - * Custom action hook for our add-ons to hook into |
|
| 360 | - * @since 6.0.3.8 |
|
| 361 | - */ |
|
| 359 | + * Custom action hook for our add-ons to hook into |
|
| 360 | + * @since 6.0.3.8 |
|
| 361 | + */ |
|
| 362 | 362 | do_action( 'yikes-mailchimp-list-form-fields-metabox' ); |
| 363 | 363 | ?> |
| 364 | 364 | |
@@ -385,9 +385,9 @@ discard block |
||
| 385 | 385 | <?php |
| 386 | 386 | } |
| 387 | 387 | /** |
| 388 | - * Custom action hook for our add-ons to hook into |
|
| 389 | - * @since 6.0.3.8 |
|
| 390 | - */ |
|
| 388 | + * Custom action hook for our add-ons to hook into |
|
| 389 | + * @since 6.0.3.8 |
|
| 390 | + */ |
|
| 391 | 391 | do_action( 'yikes-mailchimp-list-interest-groups-metabox' ); |
| 392 | 392 | ?> |
| 393 | 393 | |