A prompt to boost your lazy "do this" prompts. Install with one of the buttons below.
| <?php | |
| namespace WotW\Theme\Patterns; | |
| use WotW\Theme\Contracts\Interfaces\Hookable; | |
| class Save implements Hookable{ | |
| public function register_hooks(): void { | |
| { | |
| "key": "dcwd_flip_card_group", | |
| "title": "Flip Card", | |
| "fields": [ | |
| { | |
| "key": "front_image", | |
| "label": "Front image", | |
| "name": "card_front", | |
| "type": "image", | |
| "return_format": "array", |
| import { Fragment } from "@wordpress/element"; | |
| import { InnerBlocks } from "@wordpress/editor"; | |
| /** | |
| * Changes the edit function of an ACF-block to allow InnerBlocks | |
| * Should be called like this on `editor.BlockEdit` hook: | |
| * ` addFilter("editor.BlockEdit", "namespace/block", editWithInnerBlocks("acf/block-name"));` | |
| * | |
| * @param {string} blockName the name of the block to wrap | |
| * @param {object} innerBlockParams params to be passed to the InnerBlocks component (like allowedChildren) |
| add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number', 1, 2); | |
| function change_woocommerce_order_number( $order_id, $order ) { | |
| $prefix = '#SAM-'; | |
| $suffix = '-' . date(Y); | |
| return $prefix . $order->id . $suffix; | |
| } |
This week NN Group released a video by Jakob Nielsen in which he attempts to help designers deal with the problem of customers being resistant to their new site/product redesign. The argument goes thusly:
There's slightly more to it than that, he caveats his argument with requiring you to have of course followed their best practices on product design, and allows for a period of customers being able to elect to continue to use the old site, although he says this is obviously only a temporary solution as you don't want to support both.
| function lazy_embed_oembed_html($html, $url, $attr){ | |
| $html = str_replace('<iframe ','<iframe loading="lazy" ',$html); | |
| return $html; | |
| } | |
| add_filter('embed_oembed_html', 'lazy_embed_oembed_html',10, 3); |
| <?php | |
| /** | |
| * Add sub options page with a custom post id | |
| */ | |
| if( function_exists('acf_add_options_page') ) { | |
| acf_add_options_sub_page(array( | |
| 'page_title' => 'CSV Sync', | |
| 'menu_title' => 'CSV Sync', | |
| 'parent_slug' => 'users.php', |
| <figure> | |
| <figcaption>Caption:</figcaption> | |
| <audio | |
| controls | |
| src="https://sitedomain.com/wp-content/uploads/2019/03/filename.mp3"> | |
| Your browser does not support the | |
| <code>audio</code> element. | |
| </audio> | |
| </figure> |
| /** | |
| * Register hero block | |
| */ | |
| add_action('acf/init', 'hero'); | |
| function hero() { | |
| // check function exists | |
| if( function_exists('acf_register_block') ) { | |
| // register a hero block |