Skip to content

Instantly share code, notes, and snippets.

Phil Kurth mishterk

Block or report user

Report or block mishterk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mishterk
mishterk / example-table-definition-for-post-post-type.json
Created Feb 20, 2018
ACF Custom Database Tables plugin: Table definition JSON example for post type of 'post'
View example-table-definition-for-post-post-type.json
{
"name": "post_metadata",
"columns": [
"post_layout",
"read_time",
"show_stats"
]
}
@mishterk
mishterk / example-table-definition-structure.json
Last active May 27, 2018
ACF Custom Database Tables plugin: Table definition JSON structure
View example-table-definition-structure.json
{
"name": "{custom_database_table_name}",
"relationship": "{post_type}",
"columns": [
"{acf_field_name_1}",
"{acf_field_name_1}",
"{acf_field_name_3}"
]
}
@mishterk
mishterk / example-bypassing-core-tables.php
Last active Feb 20, 2018
ACF Custom Database Tables plugin: Bypassing core meta tables example.
View example-bypassing-core-tables.php
<?php
/*
* This will prevent data from being stored in WordPress' core meta tables where a custom database table has been set up instead.
* This will not affect meta data that does not have a custom database table – that meta data will be stored as usual.
*/
add_filter('acfcdt/settings/bypass_post_meta_table', '__return_true');
@mishterk
mishterk / working-with-js.js
Last active Feb 7, 2018
iFrames: tricks, reference, etc
View working-with-js.js
// create the iFrame
var iFrame = document.createElement('iframe');
// set iFrame's source
iFrame.src = "javascript:false"; // add some URL here
// inject iFrame into current (parent) doc before first script tag
var where = document.getElementsByTagName('script')[0];
where.parentNode.insertBefore(iFrame, where);
View MagnificPopupModal.vue
<template>
<div class="Modal mfp-hide" ref="modal">
<div class="Modal__inner">
<slot></slot>
</div>
</div>
</template>
@mishterk
mishterk / book-cpt-test.json
Created Jan 14, 2018
Some test data. Throw the CPT registration in functions.php
View book-cpt-test.json
{
"name": "books",
"relationship": {
"type": "post",
"post_type": "book"
},
"columns": [
{
"name": "author",
"acf_field_name": "author"
@mishterk
mishterk / generated-style.css
Last active Sep 29, 2017
BEM style example
View generated-style.css
.Post{}
.Post__title{}
.Post__content{}
.Post--is-highlighted .Post__title{} // now we are using the cascade to override styling when that block is at a particular state
@mishterk
mishterk / implementation.php
Created Mar 7, 2017
Simple examples of static class methods and name-spaced functions
View implementation.php
<?php
include 'utility-class.php';
include 'utility-functions.php';
// using a static class method
$processed = UtilityClass::methodOne( 'some data' );
@mishterk
mishterk / class-disable-comments.php
Last active Feb 1, 2017
A static class that basically removes all (I think) comment related functionality in WordPress
View class-disable-comments.php
<?php
namespace PhilKurth\WP\Tools;
@mishterk
mishterk / interpolation-example.php
Last active Jan 30, 2017
A quick example of interpolation in PHP (for Ben)...
View interpolation-example.php
<?php
// Quick PHP interpolation example...
class Person {
public $name = '';
public function getName()
{
You can’t perform that action at this time.