Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function xs_main($id, $name = true) {
- if (function_exists('icl_object_id')) {
- $id = icl_object_id($id, 'page', true, 'en');
- }
- if ($name === true) {
- $post = get_post($id);
- return xsslug($post->post_name);
- } else {
- return $id;
- }
- }
- function xsslug($input){
- $string = html_entity_decode($input,ENT_COMPAT,"UTF-8");
- $oldLocale = setlocale(LC_CTYPE, '0');
- setlocale(LC_CTYPE, 'en_US.UTF-8');
- $string = iconv("UTF-8","ASCII//TRANSLIT",$string);
- setlocale(LC_CTYPE, $oldLocale);
- return strtolower(preg_replace('/[^a-zA-Z0-9]+/','',$string));
- }
- content-intro.php#
- line 14: <section id="section-<?php echo xs_main($post->ID, false); ?>">
- one-page.php#
- line 44: <!--BEGIN-<?php echo xs_main($post->ID); ?> // Post ID: <?php echo xs_main($post->ID, false); ?> -->
- walkermenu#
- line 87: $atts['href'] = $prefx . 'section-' . xs_main($item->object_id, false);
- line 102: $atts['href'] = $prefx . 'section-' . xs_main($item->object_id, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement