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 | |
namespace Valet\Drivers\Custom; | |
use Valet\Drivers\ValetDriver; | |
class RadicleValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. |
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_filter('posts_clauses', function (array $clauses, WP_Query $wp_query): array { | |
$wpdb = $GLOBALS['wpdb']; | |
$taxonomy = 'course_level'; | |
if (! isset($wp_query->query['orderby']) || $taxonomy !== $wp_query->query['orderby']) { | |
return $clauses; | |
} |
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 | |
declare(strict_types=1); | |
/** | |
* Class LaravelMixAsset | |
*/ | |
class LaravelMixAsset | |
{ | |
/** |
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 | |
/** | |
* Filter posts by post title first letter in WordPress (PHP 7.x) | |
*/ | |
add_filter('posts_where', function (string $where, WP_Query $query): string { | |
$wpdb = $GLOBALS['wpdb']; | |
$starts_with = esc_sql($query->get('title_starts_with')); |
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 | |
class MoodleValetDriver extends BasicValetDriver | |
{ | |
protected $isStyleUri = false; | |
protected $baseUri = ''; | |
protected $moodleStaticScripts = [ | |
'styles.php', | |
'javascript.php', | |
'jquery.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 | |
/** | |
* Get Lat/Lng center from an coords array | |
* | |
* @param array $coords | |
* @return float[]|int[] | |
*/ | |
function getLatLngCenter(array $coords): array | |
{ |