See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
| import { select, subscribe } from '@wordpress/data' | |
| export function whenEditorIsReady() { | |
| return new Promise((resolve) => { | |
| const unsubscribe = subscribe(() => { | |
| // This will trigger after the initial render blocking, before the window load event | |
| // This seems currently more reliable than using __unstableIsEditorReady | |
| if (select('core/editor').isCleanNewPost() || select('core/block-editor').getBlockCount() > 0) { | |
| unsubscribe() | |
| resolve() |
| <?php if(!defined('ABSPATH')) { die(); } // Include in all php files, to prevent direct execution | |
| /** | |
| * Plugin Name: WP Geo Query | |
| * Plugin URI: https://gschoppe.com/wordpress/geo-searches/ | |
| * Description: Adds location search support to WP_Query, making it easy to create completely custom "Find Location" pages. | |
| * Author: Greg Schoppe | |
| * Author URI: https://gschoppe.com | |
| * Version: 1.0.0 | |
| **/ |
| <?php | |
| namespace App; | |
| use Carbon_Fields\Field; | |
| use Carbon_Fields\Block; | |
| Block::make( __( 'Gutenberg Block' ) ) | |
| ->set_icon( 'format-chat') | |
| ->add_fields( array( | |
| Field::make( 'rich_text', 'text', __( 'text', 'my-theme' ) ) |
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
| $( '#search' ).select2( { | |
| ajax: { | |
| url: API.root + '/wp/v2/posts', | |
| processResults: function( data, page ) { | |
| console.log( data ); | |
| return { | |
| //do something results | |
| } | |
| }, | |
| cache: false, |
| this.$el.find( '.taxonomy-terms' ).select2({ | |
| multiple: true, | |
| ajax: { | |
| url: WP_API_Settings.root + 'wp/v2/terms/' + this.options.taxonomy.slug, | |
| data: function( term, page ) { | |
| return { | |
| search: term, | |
| page: page, | |
| _envelope: true | |
| } |
| $ wp post list --format=ids | xargs wp post update --comment_status=closed | |
| # Output: | |
| # Success: Updated post 2514. | |
| # Success: Updated post 2511. | |
| # Success: Updated post 2504. | |
| # Success: Updated post 2499. | |
| # Success: Updated post 2441. | |
| # etc... |
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
| <?php | |
| // Just require() this class via your theme's functions.php file. | |
| /* Then instantiate this at the top of your 404.php file with: | |
| if ( class_exists( 'Clean_404_Email' ) ) | |
| new Clean_404_Email; | |
| */ | |
| class Clean_404_Email { | |
| var $time, $request, $blog, $email, $theme, $theme_data, $site, $referer, $string, $address, $remote, $agent, $message; |
| function format_phone($phone) | |
| { | |
| $phone = preg_replace("/[^0-9]/", "", $phone); | |
| if(strlen($phone) == 7) | |
| return preg_replace("/([0-9]{3})([0-9]{4})/", "$1-$2", $phone); | |
| elseif(strlen($phone) == 10) | |
| return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "($1) $2-$3", $phone); | |
| else | |
| return $phone; |