Remove the admin bar from the WordPress admin backend

Hiding the WordPress admin bar programmatically on the backend

Whenever you are logged in to WordPress, there is a black admin bar that shows up above every page. On front-end pages, you can call show_admin_bar(false) in one of your plugin or theme functions to remove it. Individual users can also hide the admin bar on their account’s profile page.

All of this, however, doesn’t work if you are on a backend page. No matter what you do, the admin bar will always show up in those circumstances, unless you remove the admin bar programmatically — this article is here to show you how, as well as why you would want to do such a thing.

Continue reading
Creating a Farming RPG (like Harvest Moon) in Unity — Part 6: Managing In-Game Time

Creating a Farming RPG (like Harvest Moon) in Unity — Part 6: Managing In-Game Time

This article is a part of the series:
Creating a Farming RPG (like Harvest Moon) in Unity

Ever wanted to create a game like Harvest Moon in Unity? Check out Part 6 of our guide here, where we go through how to set up a day-night cycle and manage in-game time. You can also find Part 5 of our guide here, where we went through how to create an item equipping system.

Continue reading
Creating a Farming RPG in Unity - Part 5: Equipping Items

Creating a Farming RPG (like Harvest Moon) in Unity — Part 5: Equipping Items

This article is a part of the series:
Creating a Farming RPG (like Harvest Moon) in Unity

Ever wanted to create a game like Harvest Moon in Unity? Check out Part 5 of our guide here, where we go through how to equip and unequip items. You can also find Part 4 of our guide here, where we went through how to create an item management system.

Continue reading
Creating a Farming RPG in Unity - Part 4: Item Management

Creating a Farming RPG (like Harvest Moon) in Unity — Part 4: Item Management

This article is a part of the series:
Creating a Farming RPG (like Harvest Moon) in Unity

Ever wanted to create a game like Harvest Moon in Unity? Check out Part 4 of our guide here, where we go through how to create an item management system. You can also find Part 3 of our guide here, where we went through how to set up farmland elements that our player character will interact with.

Continue reading
Creating a farming RPG in Unity - Part 3: Farmland Interaction

Creating a Farming RPG (like Harvest Moon) in Unity — Part 3: Farmland Interaction

This article is a part of the series:
Creating a Farming RPG (like Harvest Moon) in Unity

Correction: In the video, we made a reference to the PlayerController component in the PlayerInteraction class. However, we later found that we didn’t make use of it at least in this part, so you can choose to skip that bit in the video for now, as it is redundant. They are highlighted in red in the finalised codes below.

Ever wanted to create a game like Harvest Moon in Unity? This is Part 3 of our guide, where we go through how to set up farmland elements that our player character will interact with. You can also find Part 2 of our guide here, where we went through how to set up our player camera.

Continue reading
Pretty Computer Chips
Image by Jonas Svidras at https://stocksnap.io/photo/intel-8008-LBYK1XTHFC.

Passing a variable by value vs. reference

In programming, a concept that usually creates a lot of confusion among those new to it is the concept of passing a variable by value, versus passing a variable by reference. The 2 examples below illustrate the difference between these two ways variables can be passed in Java:

Continue reading
Creating a farming RPG in Unity - Part 2: Basic Camera

Creating a Farming RPG (like Harvest Moon) in Unity — Part 2: Basic Camera

This article is a part of the series:
Creating a Farming RPG (like Harvest Moon) in Unity

Ever wanted to create a game like Harvest Moon in Unity? Check out Part 2 of our guide here, where we go through how to create a camera that follows our player character around. You can also find Part 1 of our guide here, where we went through how to set up our player character.

Continue reading
Creating a farming RPG in Unity - Part 1: Movement

Creating a Farming RPG (like Harvest Moon) in Unity — Part 1: Movement

This article is a part of the series:
Creating a Farming RPG (like Harvest Moon) in Unity

Ever wanted to create a game like Harvest Moon in Unity? Check out Part 1 of our guide here, where we go through how to create animations and movement for the player character.

Continue reading
A formula for rounding number

A formula for rounding numbers

Most programming languages come with native functions that help us round our numbers, either upwards (i.e. ceiling operation), downwards (i.e. floor operation), or to the nearest whole (i.e. round operation). While this is convenient, we sometimes need a bit more than that — what if — for example — we want to round our numbers to the nearest 0.5, or the nearest 3rd?

Continue reading
PHP mail not delivering domain emails to external mail server

PHP mail not sending domain emails to external mail server

Recently, I’ve done some work for a client with an odd issue: the contact forms on their website (let’s call it client-website.com) — which delivered completed form enquiries using PHP’s mail() function — could not send emails through to email addresses containing their own domain.

This means that, if we were to set the form to deliver enquiries to an address like hello@client-website.com, the email would be completely dropped — you would neither find it in the junk or spam folders, nor find any trace of the email in their admin and mail logs. If we delivered the email to our own personal email addresses (e.g. personal@gmail.com), or to emails from another domain (e.g. mail@terresquall.com), then the email would go through (and skip right past the spam folder too).

For weeks, this problem confounded me, until now… and it’s actually a really simple fix.

Continue reading