Gutenberg curation in WordPress
Получить список цветов в консоли.
wp.data.select('core/block-editor').getSettings().colors;
Gutenberg curation in WordPress
Получить список цветов в консоли.
wp.data.select('core/block-editor').getSettings().colors;
| { | |
| "$schema": "https://playground.wordpress.net/blueprint-schema.json", | |
| "landingPage": "/wp-admin/edit.php", | |
| "features": { | |
| "networking": true | |
| }, | |
| "preferredVersions": { | |
| "php": "latest", | |
| "wp": "latest" | |
| }, |
| youtu.be | |
| youtube.com | |
| ggpht.com | |
| ytimg.com | |
| googlevideo.com | |
| notion.so | |
| chatgpt.com | |
| coursera.org | |
| trae.ai | |
| groq.com |
| /* | |
| * Применить если ширина экрана меньше чем... | |
| */ | |
| /* Phone portrait and smaller */ | |
| @media (max-width: @breakpoint-xsmall-max) { | |
| } |
| <?php | |
| echo VideoJsWidget::widget( [ | |
| 'options' => [ | |
| 'id' => 'main-video', | |
| 'class' => 'video-js', | |
| 'controls' => true, | |
| 'preload' => 'auto', | |
| 'width' => '800', | |
| 'height' => '400' | |
| ], |
| wp core update && wp plugin update --all && wp core language update |
| <?php | |
| // Custom AJAX Handler | |
| // watch https://coderwall.com/p/of7y2q/faster-ajax-for-wordpress | |
| /* Route functions place in functions.php or mu-plugin | |
| function wp_pretty_ajax() | |
| { | |
| add_rewrite_rule('ajax$', 'ajax.php', 'top'); | |
| } | |
| */ |
| <!-- wp:query {"queryId":0,"query":{"perPage":"7","pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"parents":[]},"align":"full","className":"pattern-post-grid-cover","layout":{"type":"constrained"}} --> | |
| <div class="wp-block-query alignfull pattern-post-grid-cover"><!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|plus-3","left":"var:preset|spacing|plus-3","top":"var(\u002d\u002dtheme-spacing\u002d\u002dplus-3)","bottom":"var(\u002d\u002dtheme-spacing\u002d\u002dplus-3)"}}},"layout":{"type":"default"}} --> | |
| <div class="wp-block-group alignfull" style="padding-top:var(--theme-spacing--plus-3);padding-right:var(--wp--preset--spacing--plus-3);padding-bottom:var(--theme-spacing--plus-3);padding-left:var(--wp--preset--spacing--plus-3)"><!-- wp:post-template {"align":"full","style":{"spacing":{"blockGap":"var:preset|spacing|minus-3"}},"className":"is-style-no-gap is-style-flex-grow is-style-fe |
| <?php | |
| /** | |
| * Automatically registers block types by scanning the build/blocks folder. | |
| * | |
| * This function searches for JSON files within each subfolder and registers | |
| * them as block types. It is triggered on WordPress 'init' action. | |
| */ | |
| function auto_register_block_types() { | |
| if ( file_exists( __DIR__ . '/build/blocks/' ) ) { |
| // insert in dev tools console on edit post screen | |
| wp.apiFetch( { path: '/wp/v2/block-patterns/patterns' } ).then( console.log ); |