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
# Optimized my.cnf configuration for MySQL/MariaSQL | |
# | |
# by Fotis Evangelou, developer of Engintron (engintron.com) | |
# | |
# ~ Updated January 2020 ~ | |
# | |
# | |
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores. | |
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
# |
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
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
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
function custom_query_shortcode($atts) { | |
// EXAMPLE USAGE: | |
// [loop the_query="showposts=100&post_type=page&post_parent=453"] | |
// Defaults | |
extract(shortcode_atts(array( | |
"the_query" => '' | |
), $atts)); |
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
Regular expression cheat sheet for Varnish | |
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX | |
regular expressions, for a complete guide, see: "man 7 regex" | |
Basic matching: | |
req.url ~ "searchterm" | |
True if req.url contains "searchterm" anywhere. | |
req.url == "searchterm" |
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
jQuery(document).ready(function($){ | |
// Execute after NF is loaded. | |
$(document).on( 'nfFormReady', function( e, layoutView ) { | |
nfRadio.channel( 'nfMP' ).on( 'change:part', function($) { | |
console.log('Part 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 | |
/** | |
* ajax-handler.php | |
* | |
* This mu-plugin is loaded before any other plugin code. | |
* It attempts to recognize some API-ish calls (i.e. | |
* traditional admin-ajax.php, wc-ajax and hopefully some | |
* wp-json/wp-api things at a later stadium. | |
* |
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 | |
/** | |
* The Template for displaying all single posts. | |
* | |
*/ | |
get_header(); ?> | |
<div id="main"> | |
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
public function ijsje_single_template($single) { | |
global $post; | |
/* Checks for single template by post type */ | |
if ( $post->post_type == 'ijsjes' ) { | |
if ( file_exists( plugin_dir_path( __FILE__ ) . 'partials/single-ijsje.php' ) ) { | |
return plugin_dir_path( __FILE__ ) . 'partials/single-ijsje.php'; | |
} | |
} |
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
private function define_public_hooks() { | |
$plugin_public = new Ijsjes_Public( $this->get_plugin_name(), $this->get_version() ); | |
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); | |
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); | |
$this->loader->add_filter( 'single_template', $plugin_public, 'ijsje_single_template' ); | |
} |
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
private function define_admin_hooks() { | |
$plugin_admin = new Ijsjes_Admin( $this->get_plugin_name(), $this->get_version() ); | |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); | |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); | |
$this->loader->add_action( 'init', $plugin_admin, 'register_ijsjes_post_type' ); | |
} |
NewerOlder