This file contains 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 { addFilter } from '@wordpress/hooks'; | |
import { __ } from '@wordpress/i18n'; | |
import { createHigherOrderComponent } from '@wordpress/compose'; | |
import { InspectorControls } from '@wordpress/block-editor'; | |
import { PanelBody, ToggleControl, TextControl } from '@wordpress/components'; | |
const addAttributes = ( settings, name ) => { | |
if ( name !== 'core/button' ) { | |
return settings; | |
} |
This file contains 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
/** | |
* Internal dependencies | |
*/ | |
import ChildComponent from './ChildComponent'; | |
import StoreProvider from './utils/store'; | |
const App = () => ( | |
<StoreProvider> | |
<ChildComponent /> | |
</StoreProvider> |
This file contains 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_filter( 'sig_template_font_file', function ( $path, $context ) { | |
if ( $context !== 'title' ) { | |
return $path; | |
} | |
return 'path/to/font.ttf'; | |
}, 10, 2 ); |
This file contains 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
# Replace all instances of 'theme-name' with the name of your project. | |
# Create a new repo for the theme | |
# Uses https://github.com/aaemnnosttv/wp-cli-valet-command/ | |
cd ~/Dev/posty/ | |
gh repo create posty-studio/theme-name --template="posty-studio/posty-starter-theme" | |
cd theme-name | |
git pull origin master | |
git checkout -b dev |
This file contains 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 { PurgeCSS } = require('purgecss'); | |
/** | |
* Remove any CSS not used on the page and inline the remaining CSS in the | |
* <head>. | |
* | |
* @see {@link https://github.com/FullHuman/purgecss} | |
*/ | |
eleventyConfig.addTransform('purge-and-inline-css', async (content, outputPath) => { | |
if (process.env.ELEVENTY_ENV !== 'production' || !outputPath.endsWith('.html')) { |
This file contains 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
apt-get install autoconf libpcre3-dev | |
MODULE_NAME="xdebug" | |
MODULE_VERSION="2.9.6" | |
cd ~ | |
wget https://xdebug.org/files/xdebug-2.9.6.tgz |
This file contains 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
/** | |
* WordPress dependencies | |
*/ | |
import { SVG, Circle } from '@wordpress/primitives'; | |
const spinner = ( | |
<SVG fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"> | |
<Circle cx="18" cy="18" r="18" fill="#a2a2a2" /> | |
<Circle cx="18" cy="8" r="4" fill="#f1f1f1"> | |
<animateTransform |
This file contains 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 | |
/** | |
* This class is an example of how to reliably fetch items from an external API | |
* using background processing. Make sure Action Scheduler is installed before | |
* instantiating this class. | |
* | |
* @link https://actionscheduler.org/ | |
*/ | |
class Importer { | |
const API_URL = 'https://api.openbrewerydb.org/breweries'; |
This file contains 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
if (namespace.postType === 'post-type-slug') { | |
registerBlockType(); | |
} |
This file contains 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 | |
$forms = get_posts(['post_type' => 'wpcf7_contact_form', 'posts_per_page' => -1]); | |
if (empty($forms)) { | |
return []; | |
} | |
return array_combine(wp_list_pluck($forms, 'ID'), wp_list_pluck($forms, 'post_title')); |
NewerOlder