View form-checkout.php
<?php | |
/** | |
* Checkout Form | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
View wp_add_modified_date_column.php
<?php | |
// Register Modified Date Column for both posts & pages | |
function modified_column_register( $columns ) { | |
$columns['Modified'] = __( 'Modified Date', 'show_modified_date_in_admin_lists' ); | |
return $columns; | |
} | |
add_filter( 'manage_posts_columns', 'modified_column_register' ); | |
add_filter( 'manage_pages_columns', 'modified_column_register' ); | |
function modified_column_display( $column_name, $post_id ) { |
View categories_with_childs.php
<?php | |
add_filter( 'woocommerce_gpf_elements_google', function ( $elements, $product_id, $variation_id ) { | |
$elements['product_type'] = array_map( function ( $item ) { | |
if ( empty( $item->parent ) ) { | |
return $item->name; | |
} | |
$parent_list = array_reverse( get_ancestors( $item->term_id, 'product_cat', 'taxonomy' ) ); | |
$parent_list = array_map( function ( $term_id ) { | |
$term = get_term( $term_id, 'product_cat' ); |
View cf7_recaptcha.php
<?php | |
function my_register_cf7_js() { | |
// Dequeue cf7 and recaptcha scripts, preventing them from loading everywhere | |
add_filter( 'wpcf7_load_js', '__return_false' ); // Might as well use their filter | |
wp_dequeue_script( 'google-recaptcha' ); | |
// If current post has cf7 shortcode, enqueue! | |
global $post; | |
if ( isset( $post->post_content ) AND has_shortcode( $post->post_content, 'contact-form-7' ) ) { |
View add-content-storefront.php
<?php | |
add_action( 'storefront_header', 'ctheme_storefront_header_content', 40 ); | |
function ctheme_storefront_header_content() { | |
echo ' | |
<div class="header-usp"> | |
Gratis verzending - Voor 14 uur besteld? Volgende dag bezorgt. | |
</div>'; | |
} |
View stock_status_names.php
<?php | |
/* | |
Using this function you can use different values on the frontend while keeping the original strings or translations. | |
How to use: | |
Place the PHP code below into the functions.php file from your WordPress child theme. | |
If you like, change the strings inside the quotes for the $status variables. | |
The action hook will place the information below the add to cart button (based on the original WooCommerce template files). | |
*/ |
View functions.php
<?php | |
// place this code into you child theme's functions.php file | |
// Do you use Advanced Custom Fields? Uncomment the next row, otherwise the custom fields meta box doesn't show up in your edit post screen | |
//add_filter('acf/settings/remove_wp_meta_box', '__return_false'); | |
add_action( 'init', 'fws_elementor_submissions_post_type' ); | |
function fws_elementor_submissions_post_type() { | |
$args = array( | |
'public' => false, |
View check_fix_url.php
<?php | |
function check_url($url) { | |
if (substr($url, 0, 4) != 'http') { | |
$url = 'http://'.$url; | |
} | |
$response = get_headers($url); | |
if ($response[0] == 'HTTP/1.1 200 OK') { | |
return $url; | |
} elseif (in_array(substr($response[0], 9, 3), array(302, 301))) { | |
foreach ($response as $r) { |
View pagecache-php-example.php
<?php | |
require_once __DIR__.'/../vendor/autoload.php'; | |
try { | |
$cache = new PageCache\PageCache(); | |
$cache->config() | |
->setCachePath('/your/cache_path/') | |
->setEnableLog(true) | |
->setCacheExpirationInSeconds(86400); | |
$cache->init(); | |
} catch (\Exception $e) { |
View download-example.php
<?php | |
echo ' | |
<a href="http://mydomain.com/download.php?download_file=some_file.pdf">PHP download file</a>'; |
NewerOlder