Perform function on publish AND save (not just save)

Instead of taking meta values from get_post_meta function take it from $postarr array because when initial publishing of the post there isn’t any values for event_datestart and venue_name in database and it returns empty string. Updated Code : function set_event_title( $data , $postarr ) { if($data[‘post_type’] == ‘event’) { $getdate = $postarr[‘event_datestart’]; // Replace event_datestart … Read more

Output custom field as ul list

You are using get_post_meta incorrectly. As you use it, it will return an array – you cannot explode an array. See the codex on get_post_meta(); If you pass true as the third parameter, this tells the function to return a string. So, $list_items = get_post_meta($post->ID, ‘idid’, true); should work.

Add “alt” Attribute to GD Star Rating Tags

Add the attribute to each line of code that creates an img tag. In your text editor, search for lines that contain the string “<img”. Lines 241 and 273: $row->item_trend_rating = sprintf(‘<img class=”trend” src=”https://wordpress.stackexchange.com/questions/96226/%s” style=”https://wordpress.stackexchange.com/questions/96226/%s” width=”https://wordpress.stackexchange.com/questions/96226/%s” height=”https://wordpress.stackexchange.com/questions/96226/%s”></img>’, $gdsr->e, $image_bg, $set_rating->size, $set_rating->size); Becomes: $row->item_trend_rating = sprintf(‘<img class=”trend” src=”https://wordpress.stackexchange.com/questions/96226/%s” style=”https://wordpress.stackexchange.com/questions/96226/%s” width=”https://wordpress.stackexchange.com/questions/96226/%s” height=”https://wordpress.stackexchange.com/questions/96226/%s” alt=”https://wordpress.stackexchange.com/questions/96226/%s”></img>’, $gdsr->e, $image_bg, $set_rating->size, $set_rating->size, … Read more