Skip to content

Instantly share code, notes, and snippets.

@maheshwaghmare
Created March 12, 2021 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maheshwaghmare/0cb5bb328471b4ccca8e5ea84ac19267 to your computer and use it in GitHub Desktop.
Save maheshwaghmare/0cb5bb328471b4ccca8e5ea84ac19267 to your computer and use it in GitHub Desktop.
Override WordPress core functions via plugin. Read more https://wp.me/P4Ams0-9FH

Below is the list of all WordPress core functions which we can override from the plugin.

  • wp_set_current_user( $id, $name = '' )
  • wp_get_current_user()
  • get_userdata( $user_id )
  • get_user_by( $field, $value )
  • cache_users( $user_ids )
  • wp_mail( $to, $subject, $message, $headers = '', $attachments = array() )
  • wp_authenticate( $username, $password )
  • wp_logout()
  • wp_validate_auth_cookie( $cookie = '', $scheme = '' )
  • wp_generate_auth_cookie( $user_id, $expiration, $scheme = 'auth', $token = '' )
  • wp_parse_auth_cookie( $cookie = '', $scheme = '' )
  • wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token = '' )
  • wp_clear_auth_cookie()
  • is_user_logged_in()
  • auth_redirect()
  • check_admin_referer( $action = -1, $query_arg = '_wpnonce' )
  • check_ajax_referer( $action = -1, $query_arg = false, $die = true )
  • wp_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' )
  • wp_sanitize_redirect( $location )
  • _wp_sanitize_utf8_in_redirect( $matches )
  • wp_safe_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' )
  • wp_validate_redirect( $location, $default = '' )
  • wp_notify_postauthor( $comment_id, $deprecated = null )
  • wp_notify_moderator( $comment_id )
  • wp_password_change_notification( $user )
  • wp_new_user_notification( $user_id, $deprecated = null, $notify = '' )
  • wp_nonce_tick()
  • wp_verify_nonce( $nonce, $action = -1 )
  • wp_create_nonce( $action = -1 )
  • wp_salt( $scheme = 'auth' )
  • wp_hash( $data, $scheme = 'auth' )
  • wp_hash_password( $password )
  • wp_check_password( $password, $hash, $user_id = '' )
  • wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false )
  • wp_rand( $min = 0, $max = 0 )
  • wp_set_password( $password, $user_id )
  • get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null )
  • wp_text_diff( $left_string, $right_string, $args = null )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment