RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
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 | |
/** | |
* @here https://www.wpexplorer.com/how-to-disable-wordpress-gutenberg-block-patterns/ | |
*/ | |
//Remove core patterns: | |
// | |
//The following code will remove the default core patterns that are installed in WordPress natively. | |
add_action( 'after_setup_theme', function() { |
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 | |
function get_decorated_diff($old, $new){ | |
$from_start = strspn($old ^ $new, "\0"); | |
$from_end = strspn(strrev($old) ^ strrev($new), "\0"); | |
$old_end = strlen($old) - $from_end; | |
$new_end = strlen($new) - $from_end; | |
$start = substr($new, 0, $from_start); | |
$end = substr($new, $new_end); |
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 | |
remove_filter ('single_post_title', 'wptexturize'); | |
remove_filter ('bloginfo', 'wptexturize'); | |
remove_filter ('wp_title', 'wptexturize'); | |
// Additionally, you can remove the filter for other locations as well: | |
remove_filter ('category_description', 'wptexturize'); | |
remove_filter ('list_cats', 'wptexturize'); | |
remove_filter ('comment_author', 'wptexturize'); | |
remove_filter ('comment_text', 'wptexturize'); |
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 | |
// Use the $pagenow global. | |
if( is_admin() ) { | |
add_filter( 'init', 'custom_restrict_pages_from_admin' ); | |
} | |
function custom_restrict_pages_from_admin() { | |
global $pagenow; |
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 | |
/** | |
* WordPress Localized Language, defaults to English. | |
* | |
* Change this to localize WordPress. A corresponding MO file for the chosen | |
* language must be installed to wp-content/languages. For example, install | |
* de.mo to wp-content/languages and set WPLANG to 'de' to enable German | |
* language support. | |
*/ | |
// ------------------------------------------------------------------------------------------------ |
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 | |
/* Custom fields on WooCommerce My Account | |
================================================================================================ */ | |
/* Set up custom My Account tab and display the custom form fields | |
------------------------------------------------------------------------------------------------ | |
Based on https://www.businessbloomer.com/woocommerce-add-new-tab-account-page/ | |
*/ | |
// Register new endpoint (URL) for My Account page |
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 | |
/** | |
* FYKI | |
* | |
* The user's first and last names are stored within the user_meta!!! | |
* | |
* So if you need this data, you can access it by using `get_user_meta( $new_user->ID )`. | |
* | |
* Or, you can directly ask for it like this: | |
* |
NewerOlder