@@ -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; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | <?php |
| 24 | 24 | } |
| 25 | 25 | $main_field_data = $section_data['main_fields']; |
| 26 | - foreach( $main_field_data as $field ) { |
|
| 26 | + foreach( $main_field_data as $field ) { |
|
| 27 | 27 | if( $field['type'] == 'custom' ) { |
| 28 | 28 | // execute the custom callback |
| 29 | 29 | $field['callback'](); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | <?php |
| 54 | 54 | } |
| 55 | 55 | $sidebar_field_data = $section_data['sidebar_fields']; |
| 56 | - foreach( $sidebar_field_data as $field ) { |
|
| 56 | + foreach( $sidebar_field_data as $field ) { |
|
| 57 | 57 | if( $field['type'] == 'custom' ) { |
| 58 | 58 | // execute the custom callback |
| 59 | 59 | $field['callback'](); |
@@ -112,9 +112,11 @@ |
||
| 112 | 112 | |
| 113 | 113 | // update 'date_format' on 'birthday' and 'date' fields |
| 114 | 114 | if( isset( $mailchimp_form['fields'][$new_parent_key]['type'] ) && in_array( $mailchimp_form['fields'][$new_parent_key]['type'], array( 'date', 'birthday' ) ) ) { |
| 115 | - if( $mailchimp_form['fields'][$new_parent_key]['type'] == 'date' ) { // date |
|
| 115 | + if( $mailchimp_form['fields'][$new_parent_key]['type'] == 'date' ) { |
|
| 116 | +// date |
|
| 116 | 117 | $mailchimp_form['fields'][$new_parent_key]['date_format'] = 'MM/DD'; // mailchimp default (can be altered) |
| 117 | - } else { // birthday |
|
| 118 | + } else { |
|
| 119 | +// birthday |
|
| 118 | 120 | $mailchimp_form['fields'][$new_parent_key]['date_format'] = 'MM/DD/YYYY'; // mailchimp default (can be altered) |
| 119 | 121 | } |
| 120 | 122 | } |
@@ -54,7 +54,8 @@ |
||
| 54 | 54 | foreach( $new_settings as $option_name => $option_value ) { |
| 55 | 55 | update_option( $option_name, $option_value ); |
| 56 | 56 | } |
| 57 | - } else { // if it's not, then it's an opt-in forms import |
|
| 57 | + } else { |
|
| 58 | +// if it's not, then it's an opt-in forms import |
|
| 58 | 59 | // If this is the first row, then it should be title data. |
| 59 | 60 | if ( 1 === $row ) { |
| 60 | 61 | $titles = $line; |
@@ -302,9 +302,9 @@ |
||
| 302 | 302 | ?></ul><?php |
| 303 | 303 | } |
| 304 | 304 | /** |
| 305 | - * Custom action hook for our add-ons to hook into |
|
| 306 | - * @since 6.0.3.8 |
|
| 307 | - */ |
|
| 305 | + * Custom action hook for our add-ons to hook into |
|
| 306 | + * @since 6.0.3.8 |
|
| 307 | + */ |
|
| 308 | 308 | do_action( 'yikes-mailchimp-list-form-fields-metabox' ); |
| 309 | 309 | ?> |
| 310 | 310 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes |
| 19 | 19 | * @author YIKES Inc. <[email protected]> |
| 20 | 20 | */ |
| 21 | -class Yikes_Inc_Easy_Mailchimp_Extender_Activator {
|
|
| 21 | +class Yikes_Inc_Easy_Mailchimp_Extender_Activator { |
|
| 22 | 22 | /** |
| 23 | 23 | * Short Description. Activation hook. |
| 24 | 24 | * |
@@ -26,16 +26,16 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @since 6.0.0 |
| 28 | 28 | */ |
| 29 | - public static function activate( $network_wide ) {
|
|
| 29 | + public static function activate( $network_wide ) { |
|
| 30 | 30 | global $wpdb; |
| 31 | 31 | |
| 32 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) {
|
|
| 32 | + if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 33 | 33 | // check if it is a network activation - if so, run the activation function for each blog id |
| 34 | - if ( $network_wide ) {
|
|
| 34 | + if ( $network_wide ) { |
|
| 35 | 35 | $old_blog = $wpdb->blogid; |
| 36 | 36 | // Get all blog ids |
| 37 | 37 | $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
|
| 38 | - foreach ( $blogids as $blog_id ) {
|
|
| 38 | + foreach ( $blogids as $blog_id ) { |
|
| 39 | 39 | switch_to_blog( $blog_id ); |
| 40 | 40 | self::_activate_yikes_easy_mailchimp( $wpdb ); |
| 41 | 41 | restore_current_blog(); |
@@ -44,7 +44,8 @@ discard block |
||
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | self::_activate_yikes_easy_mailchimp( $wpdb ); |
| 47 | - } else { /* end network activate */
|
|
| 47 | + } else { |
|
| 48 | +/* end network activate */ |
|
| 48 | 49 | self::_activate_yikes_easy_mailchimp( $wpdb ); |
| 49 | 50 | } |
| 50 | 51 | } |
@@ -56,7 +57,7 @@ discard block |
||
| 56 | 57 | * |
| 57 | 58 | * @since 6.0.0 |
| 58 | 59 | */ |
| 59 | - static function _activate_yikes_easy_mailchimp( $wpdb ) {
|
|
| 60 | + static function _activate_yikes_easy_mailchimp( $wpdb ) { |
|
| 60 | 61 | |
| 61 | 62 | // single site |
| 62 | 63 | $custom_table_name = $wpdb->prefix . 'yikes_easy_mc_forms'; |
@@ -95,12 +96,12 @@ discard block |
||
| 95 | 96 | |
| 96 | 97 | // create an option for the date that the user initially activated the plugin |
| 97 | 98 | // used to display a two week notice, asking for a review or to upgrade |
| 98 | - if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) || get_option( 'yikes_easy_mailchimp_activation_date' ) == '' ) {
|
|
| 99 | + if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) || get_option( 'yikes_easy_mailchimp_activation_date' ) == '' ) { |
|
| 99 | 100 | update_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ); |
| 100 | 101 | } |
| 101 | 102 | |
| 102 | 103 | // Create an option for the forms. |
| 103 | - if ( class_exists( 'Yikes_Inc_Easy_MailChimp_Extender_Option_Forms' ) ) {
|
|
| 104 | + if ( class_exists( 'Yikes_Inc_Easy_MailChimp_Extender_Option_Forms' ) ) { |
|
| 104 | 105 | $option_class = new Yikes_Inc_Easy_MailChimp_Extender_Option_Forms(); |
| 105 | 106 | $option_class->create_option(); |
| 106 | 107 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes |
| 26 | 26 | * @author YIKES Inc. <[email protected]> |
| 27 | 27 | */ |
| 28 | -class Yikes_Inc_Easy_Mailchimp_Extender {
|
|
| 28 | +class Yikes_Inc_Easy_Mailchimp_Extender { |
|
| 29 | 29 | /** |
| 30 | 30 | * The loader that's responsible for maintaining and registering all hooks that power |
| 31 | 31 | * the plugin. |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @param Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface |
| 72 | 72 | */ |
| 73 | - public function __construct( Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface ) {
|
|
| 73 | + public function __construct( Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface ) { |
|
| 74 | 74 | $this->version = YIKES_MC_VERSION; |
| 75 | 75 | $this->form_interface = $form_interface; |
| 76 | 76 | $this->load_dependencies(); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @since 1.0.0 |
| 94 | 94 | * @access private |
| 95 | 95 | */ |
| 96 | - private function load_dependencies() {
|
|
| 96 | + private function load_dependencies() { |
|
| 97 | 97 | /** |
| 98 | 98 | * The class responsible for orchestrating the actions and filters of the |
| 99 | 99 | * core plugin. |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @since 1.0.0 |
| 118 | 118 | * @access private |
| 119 | 119 | */ |
| 120 | - private function define_admin_hooks() {
|
|
| 120 | + private function define_admin_hooks() { |
|
| 121 | 121 | $plugin_admin = new Yikes_Inc_Easy_Mailchimp_Forms_Admin( $this->get_yikes_inc_easy_mailchimp_extender(), $this->get_version(), $this->form_interface ); |
| 122 | 122 | $plugin_admin->hooks(); |
| 123 | 123 | $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * @since 1.0.0 |
| 131 | 131 | * @access private |
| 132 | 132 | */ |
| 133 | - private function define_public_hooks() {
|
|
| 133 | + private function define_public_hooks() { |
|
| 134 | 134 | $plugin_public = new Yikes_Inc_Easy_Mailchimp_Extender_Public( $this->get_yikes_inc_easy_mailchimp_extender(), $this->get_version() ); |
| 135 | 135 | } |
| 136 | 136 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * |
| 139 | 139 | * @since 1.0.0 |
| 140 | 140 | */ |
| 141 | - public function run() {
|
|
| 141 | + public function run() { |
|
| 142 | 142 | $this->loader->run(); |
| 143 | 143 | } |
| 144 | 144 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @since 1.0.0 |
| 149 | 149 | * @return string The name of the plugin. |
| 150 | 150 | */ |
| 151 | - public function get_yikes_inc_easy_mailchimp_extender() {
|
|
| 151 | + public function get_yikes_inc_easy_mailchimp_extender() { |
|
| 152 | 152 | return $this->yikes_inc_easy_mailchimp_extender; |
| 153 | 153 | } |
| 154 | 154 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @since 1.0.0 |
| 158 | 158 | * @return Yikes_Inc_Easy_Mailchimp_Extender_Loader Orchestrates the hooks of the plugin. |
| 159 | 159 | */ |
| 160 | - public function get_loader() {
|
|
| 160 | + public function get_loader() { |
|
| 161 | 161 | return $this->loader; |
| 162 | 162 | } |
| 163 | 163 | /** |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @since 1.0.0 |
| 167 | 167 | * @return string The version number of the plugin. |
| 168 | 168 | */ |
| 169 | - public function get_version() {
|
|
| 169 | + public function get_version() { |
|
| 170 | 170 | return $this->version; |
| 171 | 171 | } |
| 172 | 172 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes |
| 20 | 20 | * @author YIKES Inc. <[email protected]> |
| 21 | 21 | */ |
| 22 | -class Yikes_Inc_Easy_Mailchimp_Extender_Loader {
|
|
| 22 | +class Yikes_Inc_Easy_Mailchimp_Extender_Loader { |
|
| 23 | 23 | /** |
| 24 | 24 | * The array of actions registered with WordPress. |
| 25 | 25 | * |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @since 6.0.0 |
| 43 | 43 | */ |
| 44 | - public function __construct() {
|
|
| 44 | + public function __construct() { |
|
| 45 | 45 | $this->actions = array(); |
| 46 | 46 | $this->filters = array(); |
| 47 | 47 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @param int Optional $priority The priority at which the function should be fired. |
| 56 | 56 | * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. |
| 57 | 57 | */ |
| 58 | - public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
|
|
| 58 | + public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
| 59 | 59 | $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); |
| 60 | 60 | } |
| 61 | 61 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @param int Optional $priority The priority at which the function should be fired. |
| 69 | 69 | * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. |
| 70 | 70 | */ |
| 71 | - public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
|
|
| 71 | + public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
| 72 | 72 | $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); |
| 73 | 73 | } |
| 74 | 74 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. |
| 86 | 86 | * @return type The collection of actions and filters registered with WordPress. |
| 87 | 87 | */ |
| 88 | - private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
|
|
| 88 | + private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
|
| 89 | 89 | $hooks[] = array( |
| 90 | 90 | 'hook' => $hook, |
| 91 | 91 | 'component' => $component, |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | * |
| 101 | 101 | * @since 6.0.0 |
| 102 | 102 | */ |
| 103 | - public function run() {
|
|
| 104 | - foreach ( $this->filters as $hook ) {
|
|
| 103 | + public function run() { |
|
| 104 | + foreach ( $this->filters as $hook ) { |
|
| 105 | 105 | add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
| 106 | 106 | } |
| 107 | - foreach ( $this->actions as $hook ) {
|
|
| 107 | + foreach ( $this->actions as $hook ) { |
|
| 108 | 108 | add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -118,8 +118,8 @@ |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | - * Save changes to a field's label |
|
| 122 | - */ |
|
| 121 | + * Save changes to a field's label |
|
| 122 | + */ |
|
| 123 | 123 | public function save_field_label_edits() { |
| 124 | 124 | |
| 125 | 125 | // Capture our $_POST variables |