/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
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
| version: '3.7' | |
| services: | |
| mysql: | |
| image: mariadb | |
| ports: | |
| - '3306' | |
| environment: | |
| MYSQL_ROOT_PASSWORD: password | |
| MYSQL_DATABASE: wordpress | |
| volumes: |
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 | |
| add_action( 'woocommerce_customer_save_address', 'jsforwp_update_address_for_orders', 10, 2 ); | |
| function jsforwp_update_address_for_orders( $user_id ) { | |
| $customer_meta = get_user_meta( $user_id ); | |
| $customer_orders = get_posts( array( | |
| 'numberposts' => -1, | |
| 'meta_key' => '_customer_user', |
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
| $url = 'https://www.youtube.com/watch?v=08f0tiLdk7w'; //a youtube video url | |
| $autoembed = new WP_Embed(); //initialize the wordpress oEmbed helper class | |
| $content = $autoembed->autoembed($url); //let's parse the url and get the embeded content |
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 | |
| /** | |
| * WooCommerce template overriding class | |
| * | |
| * @author obiPlabon | |
| */ | |
| class WC_Template_Override { | |
| /** |
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 | |
| // enqueue these scripts and styles before admin_head | |
| wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though... | |
| wp_enqueue_style( 'wp-jquery-ui-dialog' ); | |
| ?> | |
| <!-- The modal / dialog box, hidden somewhere near the footer --> | |
| <div id="my-dialog" class="hidden" style="max-width:800px"> | |
| <h3>Dialog content</h3> | |
| <p>This is some terribly exciting content inside this dialog. Don't you agree?</p> |
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
| $wp_customize->add_setting( 'themeslug_media_setting_id', array( | |
| 'sanitize_callback' => 'absint', | |
| 'validate_callback' => 'themeslug_validate_image, | |
| ) ); | |
| $wp_customize->add_control( | |
| new WP_Customize_Media_Control( $wp_customize, 'themeslug_media_setting_id', array( | |
| 'label' => __( 'Custom Core Media Setting' ), | |
| 'section' => 'custom_section', // Add a default or your own section | |
| 'mime_type' => 'image', |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
NewerOlder