Multi str_replace php
str_replace(
array(
'<',
'>',
'/',
',',
'{',
'}',
'?',
'*'
),
'',
$value[0]->post_content
)
How to add @mention in Buddypress single media page (or rtMedia single page)? Copy the codes below to your functions.php add_filter( 'bp_get_activity_content', 'filter_bp_get_activity_content', 10, 1 ); function filter_bp_get_activity_content( $content ) { global $bp, $wpdb; $mention_link = ''; $mention_dummy = ''; $at_all = array(); $at_mention = ''; $at_space = ''; $at_text = ''; $mention_dummy = $content;…
On my current, I have this “martygeocoderaddress” custom fields and it contains a string with Queen Anne’s. On my JS code below Wrong html += ''; html += '<?php echo get_post_meta( $product->id , 'martygeocoderaddress' , true ); ?>'; // Output is 'Queen Anne's' which is wrong and this can't be read by your JS code….
jQuery( document ).ready(function($){ if ( document.cookie.indexOf( 'visited=true' ) == -1 ){ var number_of_days = 1; // 1 Day var total_of_days = 1000*60*60*24*number_of_days; var expiration = new Date( ( new Date() ).valueOf() + total_of_days ); document.cookie = "visited=true;expires=" + expiration.toUTCString(); } });
For example I have ” /category/blog/ ” string and I want to convert it in an array. #String value $x = '/category/blog/'; #Convert to array $x2 = explode( '/', $x ); #Output array Array ( [0] => [1] => category [2] => blog [3] => ) #Remove empty array $x3 = array_filter( $x2 ); #Output…
function widget_first_last_classes($params) { global $my_widget_num; $this_id = $params[0]['id']; $arr_registered_widgets = wp_get_sidebars_widgets(); if(!$my_widget_num) { $my_widget_num = array(); } if(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { return $params; } if(isset($my_widget_num[$this_id])) { $my_widget_num[$this_id] ++; } else { $my_widget_num[$this_id] = 1; } $class = 'class="widget-' . $my_widget_num[$this_id] . ' '; if($my_widget_num[$this_id] == 1) { $class .= 'first '; } elseif($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id]))…
<ul> <li>Lorem</li> <li>Lorem ipsum immit</li> <li>Lorem dolor</li> </ul> // GET THE WIDTH HIGHEST VALUE var max = Math.max.apply(Math, jQuery("ul li").map(function() { return jQuery(this).width(); })); jQuery( 'ul' ).css( {'max-width': max, 'width':'100%'} ); // GET THE HEIGHT HIGHEST VALUE var max_height = Math.max.apply( Math, jQuery( 'ul li' ).map( function(){ return jQuery( this ).height(); }) ); jQuery( 'ul'…