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 PostTypeTaxonomyMirror { | |
private $post_type; | |
private $taxonomy; | |
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 | |
// e.g; 'mydomain.com' | |
$current_host = $_SERVER['HTTP_HOST']; | |
// This will return a WPLK_Domain object, if the domain can be found. Otherwise, NULL. | |
$domain = wplk_get_domain( ); | |
if($domain){ | |
$domain_id = $domain->post_id(); |
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
SELECT * FROM some_table_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
<?php | |
add_action( 'acf/save_post', function ( $post_id ) { | |
global $wpdb; | |
// Get the meta ID from the custom DB table. | |
$table_name = 'my_custom_db_table'; | |
$meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM {$wpdb->prefix}{$table_name} WHERE `post_id` = %d", $post_id ) ); | |
// Choose a prefix format. |
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( 'af/field/prefill_value', 'prefill_form_field', 10, 4 ); | |
/** | |
* @param mixed $value | |
* @param array $field | |
* @param array $form | |
* @param array $args | |
* |
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( 'af/form/args', 'afp_demo_support_dynamic_user_editing', 10, 2 ); | |
/** | |
* @param array $args | |
* @param array $form | |
* | |
* @return array | |
*/ |
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 | |
$post_type = 'my-post-type'; | |
add_filter( 'manage_' . $post_type . '_posts_columns', function ( $defaults ) { | |
$defaults['custom-one'] = 'One'; | |
$defaults['custom-two'] = 'Two'; | |
return $defaults; | |
} ); |
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( 'acfcdt/filter_value_before_update', 'xyz_filter_repeater_value_before_insert', 10, 3 ); | |
/** | |
* @param mixed $value The field value being stored. | |
* @param string $selector Either the post ID or a compound ACF selector depending on the object type. e.g; user_1. | |
* @param array $field_array The ACF field array. | |
* | |
* @return mixed |
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
<div class="PostsGrid"> | |
<!-- This is our div containing our post items --> | |
<div class="PostsGrid__posts"> | |
<a href="#" class="PostsGrid__post"><!-- …Post grid item here… --></a> | |
<a href="#" class="PostsGrid__post"><!-- …Post grid item here… --></a> | |
<a href="#" class="PostsGrid__post"><!-- …Post grid item here… --></a> | |
</div> | |
<!-- A button to load more posts --> |
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 ResponsiveOEmbeds { | |
/** | |
* Regex patterns for matching specific embeddable URLs | |
* | |
* @var array | |
*/ |