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 | |
function lambert93ToWgs84($x, $y){ | |
$x = number_format($x, 10, '.', ''); | |
$y = number_format($y, 10, '.', ''); | |
$b6 = 6378137.0000; | |
$b7 = 298.257222101; | |
$b8 = 1/$b7; | |
$b9 = 2*$b8-$b8*$b8; | |
$b10 = sqrt($b9); | |
$b13 = 3.000000000; |
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
<!-- Don't forget to include jquery --> | |
<!-- the markup --> | |
<span class="counter" data-increment-value="0.07" data-increment-time="1000">1000.45</span> | |
<span class="counter" data-increment-value="0.03" data-increment-time="100">814.73</span> | |
<!-- the script --> | |
<script> | |
$( ".counter" ).each(function() { | |
// Get initial value (span value) as a number |
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 | |
if ( ! function_exists( 'get_function_files' ) ) { | |
function get_function_files($path){ | |
$function_files = glob($folder.$path, GLOB_BRACE); | |
foreach($function_files as $function_file){ | |
if (substr($function_file, -8) != '-off.php'){ | |
require_once($function_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
echo '<pre>'; | |
print_r(get_category()); | |
echo '</pre>'; |
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 | |
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' ); |
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 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 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 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 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'; |
OlderNewer