Skip to content

Instantly share code, notes, and snippets.

@sparanoid
Created March 1, 2019 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sparanoid/a59b07b4958f7709c5236dc3934f6896 to your computer and use it in GitHub Desktop.
Save sparanoid/a59b07b4958f7709c5236dc3934f6896 to your computer and use it in GitHub Desktop.

Input:

<span title="<?php get_the_last_modified_timestamp()); ?>">
  Last modified: <?php echo get_the_last_modified_timestamp('single-post', array('datef' => 'Y-m-d', 'format' => '%date%')); ?>
</span>

Expected:

<span title="2019-02-02@12:32">
  Last modified: 2019-02-02
</span>

Actual:

<span title="<span class="last-modified-timestamp">2019-02-02@12:32</span>">
  Last modified: <span class="last-modified-timestamp">2019-02-02</span>
</span>

which is invalid HTML.

@aaemnnosttv
Copy link

aaemnnosttv commented Mar 1, 2019

Try this

<span title="<?php echo wp_strip_all_tags(get_the_last_modified_timestamp()); ?>">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment