WordPress: Comment Hook – Trigger Action Example

Actions are the hooks that the WordPress core launches at specific points during execution, or when specific events occur.

To trigger the action firstly you need to write a custom function known as a callback, and then register it with a WordPress hook using the add_action function in your child theme’s functions.php file.

This note shows the examples of how to trigger some action when a new comment is posted on a WordPress site, e.g. send an email or a message to a Telegram channel. (more…)

Run PHP Script From Command Line

A PHP script can be executed from the command line even without having any web server software installed.

To run the PHP script from the command line you should just have a PHP CLI (PHP Command Line Interface) installed on your system.

This note shows how to run the PHP script from the command line and how to get the PHP CLI installed on Windows, Linux and MacOS. (more…)

Windows: Startup Folder – Add Program to Startup

A program in Windows can be configured to automatically start on boot by placing its shortcut in a Windows startup folder.

There are two types of the startup folders in Windows – a user startup folder used to autostart applications for the particular user only and a system startup folder to configure the startup of the programs for the all users.

This note shows how to easily locate the startup folders in Windows and how add the programs to autostart by placing their shortcuts in the startup folders. (more…)

Git: Show Remote URL & Check Origin

Remotes in Git are simply aliases that store the URLs of repositories.

By convention, an origin is the alias of the default remote repository where you publish your commits.

In Git you can work with several remotes with different aliases.

From this note you will find out how to show the configured remote URLs of a local Git repository, including the origin URL. (more…)