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 | |
/** | |
* Custom search order by Date | |
* | |
* @param string $orderby Orderby string. | |
* @param object $query The query. | |
*/ | |
function barrd_sort_search_by_date( $orderby, $query ) { | |
global $wpdb; | |
if ( ! is_admin() && is_search() ) { |
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
[character] | |
success_symbol = "[➜](bold green) " | |
error_symbol = "[➜](bold red) " | |
format = "$character$all" | |
[cmd_duration] | |
disabled = true | |
[directory] |
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
accent: "#258595" # Accent colour for UI elements. | |
background: "#272c34" # Terminal background colour. | |
details: darker # Whether the theme is lighter or darker. | |
foreground: "#b3bac6" # The foreground colour. | |
terminal_colors: # Ansi escape colours. | |
bright: | |
black: "#106378" | |
blue: "#6cb8f1" | |
cyan: "#61bec9" | |
green: "#a2ca84" |
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 | |
// Replace the 'wp-json' REST API prefix with 'api'. | |
// Make sure to flush the rewrite rules for this to work! | |
// 🔥 Kudos Phil Kurth | |
// @see https://www.youtube.com/watch?v=vSUi2Rt36yU | |
add_filter( 'rest_url_prefix', function () { | |
return 'api'; | |
} ); |
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 | |
/** | |
* Exclude posts by ID | |
* | |
* @param array $query The WP_Query instance. | |
*/ | |
function exclude_posts_from_search( $query ) { | |
if ( $query->is_main_query() && is_search() ) { | |
// Add post IDs into array. | |
$post_ids = array( 10, 11, 12 ); |
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
# --------------------------------------------------------------------- | |
# Vanilla WordPress Git Ignore File | |
# --------------------------------------------------------------------- | |
# Ignore everything in root except wp-content dir & wp-config | |
/* | |
!wp-content/ | |
!wp-config* | |
wp-config-sample.php |
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 | |
/** | |
* Required Dependencies | |
*/ | |
// Construct the iterator. | |
$rdi = new RecursiveDirectoryIterator( get_template_directory() . '/inc' ); | |
// Loop through PHP files. | |
foreach ( new RecursiveIteratorIterator( $rdi ) as $file ) { | |
if ( $file->getExtension() === 'php' ) { |
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 | |
/** | |
* Hide jQuery Migration notice | |
* | |
* Temp fix until plugin can be removed | |
* | |
* @return void | |
*/ | |
function removes_migrate_warning() { |
NewerOlder