This file contains hidden or 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('admin_bar_menu', function ($wp_admin_bar) { | |
$wp_admin_bar->remove_node('wp-logo'); | |
}, 999); |
This file contains hidden or 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 | |
/* | |
* Some plugins set 5xx status when code runs through expected flows. | |
* This is to track this since it does not trigger any PHP error logs, | |
* so that you have some idea why a site fails with 5xx. | |
*/ | |
add_action ('status_header', function ($status_header, $code, $description, $protocol) { | |
if ( $code >= 500 ) { | |
$backtrace = Logger::debugBacktrace(); | |
$this->logger->error( "Server-side error detected: $status_header. Backtrace: $backtrace" ); |
This file contains hidden or 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_filter( 'show_advanced_plugins', function ($default, $type) { | |
return $type == 'mustuse' ? false : $default; | |
}, 10, 2 ); |
This file contains hidden or 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 App; | |
class PostHasTerm extends \ACF_Location | |
{ | |
public function initialize() | |
{ | |
$this->name = 'post_has_term'; | |
$this->label = __('Post Has Term'); |
This file contains hidden or 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: WP Debug Function | |
Description: A Must-Use plugin that makes the wp_debug_var available to your WordPress Installation | |
Plugin URI: https://gist.github.com/broskees/18c6b10a491d2946fbbfed96a8dd6dc4 | |
Version: 1.0.0 | |
Author: Joseph Roberts | |
Author URI: https://github.com/broskees | |
License: GPLv2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
This file contains hidden or 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 debuggerFn = variable => console.log({[debuggerFn.caller]: {variable}}); |
This file contains hidden or 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 | |
/** | |
* Is the current page a descendent of page identified by the path (not slug). | |
* A page is not a descendent of itself! | |
* | |
* @link http://wordpress.stackexchange.com/questions/101213/does-is-child-exist-in-wp-3-5-1 | |
* @link https://gist.github.com/broskees/8fd20d3167c4e7dd2941aaef5e7068cc | |
* @param string $page_path The path of the page, e.g. mypage/mysubpage | |
* @return boolean True if current page is a descednent of specified $page_path. False otherwise. | |
*/ |
This file contains hidden or 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: Simple Environment plugin disabler | |
Description: Disables plugins based on environment settings. | |
Original Author: Kamil Grzegorczyk | |
Related blog post: https://roots.io/guides/how-to-disable-plugins-on-certain-environments/ | |
Version: 0.1 | |
*/ | |
class DisablePlugins |
This file contains hidden or 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
# Uninstall current version you want to change | |
brew uninstall --cask vagrant | |
# e.g. Vagrant | |
brew edit --cask vagrant | |
# replace the contents of that file with the version of the file found in github history: | |
# https://github.com/Homebrew/homebrew-cask/commits/master/Casks/vagrant.rb | |
# or change version and SHA256, you can find on https://releases.hashicorp.com/vagrant/ | |
``` |
This file contains hidden or 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
{{date|date("Ymd")}}{% for char in time|replace(":", "")|replace("am", "")|replace("pm", "")|list %}{% if loop.index == 1 and time[1] == ":" and "am" in time %}0{{char}}{% elif loop.index < 3 and time[2] == ":" and time[1] == "2" and "am" in time %}0{% elif loop.index == 1 and time[1] == ":" and "pm" in time %}{{char|int() + 12}}{% elif loop.index < 3 and time[2] == ":" and "pm" in time %}{{char|int() + loop.index}}{% else %}{{char}}{% endif %}{% endfor %} |