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
<?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
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 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
<? | |
$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
;(function () { | |
/** | |
* Run function when customizer is ready. | |
*/ | |
wp.customize.bind('ready', function () { | |
wp.customize.control('slug_select_control', function (control) { | |
/** | |
* Run function on setting change of control. | |
*/ | |
control.setting.bind(function (value) { |
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 | |
/** | |
* Needs php_mbstring extension | |
*/ | |
ini_set( 'memory_limit', '1024M' ); | |
date_default_timezone_set( 'UTC' ); | |
// Damit es in der Konsole nicht so lange dauert | |
error_reporting( 0 ); | |
// <load users file> |
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
/** | |
* If registration for new network sites is disabled, | |
* the NOBLOGREDIRECT constant redirects to a specific URL | |
* if a user tries to access a nonexisting network site. | |
*/ | |
// add this to wp-config.php and adjust the URL | |
define( 'NOBLOGREDIRECT', 'https://example.com' ); | |
/** |
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 | |
/* | |
Plugin Name: UTF8mb4-convert | |
Version: 1.0 | |
*/ | |
function update_db_to_utf8mb4() { | |
if ( ! isset( $_GET['update-utf8bm4'] ) ) { | |
return; | |
} |
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, |
OlderNewer