// set up
View::$view_dir = '/some/path';
// echos the view
View::render('relative/template', [
'var1' => 'data',
'var2' => 'more data'
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
{ | |
"name": "page_metadata", | |
"relationship": "page", | |
"columns": [ | |
"show_page_banner", | |
"page_layout", | |
"read_time" | |
] | |
} |
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
{ | |
"name": "user_metadata", | |
"relationship": "user", | |
"columns": [ | |
"profession", | |
"age", | |
"sex", | |
"is_member", | |
"instagram_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 | |
/* | |
* 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'); | |
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
{ | |
"name": "{custom_database_table_name}", | |
"relationship": "{post_type}", | |
"columns": [ | |
"{acf_field_name_1}", | |
"{acf_field_name_1}", | |
"{acf_field_name_3}" | |
] | |
} |
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 | |
/** | |
* Really simple GET request | |
*/ | |
add_action( 'rest_api_init', function ( WP_REST_Server $wp_rest_server ) { | |
register_rest_route( '/custom-namespace/v1', '/no-param', [ | |
'methods' => 'GET', | |
'callback' => function ( WP_REST_Request $request ) { | |
if ( $throw_error = false ) { |
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 | |
use ACFCustomDatabaseTables\Intercept\ACFGetFieldIntercept; | |
use ACFCustomDatabaseTables\Vendor\Pimple\Container; | |
/** | |
* Class ACFCDTvOneDotZeroDotAnyGetFieldInterceptBypass | |
* | |
* This provides a 'hotfixed' approach for disabling custom database table intercept when using ACF's get_field() | |
* function. This will only work with version 1.0.x versions of the plugin as a built-in tool will be available in |
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
.m-0-first-last > :first-child { | |
margin-top: 0; | |
} | |
.m-0-first-last > :last-child { | |
margin-bottom: 0; | |
} | |
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 | |
/** | |
* Locates an ACF sub-field by field name and returns the sub-field's key. | |
* | |
* This is particularly useful if you need to construct a data array for programmatic field | |
* update where a complex field is in use (e.g; repeater, group, flexi). | |
* | |
* @param string $sub_field_name The sub field name we need a key for. | |
* @param array $field The ACF field array. |
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 | |
// Set the form key you wish to target | |
$form_key = 'form_5d97cf9edc0a8'; | |
add_action( "af/email/before_send/key=$form_key", function ( $email, $form ) { | |
add_filter( 'wp_mail', function ( $data ) use ( $email ) { | |
// you can override any items in this array to customise the email that is sent... |