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 | |
// This will register a custom field type as supported by the plugin. | |
// This affects table definition generation and can go in your functions.php | |
// file or a plugin. | |
add_filter( 'acfcdt/is_supported_field', function ( $is_supported, $field ) { | |
if ( $field['type'] === 'custom_acf_field_type' ) { | |
$is_supported = true; | |
} |
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 will intercept the rendered calculated field and insert the markup | |
// into an element with the id `#preview-container` | |
acf.addAction( 'af/field/calculated/value_updated', function( value, field, form ) { | |
$('#preview-container').html(value); | |
}); | |
// You may intercept the return values of specific fields by field name | |
acf.addAction( 'af/field/calculated/value_updated/name=FIELD_NAME', function( value, field, form ) { | |
// … | |
}); |
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 | |
add_filter( 'woocommerce_order_actions', function ( $actions ) { | |
// Unset whatever actions you don't need available in the | |
// WooCommerce order edit screen. | |
unset( $actions['send_order_details_admin'] ); | |
unset( $actions['send_order_details'] ); | |
unset( $actions['regenerate_download_permissions'] ); | |
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 | |
namespace WpLandingKitPlugin; | |
use WP_CLI; | |
use WP_CLI_Command; | |
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 | |
add_filter( 'acf/fields/relationship/result/name=related_posts', function ( $title, WP_Post $post, $field_arr ) { | |
$posted_at = get_post_time( 'U', false, $post->ID ); | |
$now = current_time( 'timestamp' ); | |
$diff = human_time_diff( $posted_at, $now ); | |
return $title . sprintf( ' (%s ago)', $diff ); | |
}, 10, 3 ); |
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 | |
add_filter( 'acf/load_field/name=countries', function ( $field ) { | |
$field['choices'] = [ | |
'au' => 'Australia', | |
'nz' => 'New Zealand', | |
'gb' => 'United Kingdom', | |
'us' => 'United States', | |
// … |
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 | |
get_header(); | |
?> | |
<div class="Main"> | |
<?php if ( have_posts() ): ?> | |
<?php while ( have_posts() ): ?> | |
<?php the_post(); ?> | |
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 | |
echo '<pre>'; | |
var_dump(get_defined_vars()); | |
echo '</pre>; | |
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
UPDATE wp_options SET option_value = '' WHERE option_name = 'limit_login_lockouts' LIMIT 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
<?php | |
class View { | |
public static $view_dir = ''; | |
/** | |
* Render View Template With Data |