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 | |
/** | |
* Automatically login a single WordPress user upon arrival to a specific page. | |
* | |
* Redirect to home page once logged in and prevent viewing of the login page. | |
* Compatible with WordPress 3.9.1+ | |
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead." | |
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 1. | |
* |
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
/** | |
* Executes an OPTIMIZE TABLE statement on all WordPress database | |
* tables. | |
*/ | |
public static function saotn_wpdb_optimizer() { | |
global $wpdb; | |
$tables = $wpdb->get_col( "SHOW TABLES" ); | |
foreach ( $tables as $table ) { | |
$wpdb->query( "OPTIMIZE TABLE $table" ); | |
} |
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
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Add React in One Minute</title> | |
</head> | |
<body> | |
<h2>Add React in One Minute</h2> | |
<p>This page demonstrates using React with no build tooling.</p> |
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
/** | |
* https://docs.elementor.com/article/286-speed-up-a-slow-site | |
* | |
* Note: By default, Font Awesome icons will only load on the pages where you've used them, so FA won't load on pages that aren't using any Font Awesome icons. This brings faster performance and faster page speed to your site, which can benefit your SEO and your users' experience. Only the CSS and fonts of the icon family you actually use are loaded. So only dequeue Font Awesome if you truly plan to not use any Font Awesome icons at all. If you dequeue Font Awesome, the icons will no longer show on any of your pages | |
* | |
*/ | |
// Elementor - Remove Font Awesome | |
add_action( 'elementor/frontend/after_register_styles',function() { | |
foreach( [ 'solid', 'regular', 'brands' ] as $style ) { |