Skip to content

Instantly share code, notes, and snippets.

@schakko
Last active August 12, 2020 14:45
Show Gist options
  • Save schakko/b4f014e025dc7f1eb59183cf954fd242 to your computer and use it in GitHub Desktop.
Save schakko/b4f014e025dc7f1eb59183cf954fd242 to your computer and use it in GitHub Desktop.
Fixes various bugs in Techland WordPress theme with WordPress 5.5; meta-box has currently issues and must be disabled
/**
* fix constructor to make it work with custom wp-content path (e.g. when hosting multiple webservers for loadbalancing purposes and using the same NFS share
* goes to wp-content/themes/techland/inc/theme-options/redux-extensions/extensions/nt_multi_field/extension_nt_multi_field.php line ~72
*/
if ( empty( $this->extension_dir ) ) {
$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
$this->extension_url = home_url( '/wp-content/' . str_replace( trailingslashit( str_replace( '\\', '/', WP_CONTENT_DIR ) ), '', $this->extension_dir ) );
}
/**
* fix constructor to make it work with custom wp-content path (e.g. when hosting multiple webservers for loadbalancing purposes and using the same NFS share
* goes to wp-content/themes/techland/inc/theme-options/redux-extensions/extensions/nt_multi_field/nt_multi_field/field_nt_multi_field.php line ~50
*/
if ( empty( $this->extension_dir ) ) {
$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
$this->extension_url = home_url( '/wp-content/' . str_replace( trailingslashit( str_replace( '\\', '/', WP_CONTENT_DIR ) ), '', $this->extension_dir ) );
}
/**
* fix for pagehero.live is undefined, line 134
*/
if (typeof pagehero.live === "function") {
pagehero.live('change', function(){
if(!pagehero.is(':checked')) {
// ...
}
})
}
/**
* fix for pagestyle.live is undefined, line ~170
*/
if (typeof pagestyle.live === "function") {
pagestyle.live('change', function(){
// ...
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment