0, 'sender' => get_bloginfo( 'admin_email' ), 'sender_name' => '', 'subject' => '', 'body' => '', 'recipient' => '', 'page' => - 1, 'conditions' => 'disabled', 'template' => '', 'category' => 0, ]; /** * DOI Parameter * * Filters the parameter for the DOI. This hook allows developers * to alter DOI fields. * * @param array $data Additional Fields * * @since 1.0.0 */ $data = apply_filters( 'f12_cf7_doubleoptin_get_parameter', $data ); if ( ! $postID ) { return $data; } $options = get_post_meta( $postID, 'f12-cf7-doubleoptin', true ); if ( ! $options ) { return $data; } return array_merge( $data, $options ); } /** * Private constructor to prevent direct instantiation. */ private function __construct() { load_plugin_textdomain( 'double-opt-in', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); /** * DOI INIT * * Run custom actions after the DOI has been initialized * * @param CF7DoubleOptIn $this * * @since 3.0.0 */ do_action( 'f12_cf7_doubleoptin_init', $this ); $this->TemplateHandler = TemplateHandler::getInstance(); $UI = new UI( $this->TemplateHandler, FORGE12_OPTIN_SLUG, 'Forge12 Double Opt-In', 'manage_options' ); add_action( 'after_setup_theme', array( $this, 'init' ) ); $Compatibility = new Compatibility( $this ); $CleanUp = new CleanUp(); // Pagination Pagination::getInstance(); // initialize filter CategoryOptions::getInstance(); OptInLimitFilter::getInstance(); OptInSearchFilter::getInstance(); // Support Support::getInstance(); } /** * Retrieve the template handler instance. * * @return TemplateHandler The template handler instance. */ public function get_template_handler() { return $this->TemplateHandler; } /** * @private WordPress Hook */ public function init() { do_action( 'f12_cf7_doubleoptin_register_implementations' ); } /** * Return the settings for the optin. * * @param string $single The Key of the setting to return only the required setting * * @formatter:off * @return { * // Returns the Settings for the DOI * * @type string $optout_subject The Subject for the OptOut Mail * @type string $optout_body The Content for the OptOut Mail * @type int $optout_page The Post ID for the OptOut Page * @type int $support Defines if the Support link will be added to the footer * @type int $delete An integer from 1 to 30 * @type int $delete_unconfirmed An integer from 1 to 30 * @type string $delete_period The time period, either months, days, years * @type string $delete_unconfirmed_period The time period, either months, days, years * } * @formatter:on */ public function getSettings( $single = '', $container = null ) { $default = array(); $default = apply_filters( 'f12_cf7_doubleoptin_settings', $default ); $settings = get_option( 'f12-doi-settings' ); if ( ! is_array( $settings ) ) { $settings = array(); } foreach ( $default as $key => $data ) { if ( isset( $settings[ $key ] ) ) { if ( is_array( $default[ $key ] ) ) { $default[ $key ] = array_merge( $default[ $key ], $settings[ $key ] ); } else { $default[ $key ] = $settings[ $key ]; } } } $settings = $default; if ( ! empty( $single ) ) { if ( $container != null ) { if ( isset( $settings[ $container ] ) && isset( $settings[ $container ][ $single ] ) ) { $settings = $settings[ $container ][ $single ]; } } } else { if ( isset( $settings[ $single ] ) ) { $settings = $settings[ $single ]; } } return $settings; } } CF7DoubleOptIn::getInstance(); }