We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 9 columns, instead of 6 in line 4.
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
timestamp,method,host,url,ip,referer,user_agent,http_status,cache_status | |
2021-07-07 21:15:16 UTC,POST,www.ourdomain.com,/wp-cron.php?doing_wp_cron=1625692516.2409739494323730468750,34.135.50.59,https://www.ourdomain.com/wp-cron.php?doing_wp_cron=1625692516.2409739494323730468750,WordPress/5.7.2; https://www.ourdomain.com,200,PASS | |
2021-07-07 21:14:59 UTC,POST,www.ourdomain.com,/wp-cron.php?doing_wp_cron=1625692499.0113999843597412109375,34.135.50.59,https://www.ourdomain.com/wp-cron.php?doing_wp_cron=1625692499.0113999843597412109375,WordPress/5.7.2; https://www.ourdomain.com,200,PASS | |
2021-07-07 21:14:40 UTC,POST,www.ourdomain.com,/wp-cron.php?doing_wp_cron=1625692480.4495329856872558593750,34.135.50.59,https://www.ourdomain.com/wp-cron.php?doing_wp_cron=1625692480.4495329856872558593750,WordPress/5.7.2; https://www.ourdomain.com,200,PASS | |
2021-07-07 21:14:32 UTC,POST,www.ourdomain.com,/wp-cron.php?doing_wp_cron=1625692471.9752209186553955078125,34.135.50.59,https://www.ourdomain.com/wp-cron.php?doing_wp_cron=1 |
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
.required:after { | |
content: " *"; | |
font-size: .5em; | |
color: red; | |
vertical-align: super; | |
} |
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
/* Be sure to set your element queries according | |
to what you actually have in the document! */ | |
(function ($) { | |
// Bind to the resize event of the window object | |
const doResize = () => { | |
let wpadmin = 0; | |
if ($("#wpadminbar").length) { // in case WP admin bar is present | |
wpadmin = $("#wpadminbar").height(); |
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 | |
// If users have multiple roles, refactor line 7 to check for required | |
// roles instead of rejecting Subscribers | |
add_action( 'init', function () { | |
if ( is_admin() | |
&& in_array( 'subscriber', (array) $user->roles ) | |
&& ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) | |
) { wp_redirect( '/' ); exit; } |
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
// Calculate | |
(function ($) { | |
// Bind to the resize event of the window object | |
$(window) | |
.on("resize", function () { | |
let wpadmin; | |
if ($("#wpadminbar")) { // in case WP admin bar is present | |
wpadmin = $("#wpadminbar").height(); | |
} else { |
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 | |
// Show the current template in use | |
// To use, add ?show-template to URL | |
add_action('wp_head', 'show_template_filename'); | |
function show_template_filename() { | |
if ( isset($_GET['show-template']) ) { | |
global $template; | |
echo '<span style="background-color: #ooo;color: #fff;">'; |
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 | |
// Test webhook reception | |
echo "Checking for webhook"; | |
$webhookContent = ""; | |
$myfile = fopen("./webhook.log", "a") or die("Unable to open file!"); | |
$webhook = fopen('php://input' , 'rb'); | |
while (!feof($webhook)) { |
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 | |
// Hide custom taxonomy term from all queries | |
// Still accessible via direct link | |
add_action('pre_get_posts', function($query){ | |
if ( $query->is_home() || $query->is_feed() || $query->is_search() || $query->is_archive() ) { | |
$tax_query = array( | |
array( | |
'taxonomy' => 'admin_category', // taxonomy name |
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
add_shortcode('SHORTCODE', function($atts){ | |
$defaults = array(); | |
$atts = wp_parse_args( $atts, $defaults ); | |
ob_start(); | |
// Do Stuff | |
return ob_get_clean(); | |
}); |