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 | |
/** | |
* Customize WordPress admin bar breakpoints (782px → 767px) | |
*/ | |
class AdminBarBreakpointCustomizer { | |
private const OLD_BREAKPOINTS = ['782px', '783px']; | |
private const NEW_BREAKPOINTS = ['767px', '768px']; | |
public function __construct() { | |
add_action('wp_enqueue_scripts', [$this, 'customizeAdminBarCSS'], 100); |
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('acf/location/rule_types', 'acf_location_rules_types'); | |
function acf_location_rules_types( $choices ) { | |
$choices['Utilisateur']['user_id'] = 'ID utilisateur'; | |
return $choices; | |
} | |
add_filter('acf/location/rule_values/user_id', 'acf_location_rules_values_user'); |
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
[ | |
{ | |
"id": "20768", | |
"title": "Event 1", | |
"start": 1531828524, | |
"end": 1531832124, | |
"allDay": false | |
}, | |
{ | |
"id": "20773", |
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
[ | |
{ | |
"id": "20768", | |
"title": "Event 1", | |
"start": 1531828524, | |
"end": 1531832124, | |
"allDay": false | |
}, | |
{ | |
"id": "20773", |
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 | |
$lat = -24.108764; | |
$lng = 16.500156; | |
function WGS84toGPS($lat, $lng){ | |
$lat = number_format($lat, 6); | |
$lng = number_format($lng, 6); | |
// define latitude coordinate with minutes and seconds | |
$lat_card = ($lat > 0) ? 'N' : 'S'; |
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 Namespace; | |
class Autoloader{ | |
static function register(){ | |
spl_autoload_register(array(__CLASS__, 'autoload')); | |
} | |
static function autoload($class){ |
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
function get_object_depth( $object_id, $object_type ){ | |
$ancestors = get_ancestors( $object_id, $object_type ); | |
return count($ancestors); | |
// 0 => level 1 (first parent) | |
// 1 => level 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 | |
/* | |
* Replace Taxonomy slug with Post Type slug in url | |
* Version: 1.1 | |
*/ | |
function ss_fix_portfolio_rewrite($wp_rewrite) { | |
$rules = array(); | |
// get all custom taxonomies |
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 | |
function get_all_post_custom_fields( $posts ) { | |
for ( $i = 0; $i < count($posts); $i++ ) { | |
$custom_fields = get_post_custom( $posts[$i]->ID ); | |
$posts[$i]->custom_fields = $custom_fields; | |
} | |
return $posts; | |
} | |
add_filter( 'the_posts', 'get_all_post_custom_fields' ); |
NewerOlder