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 | |
function my_custom_gutenberg_block_enqueue_scripts(){ | |
// Required thing to build Gutenberg Blocks | |
$required_js_files = array( | |
'wp-blocks', | |
'wp-i18n', | |
'wp-element', | |
'wp-editor' | |
); |
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 my_custom_field_links_for_postgrid( $permalink, $grid_post_id, $brick_id ){ | |
global $wp_query; | |
//If this page is the page with the postgrid on it | |
if ( $brick_id == '31981' ){ | |
$site_link = get_post_meta( $grid_post_id, 'your_custom_field_slug', true ); | |
//If there is a site link |
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 pj_debug_to_txt_file( $debug_value, $filename, $append = true ){ | |
$upload_dir = wp_upload_dir(); | |
$filename = trailingslashit( $upload_dir['basedir'] ) . $filename . '.txt'; | |
if ( false === $append ) { | |
// Blank out the log file if needed | |
@file_put_contents( $filename, '' ); | |
@chmod( $filename, 0664 ); | |
} |
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 pw_send_subscription_cancelled_to_admin( $sub_id, $subscription ) { | |
$email_to = '[email protected]'; | |
$subject = 'Subscription Cancelled'; | |
$message = 'Subscription cancelled for ' . $subscription->customer->email; | |
EDD()->emails->send( $email_to, $subject, $message ); | |
} | |
add_action( 'edd_subscription_cancelled', 'pw_send_subscription_cancelled_to_admin', 10, 2 ); | |
function pw_send_subscription_failed_to_admin( $subscription ) { | |
$email_to = '[email protected]'; |
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 my_custom_mp_stacks_password_message(){ | |
return 'Your Custom Message Here'; | |
} | |
add_filter( 'mp_stacks_password_message', 'my_custom_mp_stacks_password_message' ); |
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 my_custom_postgrid_isotope_taxonomies( $isotope_filter_groups ){ | |
//This array can contain custom groups (for outside sources like instgram), AND/OR WordPress taxonomy slugs. | |
$isotope_filter_groups = array( | |
'taxonomy1_slug' => array( | |
'is_wordpress_taxonomy' => true, | |
'filter_group_name' => __( 'Name of Taxonomy1', 'mp_stacks_postgrid' ), | |
'meta_field_ids_representing_tax_term' => array(), //Leave this blank if it is a WordPress taxonomy (as opposed to a "fake" one like "twitter-user") | |
//Icon info | |
'default_icon_font_string' => 'fa-th-large', //A default icon-font class string to use if no unique icon is given |
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 | |
/** | |
* Check if the current user has a valid license for the $download_id passed-in. | |
* | |
* @param array ( 'download' => Download/Item ID (post_id), 'price_id' => Price ID ) | |
* @return bool true/false | |
*/ | |
function edd_sl_current_user_has_valid_license_for( $download_ids ){ | |
// Get the current user 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
<?php | |
//Paste this function into your theme's functions.php file to create a duplicate ctc_sermon for each old sermon | |
function mp_migrate_ezekiel_sermons(){ | |
if ( !isset( $_GET['duplicate_sermons'] ) ){ | |
return; | |
} | |
//Set the args for the new query | |
$cpt_sermons = 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
$( '.mp-stacks-grid-isotope' ).imagesLoaded( function( instance ){ | |
$( '[data-filter="[mp_stacks_grid_isotope_taxonomy_category*=\'YOUR_FILTER_SLUG_HERE,\']"' ).trigger( 'click' ); | |
}); |