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
add_filter('upload_size_limit', 'mups_upload_max_increase_upload'); | |
function mups_upload_max_increase_upload() { | |
// Only enter the numeric value in bytes (eg. 104857600) | |
// 1024 bytes = 1KB | |
// 1048576 bytes = 1MB | |
// (Formula: 1048576 * number of MB required = number of Bytes to enter in above form) | |
return '3145728000'; | |
} |
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 | |
if($_SERVER["REMOTE_ADDR"]=='111.111.111.111') | |
{ | |
//run only my ip | |
} | |
?> |
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
// Source: https://www.elegantthemes.com/blog/tips-tricks/using-the-wordpress-debug-log | |
// Usage example: write_log('The variable value is: ' . $myVariable); | |
if ( ! function_exists('write_log')) { | |
function write_log ( $log ) { | |
if ( is_array( $log ) || is_object( $log ) ) { | |
error_log( print_r( $log, true ) ); | |
} else { | |
error_log( $log ); | |
} | |
} |
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
-- Shoutout to https://blog.templatetoaster.com/update-old-urls-in-database/ | |
UPDATE wp_options SET option_value = replace(option_value, 'Existing URL', 'New URL') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET post_content = replace(post_content, 'Existing URL', 'New URL'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'Existing URL','New URL'); | |
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'Existing URL','New URL'); | |
UPDATE wp_links SET link_url = replace(link_url, 'Existing URL','New URL'); |
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 | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Flysystem; | |
use League\Flysystem\Filesystem; | |
use League\Flysystem\Sftp\SftpAdapter; | |
class PagesController extends Controller |
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
RewriteEngine On | |
RewriteBase / | |
# Test domain rewrite rules | |
RewriteCond %{HTTP_HOST} ^(www\.)?testdomain.ca [NC] | |
RewriteRule ^about-us/core-values$ partnership/ [R=301,NC,L] | |
RewriteCond %{HTTP_HOST} ^(www\.)?testdomain.ca [NC] | |
RewriteRule ^about-us/core-values/$ partnership/ [R=301,NC,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
function add_theme_scripts() { | |
clearstatcache(); | |
wp_enqueue_style( 'style', get_stylesheet_uri() ); | |
wp_enqueue_style( 'slider', get_template_directory_uri() . '/css/slider.css', array(), filemtime( get_template_directory() . '/css/slider.css'), 'all'); | |
wp_enqueue_script( 'script', get_template_directory_uri() . '/js/script.js', array ( 'jquery' ), filemtime( get_template_directory() . '/js/script.js'), true); | |
} |
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
$featuredPostOneArgs = array( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
'meta_query' => array( | |
array( | |
'key' => 'homepage_featured_article_1', | |
'value' => '1', | |
'compare' => '==' | |
) | |
) |
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
/* | |
* Takes in a new element to be saved, grabs the data array, appends to it, and re-saves it | |
*/ | |
function saveData( $dataItem ) { | |
$dataArray = summonData(); | |
array_push($dataArray, $dataItem); | |
file_put_contents('./records.json', json_encode($dataArray)); // Overwrites the JSON file | |
chmod('./records.json', 0664); | |
} |
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
function writeLog($item){ | |
ob_flush(); | |
ob_start(); | |
var_dump($item); | |
file_put_contents('debuglog.txt', ob_get_flush()); | |
chmod('debuglog.txt', 0664); | |
} |
OlderNewer