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
#!/usr/bin/php | |
<?php | |
/** | |
* File edited by Jory Hogeveen <KERAWEB> to also convert table charsets and collasion. | |
* IMPORTANT: SQL file needs to be UTF8 format! | |
* | |
* Example usage: | |
* | |
* - php -d memory_limit=4G cli-fix-serialization-charset.php path_to_source.sql path_to_target.sql latin1_swedish_ci utf8mb4_unicode_520_ci | |
* |
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
# Below SQL will convert an attachment URL to the attachment ID | |
# Useful when switching from Toolset to Pods or ACF. | |
UPDATE wp_postmeta m | |
LEFT JOIN wp_postmeta s | |
ON INSTR( m.meta_value, s.meta_value ) > 0 | |
SET m.meta_value = s.post_id | |
WHERE | |
s.meta_key = '_wp_attached_file' | |
AND m.meta_key = 'YOUR_META_KEY' |
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 | |
$user = ''; | |
$email = ''; | |
$password = ''; | |
$role = 'administrator'; | |
$user = get_user_by( 'email', $email ); | |
if ( ! $user ) { | |
wp_create_user( $user, $password, $email ); | |
$user = get_user_by( 'email', $email ); |
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 | |
/** | |
* MU plugin. Need to be used together with regular plugin. | |
* | |
* Plugin Name: Polylang Elementor Cross Domain Assets URL | |
* Description: Fixes cross origin domain issues with Elementor and Polylang | |
* Version: 1.0 | |
* Author: Jory Hogeveen | |
* Author URI: http://www.keraweb.nl/ | |
*/ |
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 | |
/** | |
* Load the mu-plugins just like regular plugins. | |
*/ | |
$directory = scandir( WPMU_PLUGIN_DIR ); | |
foreach ($directory as $dir) { | |
if ( $dir === '.' || $dir === '..' ) continue; |
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 hooks: | |
* widget_css_classes_first | |
* widget_css_classes_last | |
* widget_css_classes_even | |
* widget_css_classes_odd | |
* widget_css_classes_number | |
* |
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: My View Admin As Superior Admin | |
* Description: Define a superior admin for View Admin As | |
* Version: 1.1 | |
* Author: Jory Hogeveen | |
* Author URI: http://www.keraweb.nl/ | |
*/ | |
add_filter( 'view_admin_as_superior_admins', 'my_vaa_superior_admins', 99999 ); |