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
/** | |
* Prevent multiple posting. | |
* | |
* @return bool | |
*/ | |
public function antiMultiPosting() { | |
/** | |
* @var $user User | |
*/ | |
$user = auth()->user(); |
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
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\wc_session\_%') | |
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%') |
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 | |
/** | |
* This snippet goes into your | |
* \app\Http\Controllers\Auth\AuthController.php | |
* | |
* Make sure to update your login view as well | |
* (\resources\views\auth\login.blade.php). Just | |
* change | |
*/ |
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 | |
/** | |
* Update Teacher capabilities | |
* (synch with Author caps) | |
* | |
* @return void | |
**************************************************/ | |
function update_teacher_caps() { | |
// get roles | |
$author = get_role('author'); |
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
# Force https on all pages | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
</IfModule> |
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
# ---------------------------------------------------------------------- | |
# | Expires headers | | |
# ---------------------------------------------------------------------- | |
# Serve resources with far-future expires headers. | |
# | |
# (!) If you don't control versioning with filename-based | |
# cache busting, you should consider lowering the cache times | |
# to something like one week. | |
# |
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 | |
/** | |
* Parse a video string | |
* | |
* @param string $haystack The string to be parsed | |
* @param string $protocol The protocol to be used for the urls | |
* @return array $video | |
* | |
* @version 2014-08-22 | |
* |