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
const Home: NextPage = () => { | |
const { data, loading } = useQuery(GET_PRODUCTS) | |
return loading ? 'Loading...' : <ProductList products={data.getAllProducts.data} /> ; | |
} |
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 | |
get_header(); | |
$term = get_queried_object(); | |
$term_children = get_term_children($term->term_id, $term->taxonomy); | |
$has_children = !is_wp_error($term_children) && ! empty( $term_children ); | |
$term_title = single_term_title(); | |
$term_description = term_description(); |
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
import 'core-js/stable'; | |
import 'regenerator-runtime/runtime'; | |
import { get } from 'lodash'; | |
import { | |
clearLocalStorage, | |
enablePageDialogAccept, | |
setBrowserViewport, | |
loginUser | |
} from '@wordpress/e2e-test-utils'; |
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 | |
const FIELD_NAME = 'field_name'; | |
add_action( 'rest_api_init', __NAMESPACE__ . '\\register_api_fields' ); | |
function register_api_fields() { | |
register_rest_field( | |
'post', | |
FIELD_NAME, |
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
// Always run | |
useEffect( () => { | |
// code to run | |
} ); | |
// As componentDidMount (run once) | |
useEffect( () => { | |
// code to run | |
}, [] ); |
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
<table> | |
<tr> | |
<th class="superhead">Spectrum</th> | |
<th class="superhead">Spectrum</th> | |
<th class="superhead">Spectrum</th> | |
</tr> | |
<tr> | |
<th>hsjflhewf jewh fkwefhdjf</th> | |
<th></th> | |
<th></th> |
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
import { InspectorControls } from '@wordpress/block-editor'; | |
import { PanelBody } from '@wordpress/components'; | |
const BlockSettings = () => { | |
return <InspectorControls> | |
<PanelBody | |
title="My panel body" | |
> | |
Hello world | |
</PanelBody> |
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
# from WP Slack: | |
# If you’re wanting to know whether a feature is in a version of WordPress that you support, one option is to go to the WordPress develop github mirror, select a branch corresponding to a WordPress version, and then look at the package.json file for that version to see what @wordpress/* package versions are in that release. |
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
.boxed { | |
vertical-align: baseline; | |
border: 1px solid #ec8777; | |
background: linear-gradient(to right, #e5a98c, #f5a593, #f7a6a0); | |
border-radius: 4px; | |
padding: 3px 7px; | |
} |
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
import './style.scss'; | |
const { toggleFormat, registerFormatType } = wp.richText; | |
const { RichTextToolbarButton } = wp.blockEditor; | |
const formatName = 'igmoweb/boxed-format'; | |
const formatTitle = 'Boxed'; | |
const BoxedButton = ( { onChange, value, isActive } ) => { | |
const toggleBoxedFormat = () => { |
NewerOlder