__( 'General', 'affiliates' ), 'registration' => __( 'Registration', 'affiliates' ), 'pages' => __( 'Pages', 'affiliates' ), 'referrals' => __( 'Referrals', 'affiliates' ), 'integrations' => __( 'Integrations', 'affiliates' ) ) ); } /** * Registers an admin_notices action. */ public static function admin_init() { wp_register_style( 'affiliates-admin-settings', AFFILIATES_PLUGIN_URL . 'css/affiliates_admin_settings.css' ); wp_register_script( 'affiliates-field-choice', AFFILIATES_PLUGIN_URL . 'js/affiliates-field-choice.js', array( 'jquery' ), AFFILIATES_CORE_VERSION, true ); wp_localize_script( 'affiliates-field-choice', 'affiliates_field_choice_l12n', array( 'remove' => __( 'Remove', 'affiliates' ) ) ); if ( current_user_can( AFFILIATES_ADMINISTER_OPTIONS ) ) { if ( isset( $_REQUEST['aff_setup_hide'] ) ) { if ( wp_verify_nonce( $_REQUEST['aff_setup_nonce'], 'aff_setup_hide' ) ) { add_option( 'aff_setup_hide', 'yes', '', 'no' ); } } if ( !get_option( 'aff_setup_hide' ) ) { add_action( 'admin_notices', array( __CLASS__, 'setup_notice' ) ); } } } /** * Prints setup notices. */ public static function setup_notice() { echo ''; echo '
'; echo sprintf( __( 'Welcome to %s', 'affiliates' ), ucwords( str_replace('-', ' ', AFFILIATES_PLUGIN_NAME ) ) ); echo '
'; echo ''; echo __( 'Please review the following suggested steps to set up the affiliate system.', 'affiliates' ); echo ' '; echo __( 'This is intended as a guidance and you can safely hide this message when finished.', 'affiliates' ); echo ' '; echo sprintf( __( 'Use the Settings section to review or adjust the system anytime.', 'affiliates' ), admin_url( 'admin.php?page=affiliates-admin-settings' ) ); echo '
'; $buttons = apply_filters( 'affiliates_setup_buttons', array( 'general' => sprintf( '%s', add_query_arg( 'section', 'general', admin_url( 'admin.php?page=affiliates-admin-settings' ) ), __( 'Review General Settings', 'affiliates' ) ), 'registration' => sprintf ( '%s', add_query_arg( 'section', 'registration', admin_url( 'admin.php?page=affiliates-admin-settings' ) ), __( 'Enable Affiliate Registration', 'affiliates' ) ), 'pages' => sprintf ( '%s', add_query_arg( 'section', 'pages', admin_url( 'admin.php?page=affiliates-admin-settings' ) ), __( 'Create an Affiliate Area', 'affiliates' ) ), 'integrations' => sprintf ( '%s', add_query_arg( 'section', 'integrations', admin_url( 'admin.php?page=affiliates-admin-settings' ) ), __( 'Install an Integration', 'affiliates' ) ) ) ); // render the buttons echo ''; echo implode( ' ', $buttons ); echo ' '; printf( '%s', wp_nonce_url( add_query_arg( 'aff_setup_hide', 'true', admin_url( 'admin.php?page=affiliates-admin-settings' ) ), 'aff_setup_hide', 'aff_setup_nonce' ), __( 'Hide this', 'affiliates' ) ); echo '
'; echo '