• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
    • Help
      • Online help
      • Learn Git
      • Welcome to Bitbucket
      • Keyboard shortcuts
    • Log In
    Blackrock
    1. Blackrock

    main

    Public
    Actions
    • Clone

    Learn more about cloning repositories

    You have read-only access

    Navigation
    • Source
    • Commits
    • Branches
    • All Branches Graph
    • Graphs
    • Forks
    1. Blackrock
    2. main

    Source

    main/wp-content/plugins/ultimate-member/includes/core/um-actions-ajax.php
    Артем ШиряевАртем Ширяев committed 554847ddcb906 Apr 2021
    Raw file
    Source viewDiff to previous
     
    1
    <?php
    2
    // Exit if accessed directly
    3
    if ( ! defined( 'ABSPATH' ) ) exit;
    4
    ​
    5
    /**
    6
     * Run check if username exists
    7
     * @uses action hooks: wp_ajax_nopriv_ultimatemember_check_username_exists, wp_ajax_ultimatemember_check_username_exists
    8
     * @return boolean
    9
     */
    10
    function ultimatemember_check_username_exists() {
    11
        UM()->check_ajax_nonce();
    12
    ​
    13
        $username = isset( $_REQUEST['username'] ) ? $_REQUEST['username'] : '';
    14
        $exists   = username_exists( $username );
    15
    ​
    16
        /**
    17
         * UM hook
    18
         *
    19
         * @type filter
    20
         * @title um_validate_username_exists
    21
         * @description Change username exists validation
    22
         * @input_vars
    23
         * [{"var":"$exists","type":"bool","desc":"Exists?"},
    24
         * {"var":"$username","type":"string","desc":"Username"}]
    25
         * @change_log
    26
         * ["Since: 2.0"]
    27
         * @usage
    28
         * <?php add_filter( 'um_validate_username_exists', 'function_name', 10, 2 ); ?>
    29
         * @example
    30
         * <?php
    31
         * add_filter( 'um_validate_username_exists', 'my_validate_username_exists', 10, 2 );
    32
         * function my_account_pre_updating_profile( $exists, $username ) {
    33
         *     // your code here
    34
         *     return $exists;
    35
         * }
    36
         * ?>
    37
         */
    38
        $exists = apply_filters( 'um_validate_username_exists', $exists, $username );
    39
    ​
    40
        if ( $exists ) {
    41
            echo 1;
    42
        } else {
    43
            echo 0;
    44
        }
    45
    ​
    46
        die();
    47
    }
    48
    add_action('wp_ajax_nopriv_ultimatemember_check_username_exists', 'ultimatemember_check_username_exists');
    49
    add_action('wp_ajax_ultimatemember_check_username_exists', 'ultimatemember_check_username_exists');
    • Git repository management for enterprise teams powered by Atlassian Bitbucket
    • Atlassian Bitbucket v5.10.1
    • Documentation
    • Contact Support
    • Request a feature
    • About
    • Contact Atlassian
    Atlassian

    Everything looks good. Well let you know here if theres anything you should know about.