<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>plugin &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Sat, 12 Jul 2025 08:19:32 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>plugin &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Build your own "On This Day" page for WordPress]]></title>
		<link>https://shkspr.mobi/blog/2023/07/build-your-own-on-this-day-page-for-wordpress/</link>
					<comments>https://shkspr.mobi/blog/2023/07/build-your-own-on-this-day-page-for-wordpress/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 12 Jul 2023 11:34:10 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=46182</guid>

					<description><![CDATA[I blog. A lot. Too much really. One of the things I like to do is see what I was rambling on about this time last year. And the year before that. And so on.  So, here&#039;s my On This Day page and here&#039;s how I built it.  WARNING Extremely quick and dirty code ahead!  This allows you to add a shortcode like [ edent_on_this_day ] to a page and have it auto generate a list of posts you published on this …]]></description>
										<content:encoded><![CDATA[<p>I blog. A <em>lot</em>. Too much really. One of the things I like to do is see what I was rambling on about this time last year. And the year before that. And so on.</p>

<p>So, here's my <a href="https://shkspr.mobi/blog/on-this-day/">On This Day page</a> and here's how I built it.</p>

<p><strong>WARNING</strong> Extremely quick and dirty code ahead!</p>

<p>This allows you to add a shortcode like <code>[ edent_on_this_day ]</code> to a page and have it auto generate a list of posts you published on this day in previous years.  You may need to exclude that page from your cache.</p>

<p>Add these functions to your theme or to a new plugin:</p>

<pre><code class="language-php">function edent_on_this_day_shortcode() {
    $today = getdate();
    $args = array(
        'date_query' =&gt; array(
            array(
                'month' =&gt; $today['mon'],
                'day'   =&gt; $today['mday'],
            ),
        ),
    );
    $query = new WP_Query( $args );
    $posts = $query-&gt;get_posts();

    $today = getdate();
    $pubDate =  date("D, d M Y") . " 00:00:00 GMT";

    $output  = "&lt;h2&gt;From the " . date("jS \of F") . " archives&lt;/h2&gt;";
    $output .= "&lt;ul&gt;";

    foreach($posts as $post) {
        $title = $post-&gt;post_title;
        $id    = $post-&gt;ID;
        $link  = get_permalink($id);
        $date  = $post-&gt;post_date;
        $postDate = date("D, d M Y") . " " . date("h:i:s O", strtotime($date));
        // $thumb = get_the_post_thumbnail($id, 'full');

        $archive = "" . date("Y", strtotime($date)) . ": ";

        //  Only add an item if it is before *this year*
        if (
            intval(date("Y", strtotime($date))) &lt;  intval($today['year'])
        ) {
            $output .= '&lt;li&gt;&lt;a href="' . htmlspecialchars($link) .'"&gt;';
            $output .= html_entity_decode($archive . $title) . '&lt;/a&gt;&lt;/li&gt;';
        }
    }
    $output .= "&lt;/ul&gt;";
    return $output;
}

//  Set up the shortcode
function edent_on_this_day_shortcode_init() {
    add_shortcode( 'edent_on_this_day', 'edent_on_this_day_shortcode' );
}
add_action( 'init', 'edent_on_this_day_shortcode_init' );
</code></pre>

<p>I really can't be bothered to deal with WordPress's complicated plugin publishing system - so feel free to copy the above with or without attribution.</p>

<p>I originally built this as an RSS feed - but decided recently that a regular HTML page was more useful. If you spot any bugs, <a href="https://github.com/edent/WordPress-On-This-Day-Plugin">you can contribute on GitHub</a>.</p>

<p>Enjoy!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=46182&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/07/build-your-own-on-this-day-page-for-wordpress/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Adding restaurant review metadata to WordPress]]></title>
		<link>https://shkspr.mobi/blog/2023/01/restaurant-review-metadata/</link>
					<comments>https://shkspr.mobi/blog/2023/01/restaurant-review-metadata/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 22 Jan 2023 12:34:46 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[schema.org]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=44545</guid>

					<description><![CDATA[I&#039;ve started adding Restaurant Reviews to this blog - with delicious semantic metadata.  Previously I&#039;d been posting all my reviews to HappyCow.  It&#039;s a great site for finding veggie-friendly food around the worlds, but I wanted to experiment more with the IndieWeb idea of POSSE.  So now I can Post on my Own Site and Syndicate Elsewhere.  The Schema.org representation of a Restaurant is pretty…]]></description>
										<content:encoded><![CDATA[<p>I've started adding <a href="https://shkspr.mobi/blog/tag/restaurant-review/">Restaurant Reviews to this blog</a> - with <em>delicious</em> semantic metadata.  Previously I'd been posting <a href="https://www.happycow.net/members/profile/Edent">all my reviews to HappyCow</a>.  It's a great site for finding veggie-friendly food around the worlds, but I wanted to experiment more with the <a href="https://indieweb.org/POSSE">IndieWeb idea of POSSE</a>.  So now I can <strong>P</strong>ost on my <strong>O</strong>wn <strong>S</strong>ite and <strong>S</strong>yndicate <strong>E</strong>lsewhere.</p>

<p>The Schema.org representation of a Restaurant is pretty simple:</p>

<pre><code class="language-json">"itemReviewed": {
    "@type": "Restaurant",
    "name": "Example Bistro",
    "address": "42 Wallaby Way, Sydney",
    "hasMenu": "https://example.com/menu",
    "servesCuisine": "Vegetarian",
    "sameAs": "https://www.example.com/restaurant"
}
</code></pre>

<p>There are <a href="https://schema.org/Restaurant">many more metadata items</a> which could be added - but that's enough for my purposes.</p>

<p>I've written my own <a href="https://shkspr.mobi/blog/2020/07/adding-semantic-reviews-rich-snippets-to-your-wordpress-site/">WordPress theme to add Semantic Reviews</a>. It gives me a little UI box to add in all the essential data.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/01/review-UI-fs8.png" alt="Screenshot of a user interface which allows the entry of data." width="501" height="498" class="aligncenter size-full wp-image-44564">

<p>Once all that's fed in, it's converted to JSON+LD which looks like this:</p>

<pre><code class="language-json">{
    "@context": "https:\/\/schema.org",
    "@type": "Review",
    "author": {
        "@type": "Person",
        "name": "Terence Eden",
        "sameAs": [""]
    },
    "url": "https:\/\/shkspr.mobi\/blog\/?p=44547",
    "datePublished": "2023-01-20T12:34:10+00:00",
    "publisher": {
        "@type": "Organization",
        "name": "Terence Eden\u2019s Blog",
        "sameAs": "https:\/\/shkspr.mobi\/blog"
    },
    "description": "If you've visiting Batu Caves in Kuala Lumpur, I have two tips for you. Firstly, get there as early as possible in order to avoid the heat and other tourists. Secondly, after climbing a mountain of ",
    "inLanguage": "en-GB",
    "itemReviewed": {
        "@type": "Restaurant",
        "name": "Rani Vilas Restaurant Batu Caves",
        "address": "Jalan Batu Caves, Batu Caves, Malaysia, 68100",
        "sameAs": "http:\/\/www.facebook.com\/RaniVilasRestaurantBatuCaves",
        "hasMenu": "https:\/\/www.foodpanda.my\/restaurant\/w1rb\/rani-vilas-restaurant-shop",
        "servesCuisine": "Vegetarian Indian",
        "image": "https:\/\/shkspr.mobi\/blog\/wp-content\/uploads\/2023\/01\/rani.jpg",
        "aggregateRating": {
            "@type": "AggregateRating",
            "ratingValue": "5",
            "reviewCount": "1",
            "worstRating": 0,
            "bestRating": 5
        }
    },
    "reviewRating": {
        "@type": "Rating",
        "worstRating": 0,
        "bestRating": 5,
        "ratingValue": "5"
    },
    "thumbnailUrl": "https:\/\/shkspr.mobi\/blog\/wp-content\/uploads\/2023\/01\/rani.jpg"
}
</code></pre>

<p>The somewhat messy <a href="https://gitlab.com/edent/blog-theme/">code is available on my GitLab</a>. If there's any interest, I might turn it into a separate WordPress plugin.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=44545&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/01/restaurant-review-metadata/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Howto: Disable image pop-ups in WordPress comments]]></title>
		<link>https://shkspr.mobi/blog/2020/06/howto-disable-image-pop-ups-in-wordpress-comments/</link>
					<comments>https://shkspr.mobi/blog/2020/06/howto-disable-image-pop-ups-in-wordpress-comments/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 10 Jun 2020 11:41:05 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=35279</guid>

					<description><![CDATA[If you have the Akismet spam plugin for WordPress, you&#039;ll be familiar with this problem.  When your mouse pointer goes over any URL, you get a large website preview taking over parts of your screen.  I asked for a way to turn this off and I&#039;m happy to say the developers listened!  Sadly, there&#039;s no tickbox option, only a WordPress filter so you&#039;ll have to add the following scrap of code to your…]]></description>
										<content:encoded><![CDATA[<p>If you have the Akismet spam plugin for WordPress, you'll be familiar with this problem.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2020/06/mshots-pop-up-fs8.png" alt="An mshots popup obscuring the screen." width="1442" height="406" class="aligncenter size-full wp-image-35280">
When your mouse pointer goes over any URL, you get a large website preview taking over parts of your screen.</p>

<p>I <a href="https://wordpress.org/support/topic/how-to-disable-mshots-service/">asked for a way to turn this off</a> and I'm happy to say the developers listened!</p>

<p>Sadly, there's no tickbox option, <a href="https://developer.wordpress.org/reference/functions/add_filter/">only a WordPress filter</a> so you'll have to add the following scrap of code to your theme's <code>functions.php</code> file.</p>

<pre><code class="language-php">function disable_akismet_mshots( $value ) {
   return false;
}
add_filter( 'akismet_enable_mshots', 'disable_akismet_mshots' );
</code></pre>

<p>I placed it at the end of the file - but check your theme's documentation.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=35279&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2020/06/howto-disable-image-pop-ups-in-wordpress-comments/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
