public function __construct(MC4WP_Lite $mc4wp) { $this->options = $mc4wp->get_options(); add_action('admin_init', array($this, 'register_settings')); add_action('admin_menu', array($this, 'build_menu')); add_action('admin_enqueue_scripts', array($this, 'load_css_and_js')); add_action('bp_include', array($this, 'set_buddypress_var')); add_filter("plugin_action_links_mailchimp-for-wp/mailchimp-for-wp.php", array($this, 'add_settings_link')); }
public function __construct(MC4WP_Lite $mc4wp) { $this->options = $opts = $mc4wp->get_options(); if ($opts['form_css']) { add_action('wp_enqueue_scripts', array($this, 'load_stylesheet')); } add_shortcode('mc4wp-form', array($this, 'output_form')); // enable shortcodes in text widgets add_filter('widget_text', 'shortcode_unautop'); add_filter('widget_text', 'do_shortcode', 11); if (isset($_POST['mc4wp_form_submit'])) { // change $_POST['name'] to something else, to fix WP bug // maybe later ok? add_action('init', array($this, 'subscribe')); } }
public function __construct(MC4WP_Lite $mc4wp) { $this->options = $opts = $mc4wp->get_options(); // load checkbox css if necessary if ($this->options['checkbox_css'] == 1) { add_action('wp_enqueue_scripts', array($this, 'load_stylesheet')); add_action('login_enqueue_scripts', array($this, 'load_stylesheet')); } /* Comment Form Actions */ if ($opts['checkbox_show_at_comment_form']) { add_action('comment_post', array($this, 'add_comment_meta'), 1); // hooks for checking if we should subscribe the commenter add_action('comment_approved_', array($this, 'subscribe_from_comment'), 10, 1); add_action('comment_post', array($this, 'subscribe_from_comment'), 60, 1); // hooks for outputting the checkbox add_action('thesis_hook_after_comment_box', array($this, 'output_checkbox'), 20); add_action('comment_form', array($this, 'output_checkbox'), 20); } /* Registration Form Actions */ if ($opts['checkbox_show_at_registration_form']) { add_action('register_form', array($this, 'output_checkbox'), 20); add_action('user_register', array($this, 'subscribe_from_registration'), 50); } /* BuddyPress Form Actions */ if ($opts['checkbox_show_at_bp_form']) { add_action('bp_before_registration_submit_buttons', array($this, 'output_checkbox'), 20); add_action('bp_complete_signup', array($this, 'subscribe_from_buddypress'), 20); } /* Multisite Form Actions */ if ($opts['checkbox_show_at_ms_form']) { add_action('signup_extra_fields', array($this, 'output_checkbox'), 20); add_action('signup_blogform', array($this, 'add_multisite_hidden_checkbox'), 20); add_action('wpmu_activate_blog', array($this, 'on_multisite_blog_signup'), 20, 5); add_action('wpmu_activate_user', array($this, 'on_multisite_user_signup'), 20, 3); add_filter('add_signup_meta', array($this, 'add_multisite_usermeta')); } /* Other actions... catch-all */ if ($opts['checkbox_show_at_other_forms']) { add_action('init', array($this, 'add_cf7_shortcode')); add_action('init', array($this, 'subscribe_from_whatever')); } }