Skip to content

Instantly share code, notes, and snippets.


Yakir Sitbon KingYes

View GitHub Profile
bjornjohansen /
Last active Feb 23, 2022
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See for more details.
# Check if WP-CLI is available
if ! hash wp 2>/dev/null; then
Rarst / WordPress.xml
Last active Aug 5, 2021
WordPress Live Templates for PhpStorm
View WordPress.xml
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="WordPress">
<template name="aa" value="add_action( '$hook$', '$callback$' );&#10;$END$" description="add_action" toReformat="false" toShortenFQNames="true">
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" />
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
KingYes /
Created Nov 26, 2013
Encode audio files (VBR Profile) and preserve id3 tags used with `lame` program.
# -*- coding: utf-8 -*-
Encode audio files (VBR Profile) and preserve id3 tags
used with `lame` program.
@Author: Yakir Sitbon <>
@Version: 1.0
import os
KingYes / omer-count.php
Created Apr 9, 2013
Very PHP Simple method for counting of the Omer.
View omer-count.php
* Very Simple method for Omer count.
* @return bool|int Omer count or false if out Omer range date.
* @author Yakir Sitbon (
function yakir_get_omer_count() {
// Get now jd date.
Rarst / backtrace-error-handler.php
Created Oct 4, 2012
Error handler with WordPress backtrace in message.
View backtrace-error-handler.php
set_error_handler( 'backtrace_error_handler', error_reporting() );
function backtrace_error_handler( $errno, $errstr, $errfile, $errline, $errcontext ) {
// handle @
if( 0 === error_reporting() )
return false;
Rarst /
Last active Aug 9, 2022
WordPress coding standards configuration for PhpStorm

Now Native

PhpStorm now bundles WordPress coding style natively, starting from version 8.

  1. Go to Project Settings > Code Style > PHP.
  2. Select Set From... (top right of window) > Predefined Style > WordPress.

No longer need to muck with this import! :)