Skip to content

Instantly share code, notes, and snippets.

View apermo's full-sized avatar

Christoph Daum apermo

View GitHub Profile
@mrpritchett
mrpritchett / wp-gutenberg-reusable-block-interface.php
Last active August 14, 2019 17:16
Gutenberg Reusable Block Editor Interface
function custom_add_interface_to_wp_block( $args, $post_type ) {
if ( 'wp_block' === $post_type ) {
$args['supports'] = array( 'title, 'editor' );
$args['show_in_rest'] = true;
$args['show_in_menu'] = true;
if ( strstr( $_SERVER['REQUEST_URI'], 'wp-admin/post-new.php' ) || strstr( $_SERVER['REQUEST_URI'], 'wp-admin/post.php' ) ) {
$args['rest_controller_class'] = 'WP_REST_Posts_Controller';
} else {
$args['rest_controller_class'] = 'WP_REST_Blocks_Controller';
@Zodiac1978
Zodiac1978 / linklist.md
Last active November 27, 2019 11:51
Supporter Toolbox - useful links for your (WordPress) support
@atomtigerzoo
atomtigerzoo / wordpress-disable-yoast-seo-on-custom-post-type.php
Created March 31, 2016 12:39
Wordpress: Disable Yoast SEO on Custom Post Type
function my_remove_wp_seo_meta_box() {
remove_meta_box('wpseo_meta', YOUR_POST_TYPE_NAME_HERE, 'normal');
}
add_action('add_meta_boxes', 'my_remove_wp_seo_meta_box', 100);
@snipe
snipe / htaccess-ip-lock
Created November 6, 2012 03:51
Htaccess to handle IP whitelisting, password prompt otherwise
# Welcome to your htaccess file.
# Remember that modifying this file can break the entire website
# so please edit carefully.
# Also remember that the order of the rules below does matter,
# so be sure of what you're doing before shuffling things around.
AuthType Basic
AuthName "My Dev Environment"
# Specify what user/password file the server should look