add( 'Nilambar\\Welcome\\', __DIR__ . '/src' ); $loader->register(); require_once __DIR__ . '/bootstrap.php'; wp_welcome_bootstrap(); } /** * Load assets. * * @since 1.0.0 */ public function load_assets() { wp_enqueue_style( 'wp-welcome-style', WP_WELCOME_URL . '/assets/wp-welcome.css', array(), WP_WELCOME_VERSION ); wp_enqueue_script( 'wp-welcome-scripts', WP_WELCOME_URL . '/assets/wp-welcome.js', array( 'jquery' ), WP_WELCOME_VERSION, true ); wp_localize_script( 'wp-welcome-scripts', 'WPW_OBJECT', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'storage_key' => $this->get_unique_id( 'wpw-' ) . '-activetab', 'admin_nonce' => wp_create_nonce( 'wpw_installer_nonce' ), 'i18n' => array( 'activate' => esc_html__( 'Activate', 'wp-welcome' ), 'activated' => esc_html__( 'Activated', 'wp-welcome' ), 'install_now' => esc_html__( 'Install Now', 'wp-welcome' ), 'install_confirm' => esc_html__( 'Are you sure you want to install this plugin?', 'wp-welcome' ), ), ) ); } /** * Gets unique ID. * * @since 1.0.3 * * @param string $prefix Prefix for the returned ID. * @return string Unique ID. */ public function get_unique_id( $prefix = '' ) { static $wpw_counter = 0; return $prefix . (string) ++$wpw_counter; } } Init_1_0_5::initiate(); }