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
/* | |
How to load a VUE app in Wordpress admin inside Visual Composer editor. | |
For example if the VUE app is rendered using a shortcode. | |
Visual Composer editor is inside an iframe but calls trigger 'vc_build' on the parent. | |
Hence the need to register an listener on the parent (main) document and from it call a script inside the iframe. | |
This script can be enqueued with the WP usual wp_enqueue_script() since it will be in both the parent and iframe document. |
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 | |
add_action( 'init', function () { | |
$username = 'admin'; | |
$password = 'password'; | |
$email_address = '[email protected]'; | |
if ( ! username_exists( $username ) ) { | |
$user_id = wp_create_user( $username, $password, $email_address ); |
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 | |
/* | |
* I had a local WordPress dev enviroment that for some reason didn't allow me login even though I wrote the correct username and password. | |
* Resetting the password directly in the database didn't work and sending an email to reset the password obviously didn't work locally. | |
* Following the procedure for "I've forgotten my password" generates the neccesserary user_activation_key in the database. | |
* However you still need the correct link/URL on the local WordPress installation to be able to reset the password. | |
* This code generates that link. The code can be added in the index.php in the active theme. | |
* | |
* Based on: https://wordpress.stackexchange.com/questions/239095/how-do-i-create-a-password-reset-link | |
*/ |