0

I got this echo doo_isset($postmeta,'youtube_id');

and return this result in Wordpress post: [iNJaoIZTHh0]

Can please help me to remove the square brackets for result to be only: iNJaoIZTHh0

I tried to find something useful on other websites but nothing until now.

PS. Thanks C3roe, right answer is:

echo trim(doo_isset($postmeta,'youtube_id'), '[]');

5
  • 1
    Have you tried str_replace? Commented Aug 12, 2024 at 13:28
  • I tried: <span class="clsCatOffCount"><?php echo doo_isset($postmeta,'youtube_id'); ?></span> <script type="text/javascript"> $(".clsCatOffCount").html(function() { return $(this).html().replace("[", "").replace("]", ""); }); </script> but is not working ... Commented Aug 14, 2024 at 8:04
  • If you have any code related to your question, please edit the question itself, don't just post comments. Commented Aug 14, 2024 at 13:17
  • I'm fairly certain you will not be able to solve this in JavaScript. I would look into do_shortcode along with the embed shortcode. Commented Aug 14, 2024 at 13:19
  • echo trim(doo_isset($postmeta,'youtube_id'), '[]'); Commented Aug 19, 2024 at 12:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.