View updatelive.sh
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
#!/bin/bash | |
function cecho(){ | |
RED="\033[0;31m" | |
GREEN="\033[0;32m" | |
YELLOW="\033[0;33m" | |
NC="\033[0m" # No Color | |
printf "${!1}\n${2} ${NC}" | |
} |
View PostFeaturedImage.php
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 | |
namespace SayHello\Theme\Block; | |
use WP_Block; | |
/** | |
* Core Post Featured Image block | |
* From plugin | |
* |
View PostMoreSameCategory.php
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 | |
namespace SayHello\Theme\Block; | |
use WP_Term; | |
/** | |
* More posts from same category as current post | |
* | |
* @author Say Hello GmbH <hello@sayhello.ch> |
View extend_admin_search.php
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_action( 'pre_get_posts', 'extend_admin_search' ); | |
function extend_admin_search( $query ) { | |
$post_type = 'post'; | |
$custom_fields = array("source",); | |
if( ! is_admin() ) | |
return; | |
if ( $query->query['post_type'] != $post_type ) | |
return; |
View block.php
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 | |
register_block_type('shb/demo', [ | |
'attributes' => [ | |
'align' => [ | |
'type' => 'string', | |
'enum' => ['wide', 'full'], | |
] | |
], |
View post_with_tag.js
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 remote_domain = 'DOMAIN', // without trailing slash | |
application_password = 'APPLICATION PASSWORD', | |
username = 'USERNAME'; | |
const headers = new Headers({ | |
'Content-Type': 'application/json', | |
'Authorization': 'Basic ' + btoa(username + ':' + application_password) | |
}); | |
const makePost = async function() { |
View remote_create_post.js
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 remote_domain = 'https://example.org', // without trailing slash | |
application_password = 'Application password', | |
username = 'remote_user_name'; | |
const body = JSON.stringify({ | |
title: 'Post using REST API', | |
content: 'Post content using REST API', | |
status: 'publish' | |
}); |
View ThreeColumns.php
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 | |
namespace SayHello\Theme\Pattern; | |
/** | |
* Manage single block pattern | |
* | |
* @author Say Hello GmbH <hello@sayhello.ch> | |
*/ | |
class ThreeColumns |
View GroupWithMediaText.php
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 | |
namespace SayHello\Theme\Pattern; | |
/** | |
* Manage single block pattern | |
* | |
* @author Say Hello GmbH <hello@sayhello.ch> | |
*/ | |
class GroupWithMediaText |
View alignment-options.js
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
// set alignment options for cover, video, and paragraph blocks. | |
wp.hooks.addFilter( | |
'blocks.registerBlockType', | |
'hd-theme/hd-theme', | |
function( settings, name ) { | |
if ( name === 'core/cover' || name === 'core/video' || name === 'core/paragraph' || name === 'core/list' ) { | |
return lodash.assign( {}, settings, { | |
supports: lodash.assign( {}, settings.supports, { | |
// allow support for full and wide alignment. | |
align: ['full', 'wide'], |
NewerOlder