Skip to content

Commit

Permalink
Merge pull request #631 from kprajapatii/master
Browse files Browse the repository at this point in the history
Twitter feed custom field no longer working - FIXED
  • Loading branch information
Stiofan authored Mar 5, 2019
2 parents edb4b8b + fa82155 commit a2af718
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
v2.0.0.47
Edit post permalink button missing so permalink can't be edited - FIXED
Radio button and text overlap on add listing page - FIXED
Twitter feed custom field no longer working - FIXED

v2.0.0.46
Some custom fields should store is_default = 0 during v1 to v2 conversion - FIXED
Expand Down
6 changes: 3 additions & 3 deletions includes/custom-fields/output-filter-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* @return string The html to output.
*/
function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){
global $post;
global $gd_post;


if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
if (isset($gd_post->{$cf['htmlvar_name']}) && $gd_post->{$cf['htmlvar_name']} != '' ):

$class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";

Expand All @@ -37,7 +37,7 @@ function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf)

$html = '<div class="geodir_post_meta ' . $cf['css_class'] . ' geodir-field-' . $cf['htmlvar_name'] . '" style="clear:both;">';

$html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>';
$html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$gd_post->{$cf['htmlvar_name']}.'">' . wp_sprintf( __( 'Tweets by %s', 'geodirectory' ), $gd_post->{$cf['htmlvar_name']} ) . '</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>';
$html .= '</div>';

endif;
Expand Down

0 comments on commit a2af718

Please sign in to comment.