Skip to content

Instantly share code, notes, and snippets.

View KingYes's full-sized avatar

Yakir Sitbon KingYes

View GitHub Profile
@KingYes
KingYes / insert-in-your-functions.php
Created January 29, 2015 12:33
Polylang multilang Logo with Pojo theme
function pojo_polylang_get_multilang_sticky_logo( $value ) {
if ( function_exists( 'pll_current_language' ) ) {
$logos = array(
'en' => 'logo-sticky-en.png',
'he' => 'logo-sticky-he.png',
);
$default_logo = $logos['en'];
$current_lang = pll_current_language();
$assets_url = get_stylesheet_directory_uri() . '/assets/images/';
@KingYes
KingYes / insert-in-your-functions.php
Created January 29, 2015 12:35
pojo.me + WPML: Change your sticky logo by language
function pojo_wpml_get_multilang_sticky_logo( $value ) {
if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
$logos = array(
'en' => 'logo-sticky-en.png',
'he' => 'logo-sticky-he.png',
);
$default_logo = $logos['en'];
$current_lang = ICL_LANGUAGE_CODE;
$assets_url = get_stylesheet_directory_uri() . '/assets/images/';
@KingYes
KingYes / patch.php
Created March 25, 2015 06:56
Fixes EDD Software Licenses - Past payments after EDD Upgrade to v2.3
<?php
global $wpdb;
$license_ids = $wpdb->get_col(
"SELECT `post_id` FROM {$wpdb->postmeta}
WHERE `meta_key` LIKE '_edd_sl_user_id'
AND `meta_value` = '0';"
);
if ( ! empty( $license_ids ) ) {
$payment_ids = array();
@KingYes
KingYes / functions.php
Last active August 29, 2015 14:26
Added custom post in Pojo Recent Posts Widget
/**
* @param array $fields
* @param WP_Widget $widget_obj
*
* @return array
*/
function pojo28831_add_custom_post_type_in_recent_posts_widget( $fields, $widget_obj ) {
$fields[] = array(
'id' => '_custom_post_type',
'title' => __( 'Post Type:', 'pojo' ),
@KingYes
KingYes / run-wp-cron.sh
Last active December 31, 2019 07:09 — forked from bjornjohansen/run-wp-cron.sh
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
#!/bin/bash
# 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 http://www.wtfpl.net/ for more details.
WP_PATH="/your/wp/path/"
WP_CLI="/usr/local/bin/php /usr/local/bin/wp"
# Check if WP-CLI is available