'https://apinie.sensorpro.net', 'api_key' => '', 'organization' => '', 'api_user' => '', 'api_password' => '', 'tags' => '', 'import_name' => 'WordPress', 'send_welcome' => 0, 'show_first_name' => 1, 'show_last_name' => 1, 'require_names' => 0, 'consent_enabled' => 1, 'consent_text' => __( 'Yes, I would like to receive emails from us. I can unsubscribe at any time using the link in every email.', 'sensorpro' ), 'consent_field' => '', 'button_text' => __( 'Subscribe', 'sensorpro' ), 'success_message' => __( 'Thanks! You are on the list.', 'sensorpro' ), 'redirect_url' => '', ); } /** * Get merged settings. * * @return array */ function sensorpro_get_settings() { $saved = get_option( SENSORPRO_OPTION, array() ); if ( ! is_array( $saved ) ) { $saved = array(); } return array_merge( sensorpro_default_settings(), $saved ); } add_action( 'plugins_loaded', function () { SensorPro_Settings::init(); SensorPro_Form::init(); } ); add_action( 'widgets_init', function () { register_widget( 'SensorPro_Widget' ); } ); add_action( 'init', function () { // Lets the block editor preview use the same styles as the front end. wp_register_style( 'sensorpro-form-editor', SENSORPRO_URL . 'assets/css/sensorpro.css', array(), SENSORPRO_VERSION ); register_block_type( SENSORPRO_DIR . 'blocks/sensorpro-form', array( 'render_callback' => array( 'SensorPro_Form', 'render_block' ), ) ); } ); register_activation_hook( __FILE__, function () { if ( false === get_option( SENSORPRO_OPTION ) ) { add_option( SENSORPRO_OPTION, sensorpro_default_settings(), '', false ); } } ); add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), function ( $links ) { $url = admin_url( 'options-general.php?page=sensorpro' ); array_unshift( $links, '' . esc_html__( 'Settings', 'sensorpro' ) . '' ); return $links; } );