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_redirect_url() | |
* Gets the address that the provided URL redirects to, | |
* or FALSE if there's no redirect. | |
* | |
* @param string $url | |
* @return string | |
*/ |
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 chaoz_icon_array($k) { | |
$v = array(); | |
foreach ($k as $kv) { | |
$kv = str_replace('-', ' ', $kv); | |
$kv = str_replace('icon', '', $kv); | |
$v[] = array_push($v, ucwords($kv)); | |
} | |
foreach($v as $key => $value) if($key&1) unset($v[$key]); | |
return array_combine($k, $v); |
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_action( 'vc_before_init', function() { | |
if (class_exists('WPBMap')) { | |
add_filter('init', function () { | |
$param = WPBMap::getParam('vc_icon', 'type'); | |
$param['value'][__('Thimify Icon', 'total')] = 'themify_icon'; | |
vc_update_shortcode_param('vc_icon', $param); | |
}, 40); |
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 | |
// Limit latter | |
function prefix_limit_latter($string, $limit_length) { | |
if (strlen($string) > $limit_length) { | |
echo substr($string, 0, $limit_length) . '...'; | |
} | |
else { | |
echo $string; | |
} | |
} |
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 image alt text | |
function aproch_image_alt($image_id) { | |
$image_title = get_the_title($image_id); | |
$image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true); | |
echo !empty($image_alt) ? $image_alt : $image_title; | |
} |
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 Convert_to_htmlTag($string, $tagSign='|') { | |
if(strpos($string, '|') == true) { | |
$firstSign = strpos($string, $tagSign); | |
$lastSign = strpos($string, $tagSign, $firstSign + 1); | |
$strArray = str_split($string); | |
$replaceSigns = array($firstSign => '<span>', $lastSign => '</span>'); | |
$replaceSigns = array_replace($strArray, $replaceSigns); | |
echo implode($replaceSigns); | |
}else { |
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 | |
// Category array | |
function chaoz_cat_array($term='portfolio_cat') { | |
$cats = get_terms(array( | |
'taxonomy' => $term, | |
'hide_empty' => true | |
)); | |
$cat_array = array(); | |
$cat_array['all'] = esc_html__('All', 'gullu'); | |
foreach ($cats as $cat) { |
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 getPostViews($postID){ | |
$count_key = 'post_views_count'; | |
$count = get_post_meta($postID, $count_key, true); | |
if($count==''){ | |
delete_post_meta($postID, $count_key); | |
add_post_meta($postID, $count_key, '0'); | |
return "0 View"; | |
} | |
return ($count/2).' Views'; |
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 | |
// event.pt.php | |
/** | |
* Use namespace to avoid conflict | |
*/ | |
namespace PostType; | |
/** | |
* Class Portfolio |
OlderNewer