Marinus Klasen

Marinus Klasen

  • Development
  • Consultancy
  • Developer Resources
  • Blog
  • Contact

Dump / pretty print a JSON object in React

July 28, 2022

To quickly debug something, or temporarily show the data object during development, just to know what you’re working with, it comes in handy to print the full JSON object. Not as a string that’s almost impossible to read, but as a well formatted array. We’ve got a neat little one-liner for that, which I’ll share […]

Continue Reading

Updating custom post meta via the WordPress REST API

July 24, 2022

When working with the WordPress REST API we sometimes have to update custom post meta for a (custom post type) post. In my case, I am using the available REST endpoints but I did want to add some extra data to the GET request, and wanted to make it possible to update that data as […]

Continue Reading

Updating a post in WordPress using Fetch

July 23, 2022

In this post we’ll go through the steps of updating a post in WordPress using the Fetch API in Javascript. We’ll focus on authenticated users in the front or backend of WordPress and use the nonce that’s available on every page. A snippet to update a post in the WordPress REST API In the snippet […]

Continue Reading

Get the current taxonomy ID in WordPress

July 20, 2022

Another short snippet-style article for today; How do you get the current term or taxonomy object in WordPress? Sometimes, when developing plugins or themes, you need to get more details on the current term page the website visitor is looking at. We can load term meta by using get_term_meta functions, but what if we want […]

Continue Reading

wp-cli: wp db size in MB

July 15, 2022

Another short blog post that allows you to quickly copy the command to get you a human readable database size from wp-cli. wp db size shows you bytes. We can’t read that. Let’s make it human readable: It doesn’t get easier than that, Happy developing!

Continue Reading

WordPress Plugin: Copy Code from Block Editor Code Block

June 9, 2022

An easy way to copy code blocks from the WordPress Block Editor A plugin that I wanted to create for a while already, especially for this very site. Download the plugin here Example: Checkout the Github repo: https://github.com/mklasen/copy-code-blocks/

Continue Reading

Set a static IP for docker-compose containers

May 25, 2022

I have an amazing setup on my office. It’s an extended version of Halcyon, with a VPN and DNS container. But there is was one thing that was going wrong.. Each time I restarted the server (or that time when a power outage occurred), the container’s internal IP addresses would change. The VPN container, and […]

Continue Reading

Justified auto width and height in Media Carousel Widget in Elementor

May 18, 2022

Update: It appeared the solution below still had some horizontal scrolling/spacing issues. I’ve created a plugin to solve these. In order to solve these issues once and for all, I’ve created a plugin that updates the Swiper instance created by Elementor. Click here to download the plugin, or visit the Github repository After activating the […]

Continue Reading

Using the WordPress REST API

May 18, 2022

The WordPress REST API has become the go-to for any communication between the front-end and back-end. We’ve come a long way, from using admin-ajax to a professional, flexible and extendible REST API. Registering routes Registering a REST endpoint is pretty easy, below you’ll find some ready-to-use code, including the plugin headers. This is everything you […]

Continue Reading
  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 11
  • Next Page »

Ready to take action?

I'm looking forward to discuss your projects and goals!
Feel free to reach out using the contact details below.

Marinus Klasen

[email protected]
twitter.com/marinusklasen
linkedin.com/in/marinusklasen

  • GitHub
  • LinkedIn
  • Twitter

Have you read?

  • Storing private data with SSH on WPEngine sitesDecember 15, 2022
  • Get the HTML content of a block edit page or post in WordPressNovember 30, 2022
  • Rename Coupon code text to Discount code in WoocommerceNovember 3, 2022
  • Background-size cover in mPDFOctober 22, 2022
  • WordPress.com SSH & duplicating a WordPress.com website locallyOctober 11, 2022

Copyright © 2023 · Marinus Klasen | Webdesign by Team Rood