Skip to content

Instantly share code, notes, and snippets.

@GoranGozo
GoranGozo / load-vue-app-in-wp-visual-composer-editor.js
Created April 26, 2022 19:58
Load VUE app in WordPress Visual Composer editor
/*
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.
@GoranGozo
GoranGozo / create-admin-user.php
Created October 19, 2020 12:10 — forked from wpscholar/create-admin-user.php
Create a new admin user in WordPress via code. Drop this file in the mu-plugins directory and update the variables, then load a page in WordPress to create the user. Remove the file when done.
<?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 );
@GoranGozo
GoranGozo / reset-password-link.php
Created June 9, 2018 11:35
Reset password link local WordPress