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 | |
// Place this code into the functions.php file or your WordPress child theme | |
add_action('wpcf7_mail_sent', 'fw_wpcf7_subscribe_to_eo4wp' ); | |
function fw_wpcf7_subscribe_to_eo4wp( $contact_form ){ | |
// get form id | |
$form_id = $contact_form->id(); | |
// get submission data | |
$submission = WPCF7_Submission::get_instance(); |
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 | |
add_action( 'phpmailer_init', 'fw_prepare_email' ); | |
function fw_prepare_email( $phpmailer ) { | |
$host = get_option('fw_tools_smtp_host'); | |
$port = get_option('fw_tools_smtp_port'); | |
$login = get_option('fw_tools_smtp_login'); | |
$password = get_option('fw_tools_smtp_password'); | |
$from = get_option('fw_tools_from_address'); |
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 | |
// place the code below into the functions.php file from your WordPress child theme | |
// disable core update notifications | |
add_filter( 'auto_core_update_send_email', 'fws_stop_auto_update_emails', 10, 4 ); | |
function fws_stop_update_emails( $send, $type, $core_update, $result ) { | |
if ( ! empty( $type ) && $type == 'success' ) { | |
return 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 | |
// place this code into the functions.php file from your child theme | |
// Show date info on a single event page | |
add_shortcode('fw_eo_date_time', function($atts) { | |
$atts = shortcode_atts( array( | |
'timelabel' => __('Time', 'eventorganiser'), | |
'to' => '-', | |
'prefix' => '' |
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 | |
add_action('wp_head', 'fws_create_organisatie_data'); | |
function fws_create_organisatie_data() { | |
$data = array( | |
'@context' => 'https://schema.org', | |
'@type' => 'Organization', | |
'name' => 'Bedrijfsnaam', | |
'legalName' => 'Volledig bedrijfsnaam', | |
'url' => 'https://www.website.nl/', |
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 | |
// add this code to the functions.php file from your chilc theme | |
add_action('wp_dashboard_setup', 'fws_remove_dashboard_widgets', 100); | |
function fws_remove_dashboard_widgets(){ | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); // Quick draft | |
remove_meta_box('dashboard_primary', 'dashboard', 'side'); // WordPress Events and News | |
remove_meta_box('dashboard_activity', 'dashboard', 'side'); // Activity | |
remove_meta_box('dashboard_site_health', 'dashboard', 'side'); //Site Health Status |
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 | |
// Plaats deze code in het functions.php bestand van je WordPress Child Theme | |
add_action( 'add_attachment', 'fws_set_image_alt_after_upload' ); | |
function fws_set_image_alt_after_upload( $post_ID ) { | |
if ( wp_attachment_is_image( $post_ID ) ) { | |
$post = get_post( $post_ID ); | |
update_post_meta( $post_ID, '_wp_attachment_image_alt', $post->post_title ); | |
} | |
} |
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 | |
// requirements: Bootscore + bs Swiper extension | |
remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); | |
add_action('woocommerce_after_single_product_summary', function() { | |
if (function_exists('bootscore_product_slider')) { | |
echo ' | |
<div class="related-posts mb-3"> | |
<hr> | |
<h2 class="h4 text-center my-4">'.apply_filters('bootscore/bs-swiper/related-posts/heading', __('You might also like', 'bootscore')).'</h2>'; |
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 | |
// check the information in the comments | |
add_action( 'before_delete_post', 'fws_delete_images_for_product', 99, 2 ); | |
function fws_delete_images_for_product( $postid, $post ) { | |
if ( 'product' !== $post->post_type ) { | |
return; | |
} | |
$img_ids = 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 | |
$msg = ''; | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
$data = json_decode(file_get_contents('php://input'), true); | |
parse_str($_SERVER['QUERY_STRING'], $qs_array); |
NewerOlder