1
I am using the IP API for geolocation in a wordpress plugin, the plugin is ready and works normally! I want to add the following:
In one of the fields of the plugin, the user can insert a text and at the end of this text, except that this field does not accept shortcode, it is a type of text field, without editor or anything, I will attach the image. The shortcode is already ready, just need the field accept the shortcode, for now it only brings the shortcode as text.
Exit Code
$loop_link_rows .= '<div class="coluna_relacionados_fake"><a rel="nofollow" target="_blank" href="/?action=count&id=' . $row->meta_id . '"><img src="'.content_url().'/uploads'.$row->meta_attachment.'" alt="'.esc_attr( stripcslashes($row->meta_title)).'"></a><a rel="nofollow" target="_blank" href="/?action=count&id=' . $row->meta_id . '">'.$row->meta_content.'</a></div>';
I tried to do here, but it didn’t work, I just applied the filters to my function.. At least I understood that was it! I will post a Photo of what I did.
– Anderson Costa
You should apply the filters where you need the shortcode to be expanded. Usually this is in the template where it will be used, when printing on the same screen. Remembering that shortcodes do not expand within
input
ortextarea
– Ricardo Moraleida
I need the $Row->meta_content field to accept shortcodes, so I did that. http://imgur.com/a/0Qu7f Mas, it is a textarea field, if that is the problem, which field indicates me?
– Anderson Costa
So,
apply_filters()
returns the content with the expanded shortcode but you are not using this return. You need to put this where is the second mention to$row->meta_content
there. Copy this excerpt there in the question and I update with the example.– Ricardo Moraleida
I updated the question
– Anderson Costa
Updated with the code.
– Ricardo Moraleida
I think we’re almost there, there’s only one bug on the front now http://imgur.com/a/bxlq4
– Anderson Costa
This error is not related, it is the Xdebug that is complaining about the number of nesting levels. The solution is to disable the Xdebug or increase the limit, see here http://stackoverflow.com/questions/8656089/solution-for-fatal-error-maximum-function-nesting-level-of-100-reached-abor
– Ricardo Moraleida
Show, I’ll look for how to resolve this error!
– Anderson Costa
With do_shortcode($Row->meta_content) do not give this error any! Vlw by help!
– Anderson Costa