Static site generators.
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
/** | |
* Add Photographer Name and URL fields to media uploader | |
* | |
* @param $form_fields array, fields to include in attachment form | |
* @param $post object, attachment record in database | |
* @return $form_fields, modified form fields | |
*/ | |
function be_attachment_field_credit( $form_fields, $post ) { | |
$form_fields['be-photographer-name'] = 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
//difine default theme | |
define( 'WP_DEFAULT_THEME', 'default-theme-folder-name' ); | |
//diable autoupdate | |
define( 'AUTOMATIC_UPDATER_DISABLED', true ); | |
//only disable core updates | |
define( 'WP_AUTO_UPDATE_CORE', false ) | |
//enable trash for media |
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
//source: https://www.cloudways.com/blog/how-to-edit-delete-fields-and-email-in-woocommerce-custom-checkout-fields/ | |
//remove first name and last name. | |
function woocommerce_remove_additional_information_checkout($fields){ | |
unset( $fields["billing_first_name"] ); | |
unset( $fields["billing_last_name"] ); | |
return $fields; | |
} | |
add_filter( 'woocommerce_billing_fields', 'woocommerce_remove_additional_information_checkout' ); |
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
add_filter( 'allowed_block_types', 'misha_allowed_block_types', 10, 2 ); | |
function misha_allowed_block_types( $allowed_blocks, $post ) { | |
$allowed_blocks = array( | |
'core/image', | |
'core/paragraph', | |
'core/heading', | |
'core/list' | |
); |
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
add_filter( 'woocommerce_available_payment_gateways', 'rudr_gateway_by_country' ); | |
function rudr_gateway_by_country( $gateways ) { | |
if( is_admin() ) { | |
return $gateways; | |
} | |
if( is_wc_endpoint_url( 'order-pay' ) ) { // Pay for order page |
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
add_filter( 'gettext', 'maxpapi_translate_woocommerce_strings', 999, 3 ); | |
function maxpapi_translate_woocommerce_strings( $translated, $untranslated, $domain ) { | |
if ( ! is_admin() && 'woocommerce' === $domain ) { | |
switch ( $translated ) { | |
case 'Weight': | |
$translated = 'Shipping Weight'; | |
break; | |
case 'Dimensions': | |
$translated = 'Shipping Dimensions'; | |
break; |
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
billing_wcj_checkout_field_1 | |
<?php | |
add_action('woocommerce_after_checkout_form', function($checkout){ | |
?> | |
<script type="text/javascript"> | |
jQuery(function($){ | |
$(document).on('change','#billing_wcj_checkout_field_1',function(){ | |
$(document.body).trigger("update_checkout"); |
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
function disable_unnecessary_notification( $value ) { | |
if ( isset( $value ) && is_object( $value ) ) { | |
unset( $value->response['Impreza'] ); | |
} | |
return $value; | |
} | |
add_filter( 'site_transient_update_themes', 'disable_unnecessary_notification' ); | |
function filter_plugin_updates( $value ) { | |
unset( $value->response['facetwp/index.php'] ); |
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
//https://css-tricks.com/how-to-write-loops-with-preprocessors/ | |
//for | |
@for $i from 1 through 15 { | |
div { | |
&:nth-child(#{$i}) { | |
&::after { | |
content: "#{$i}"; | |
} | |
} |