This one is a simple and handy trick when you want to copy your directories without node_modules folder.
Enter this command in your terminal.
robocopy SOURCE DEST /mir /xd node_modules| addFilter( | |
| "editor.BlockEdit", | |
| "wpdev/is-post-link", | |
| ( BlockEdit ) => { | |
| return (props) => { | |
| if (props.name !== "core/button") { | |
| return <BlockEdit {...props} />; | |
| } | |
| return ( |
| <?php | |
| class MySampleClass { | |
| use Hookable; | |
| public static function register_hooks() { | |
| static::add_action( 'wp_footer' ); | |
| static::add_filter( 'the_content', 100 ); | |
| static::add_filter( 'admin_title', 100, 2 ); |
| <?php | |
| /** | |
| * Modify /wp-json/wc/store/v1/products/<ID> so that it returns more complete data about each variation. | |
| * | |
| * Not extensively tested, just captures an idea about how we might do this. | |
| */ | |
| add_filter( 'rest_request_after_callbacks', function ( $response, $handler, $request ) { | |
| // If this is not a Store API product request, do not interfere. | |
| if ( ! str_starts_with( $request->get_route(), '/wc/store/v1/products/' ) || $request->get_method() !== 'GET' ) { |
| <?php | |
| if ( ! function_exists( 'wc_rest_get_product_images' ) ) { | |
| add_filter( 'woocommerce_rest_prepare_product_object', 'wc_rest_get_product_images', 10, 2 ); | |
| /** | |
| * Get the images for a product or product variation | |
| * and returns all image sizes. | |
| * | |
| * @param WP_REST_Request $request Request object. | |
| * @param WC_Product|WC_Product_Variation $product Product instance. |
| <?php | |
| // Filters the front-end output of the query block | |
| function prefix_random_posts_block_variation( $pre_render, $block ) { | |
| // Verify it's the block that should be modified using the namespace | |
| if ( !empty($block['attrs']['namespace']) && 'namespace/random-ordered-posts' === $block[ 'attrs' ][ 'namespace' ] ) { | |
| add_filter( 'query_loop_block_query_vars', function( $query ) { | |
| $post = get_queried_object(); |
| sudo apt-get install python-software-properties -y | |
| sudo add-apt-repository ppa:ondrej/php -y | |
| sudo apt-get update -y | |
| sudo apt-get install php7.2 php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml | |
| sudo apt-get install libapache2-mod-php7.2 -y | |
| sudo a2dismod php5 | |
| sudo a2enmod php7.2 | |
| sudo service apache2 restart |
| #!/bin/bash -e | |
| clear | |
| echo "============================================" | |
| echo "WordPress Install Script" | |
| echo "============================================" | |
| echo "Do you need to setup new MySQL database? (y/n)" | |
| read -e setupmysql | |
| if [ "$setupmysql" == y ] ; then | |
| echo "MySQL Admin User: " | |
| read -e mysqluser |
A new technique for responsive grids I've been working on which uses inline-block and text-align: justify.
Take a look at this article for an explanation of the fundamentals of the technique:
http://www.barrelny.com/blog/text-align-justify-and-rwd/
Essentially, margins are calculated by the browser and never specified in the CSS. This saves a lot of tedious work! Also by not having to use floats, clearfixes, or nth-child, we avoid many common problems associated with more traditional methods.