/** * Add support for Product Expiry for WooCommerce Plugin */ if ( class_exists( ‘WOO_Product_Expiry’) ){ /** * Add fields to the product edit form under prices */ function wcv_pefwc_add_fields( $post_id ){ // Expiry date field. $expiry_date = get_post_meta( $post_id,…Continue reading
/** * Production Snippet: FluentCRM + WooCommerce Multiple Addresses * – Adds an “Addresses” tab to FluentCRM contact view * – Shows all billing and shipping addresses for the user * – Integrates with WooCommerce Multiple Addresses Pro plugin */…Continue reading
// filepath: Add this snippet in WP Code Snippets function custom_login_styles() { echo ‘ ‘; } add_action(‘login_head’, ‘custom_login_styles’);Continue reading
// filepath: functions.php // Hook into ACF to dynamically populate the ‘vestiging’ select field for Medewerkers add_filter(‘acf/load_field/name=vestiging’, ‘populate_vestiging_field_for_medewerkers’); function populate_vestiging_field_for_medewerkers($field) { // Reset choices $field[‘choices’] = []; // Query the ‘Vestigingen’ custom post type $vestigingen = get_posts([ ‘post_type’ => ‘vestigingen’,…Continue reading
// Hook into ACF to dynamically populate the ‘vestiging’ select field add_filter(‘acf/load_field/name=vestiging’, ‘populate_vestiging_field’); function populate_vestiging_field($field) { // Reset choices $field[‘choices’] = []; // Query the ‘Vestigingen’ custom post type $vestigingen = get_posts([ ‘post_type’ => ‘vestigingen’, // Custom post type slug…Continue reading
/** * Author: Sumaiya * Clickup Doc: https://app.clickup.com/36636088/v/dc/12y1dr-22535/12y1dr-11295 * Calculate Reading time for the content * * @param string $content * @return int */ function calculate_reading_time( $content ) { $word_count = str_word_count( strip_tags( $content ) ); $reading_speed = 200; //…Continue reading
/** * Add Sortable Post ID Column Before Author in Admin List View */ function add_sortable_post_id_before_author_column($columns) { $new_columns = array(); foreach ($columns as $key => $value) { if ($key === ‘author’) { $new_columns[‘post_id’] = ‘ID’; } $new_columns[$key] = $value; }…Continue reading
/** * Availability Date Functionality * * Adds a custom availability date field to WooCommerce products and variations, * and includes it in product feeds with proper formatting. */ if (!defined(‘ABSPATH’)) { exit; } /** * Format availability date to…Continue reading
/* Enqueue Child Theme style.css to editor */ add_filter(‘block_editor_settings_all’, function($editor_settings) { // Get the URL of the child theme’s style.css $child_theme_style_url = get_stylesheet_directory_uri() . ‘/style.css’; $editor_settings[‘styles’][] = array(‘css’ => wp_remote_get($child_theme_style_url)[‘body’]); return $editor_settings; }); /* Eunqueue Customizer CSS to editor */…Continue reading