This file contains hidden or 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
| #!/bin/bash | |
| # Configuration variables - replace with your values | |
| REMOTE_HOST="username@ip.address" | |
| REMOTE_PATH="files" | |
| LOCAL_PATH="wp-content" | |
| # Database name | |
| TIMESTAMP=$(date +%Y%m%d_%H%M%S) | |
| DB_BACKUP="wp_backup_${TIMESTAMP}.sql" |
This file contains hidden or 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 | |
| define("WPE_JSON_TRANSIENT_NAME", "wpe_dummyjson"); | |
| define("WPE_JSON_TRANSIENT_TTL", 60); | |
| define("WPE_JSON_ENDPOINT_BASE", "https://dummyjson.com/"); | |
| /** Add query type to dropdown */ | |
| add_filter("bricks/setup/control_options", function ($control_options) { | |
| // Add a new query loop type | |
| $control_options["queryTypes"]["wpe_json"] = esc_html__( | |
| "DummyJSON", |
This file contains hidden or 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
| /** | |
| * Adds "failed" status to Action Scheduler cleanup action. | |
| * | |
| * Default is "complete" and "canceled," leaving "failed" actions | |
| * in the Action Scheduler to pile up indefinitely. | |
| * | |
| * Filter located in action-scheduler/classes/ActionScheduler_QueueCleaner.php | |
| * | |
| * @see https://wpcodebook.com/woocommerce-action-scheduler-cleanup-php/ | |
| */ |
This file contains hidden or 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 woo_field($property) { | |
| $date_format = 'd - M - Y'; // Format Date | |
| $info = null; | |
| if (!in_array($property, ['cart_product_ids', 'cart_total_items', 'cart_total_price'])) { | |
| global $product; | |
| if (!$product) { | |
| $product = wc_get_product(get_the_ID()); | |
| } |
This file contains hidden or 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
| /** | |
| * @snippet Expend WooCommerce Shipping Row in Cart and Checkout | |
| */ | |
| add_action( 'wp_footer', 'expend_shipping_row_jscript', 9999 ); | |
| function expend_shipping_row_jscript() { | |
| if ( is_cart() || is_checkout() && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ) { | |
| ?> | |
| <script type="text/javascript"> |
This file contains hidden or 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
| # put this file your ROOT of share folder. | |
| ## comments below are tips or examples | |
| # # a regular file (put both) | |
| # test-file | |
| # **/test-file | |
| # | |
| # # a dir (put both) | |
| # test-dir/ | |
| # **/test-dir/ | |
| # |
This file contains hidden or 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 | |
| /** | |
| * Disable WooCommerce block styles (front-end). | |
| */ | |
| function slug_disable_woocommerce_block_styles() { | |
| if( function_exists( 'is_woocommerce') ) { | |
| if( !is_woocommerce() && !is_cart() && !is_checkout() ) { | |
| wp_dequeue_style( 'wc-block-style' ); | |
| wp_dequeue_style( 'wp-block-library' ); | |
| wp_dequeue_style( 'woocommerce-layout' ); |
This file contains hidden or 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 | |
| /** | |
| * A Hack to generate mock WP Post objects from any arbitrary array | |
| * A possible use case is to render a list of taxonomy terms using Oxygen Builder's repeater element, | |
| * as the repeater allows only WP_Query as a source of data | |
| * | |
| * @author: Gagan S Goraya | |
| * @link: https://gagangoraya.com | |
| * |
This file contains hidden or 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 | |
| /** | |
| * Put this into your functions.php of your child-theme or custom plugin | |
| * you can create the role with wp-cli by running `wp shell` and running the command: | |
| * add_role('merchant','Merchant',array('read' => true, 'delete_posts' => false) ); | |
| */ | |
| /** | |
| * Step #1: create the field used to store the new sale_price for product_variation and for products | |
| */ |
NewerOlder