This file contains hidden or 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 | |
/** | |
* Migrate passwords from old password hash algorithm to WordPress algorithm. | |
* | |
* When your client has existing and working application with database of users | |
* and you want to import them to your brand new WordPress application, you can | |
* not import passwords because they are probably hashed using different algorithm. | |
* | |
* Solution for that is to save old user passwords in meta column `_old_password` | |
* and compare user typed password using old hashing algorithm with meta column |
This file contains hidden or 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 to resolve assets url with attached content hash. | |
* | |
* Browser cache mechanism is used to store locally once downloaded assets. This | |
* improves website performance and saves network bandwidth. It may be also creating | |
* a problem when a user visits your website and do not see the newest changes in assets | |
* because the browser is serving an old file from cache. | |
* |
This file contains hidden or 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 bootsrap file. | |
* | |
* @author Motivast motivast.com | |
* @copyright 2018 - present, Motivast | |
* | |
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt GPL-2.0-or-later | |
* |
This file contains hidden or 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 assets from Swift booster to refresh merged css file | |
* | |
* Swift performance lite is keeping some local assets source in booster which | |
* prevent from refreshing e.g. css files which may change frequently like in | |
* Elemetor. | |
* | |
* @author Motivast motivast.com |
This file contains hidden or 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 | |
/** | |
* Class provided to get category related posts published before given post | |
* | |
* @author Motivast motivast.com | |
* @copyright 2018 - present, Motivast | |
* | |
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt GPL-2.0-or-later | |
* |
This file contains hidden or 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 | |
/** | |
* Export WooCommerce orders to xml file | |
* | |
* @return void|string Return nothing or xml file | |
*/ | |
function motivast_export_xml_with_woocommerce_orders() { | |
/** | |
* Check for credentials or IP address to allow download |
This file contains hidden or 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 | |
/** | |
* Make sample fake query to show working example | |
*/ | |
function motivast_wp_query() { | |
new WP_Query(array( | |
/** | |
* This line will not modify your query but we can use it to |
This file contains hidden or 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 | |
/** | |
* Require basic authentication for all pages except home page | |
* | |
* @return void | |
*/ | |
function motivast_require_auth() { | |
define('AUTH_USER', 'admin'); |
This file contains hidden or 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 | |
/** | |
* Provide custom download link for password protected files | |
*/ | |
/** | |
* This probably should not be constant but for sake of example | |
* leave it like this; | |
*/ |
This file contains hidden or 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 | |
/** | |
* Sanitize filename to not brake links with UTF-8 characters | |
* | |
* WordPress allow to upload files with names containing UTF-8 characters. Some | |
* browsers do not handle properly UTF-8 characters in url which causes 404 errors. | |
* This filter will remove UTF-8 characters from filename before saving it. | |
* | |
* @see https://core.trac.wordpress.org/ticket/22363 Bug request | |
* |
NewerOlder