40 Cheatsheets for WordPress Design & Development

While WordPress is known for making content management rather simple, the depth of this CMS is surprisingly vast. There are multiple facets to discover, but you can learn about them on an as-needed basis. For example, if you’re goal is to just input and edit content, you probably won’t need to learn about theme development. … Read more40 Cheatsheets for WordPress Design & Development

print_r(), var_dump(), and echo

I don’t use print_r() exclusively to inspect variables: two other methods, var_dump() and echo, can work similarly. echo, the main PHP function that prints things out to the page, can be used to inspect variables. However, it only works on strings and things that can be easily cast to strings, like integers. If you try to echo an array, you get just Array, … Read moreprint_r(), var_dump(), and echo

Adding CC# Checkout Field

/** * @snippet Add Custom Field @ WooCommerce Checkout Page * @how-to Get CustomizeWoo.com FREE * @author Rodolfo Melogli * @testedwith WooCommerce 3.8 * @donate $9 https://businessbloomer.com/bloomer-armada/ */ add_action( ‘woocommerce_after_checkout_billing_form’, ‘bbloomer_add_custom_ccno_checkout_field’ ); function bbloomer_add_custom_ccno_checkout_field( $checkout ) { $current_user = wp_get_current_user(); $saved_creditcard_no = $current_user->creditcard_no; woocommerce_form_field( ‘creditcard_no’, array( ‘type’ => ‘text’, ‘class’ => array( ‘form-row-wide’ ), ‘label’ … Read moreAdding CC# Checkout Field

Add payment type dropdown to checkout form

  // Add a new checkout field add_filter( ‘woocommerce_checkout_fields’, ‘kia_filter_checkout_fields’ ); function kia_filter_checkout_fields($fields){ $fields[‘extra_fields’] = array( ‘payment_type’ => array( ‘type’ => ‘select’, ‘class’ => array( ‘form-row-first’ ), ‘options’ => array( ” => __( ‘Please select’ ), ‘Credit Card’ => __( ‘Credit Card’ ), ‘Net 30’ => __( ‘Net 30’ ) ), ‘required’ => true, ‘default’ … Read moreAdd payment type dropdown to checkout form

Add a surcharge to cart and checkout – uses fees API

This is a Developer level doc. If you are unfamiliar with code/templates, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our  Support Policy. Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your … Read moreAdd a surcharge to cart and checkout – uses fees API

Remove product content based on category

This is a Developer level doc. If you are unfamiliar with code and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our  Support Policy. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding … Read moreRemove product content based on category

Notify Admin When New Account Is Created

This is a Developer level doc. If you are unfamiliar with code and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our  Support Policy. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding … Read moreNotify Admin When New Account Is Created