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 has-\d-columns class to columns blocks after 5.3 update. | |
* | |
* @param string $block_content The block content about to be appended. | |
* @param array $block The full block, including name and attributes. | |
* | |
* @return string | |
*/ | |
add_filter( 'render_block', function( $block_content, $block ) { |
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 { | |
select, | |
} = wp.data; | |
wp.domReady( () => { | |
/** | |
* Get the slider blocks. | |
* | |
* @param {object} block | |
* @param {array} sliderBlocks |
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
/** | |
* Add categories attribute to core/latest-posts block. | |
* | |
* @param {*} settings | |
* @param {*} name | |
*/ | |
function latestPostsCategories( settings, name ) { | |
// Only modify latest posts block settings. | |
if ( name !== 'core/latest-posts' ) { | |
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
<?php | |
/** | |
* Do not show favicon (prevents WP logo from showing up since WP 5.4). | |
* Does NOT show a maybe-existent site icon instead. For that, look here: https://gist.github.com/webdados/a7702e588070f9a1cfa12dff89b3573c | |
*/ | |
add_action( 'do_faviconico', function() { | |
header( 'Content-Type: image/vnd.microsoft.icon' ); | |
exit; | |
} ); |
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 skip-lazy class to first image in content. | |
*/ | |
add_filter( 'the_content', function( $content ) { | |
// Check if we have no content. | |
if ( empty( $content ) ) { | |
return $content; | |
} |
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
/** | |
* External dependencies | |
*/ | |
const { isUndefined, pickBy } = lodash; | |
/** | |
* WordPress dependencies | |
*/ | |
const { | |
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
<? | |
$main_img_wppath = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full')[0]; | |
$portfolio_cats = get_the_term_list( $post->ID, 'portfolio_category', '', ', '); | |
// declaring all possible custom fields (usually only some of them are populated in the portfolio page) | |
$portfolioPostIcon = get_post_meta($post->ID, 'portfolioPostIcon', true); | |
$customers = get_post_meta($post->ID, 'customers', true); | |
$relnotes = get_post_meta($post->ID, 'relnotes', true); | |
$appstore = get_post_meta($post->ID, 'appstore', true); |
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 classnames from 'classnames'; | |
import { textColors, backgroundColors } from '../colors'; | |
const { | |
registerBlockType, | |
} = wp.blocks; | |
const { | |
InspectorControls, | |
InnerBlocks, |
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 classnames from 'classnames'; | |
const { | |
registerBlockType, | |
} = wp.blocks; | |
const { | |
InspectorControls, | |
InnerBlocks, | |
withColors, | |
getColorClass |
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( 'wp_enqueue_scripts', 'hannover_child_remove_lightbox', 100 ); | |
/** | |
* Remove the Hannover lightbox script. | |
*/ | |
function hannover_child_remove_lightbox() { | |
wp_dequeue_script( 'hannover-lightbox' ); | |
wp_deregister_script( 'hannover-lightbox' ); | |
} |
NewerOlder