Skip to content

Instantly share code, notes, and snippets.

View Rubsel's full-sized avatar
🍔

Ruben Zwiers Rubsel

🍔
View GitHub Profile
@Rubsel
Rubsel / gutenberg-full-width.php
Last active January 24, 2020 13:05
Full width Gutenberg
<?php
function radish_gutenberg_full_width() {
echo '<style>
body.gutenberg-editor-page .editor-post-title__block, body.gutenberg-editor-page .editor-default-block-appender, body.gutenberg-editor-page .editor-block-list__block {
max-width: none !important;
}
.block-editor__container .wp-block {
max-width: none !important;
}
@Rubsel
Rubsel / NL phoneformat Gravity Forms
Last active January 24, 2020 13:05
Adds the NL option to the GF phone field
<?php
// Add in contstuctor
add_filter( 'gform_phone_formats', [ $this, 'gf_nl_phone_format' ] );
// Add anywhere in the functions.php
function gf_nl_phone_format( $phone_formats ) {
$phone_formats['nl'] = array(
'label' => 'Nederlands',
'mask' => false,
@Rubsel
Rubsel / acf-parent-fields.php
Created October 23, 2019 10:18
Get ACF field groups from parent.
<?php
add_filter('acf/settings/load_json', 'parent_theme_acf_load');
function parent_theme_acf_load($paths) {
// Locate the parent template directory
$path = get_template_directory().'/acf-json';
$paths[] = $path;
return $paths;
@Rubsel
Rubsel / gutenberg-custom-color-picker.php
Last active November 12, 2019 20:39
Custom Gutenberg colorpicker options
<?php
add_action( 'after_setup_theme', array( $this, 'boa_setup_gutenberg_colorpalette' ) );
add_action( 'after_setup_theme', array( $this, 'boa_gutenberg_disable_custom_colors' ) );
/**
* Disable the custom color picker.
*/
public function boa_gutenberg_disable_custom_colors() {
add_theme_support( 'disable-custom-colors' );
}