Skip to content

Instantly share code, notes, and snippets.

View anastis's full-sized avatar

Anastis Sourgoutsidis anastis

View GitHub Profile
@anastis
anastis / class-cssigniter-fontawesome-convert-4-to-5.php
Last active July 5, 2019 09:11
Simple class to convert FontAwesome 4.x icon codes to FontAwesome 5.x
<?php
class CSSIgniter_Fontawesome_Convert_4_to_5 {
public static $fa5_prefixes = array(
'fas', // Solid
'far', // Regular
'fal', // Light
'fab', // Brands
);
public static function convert( $icon_4, $return = 'string' ) {
<?php
/*
Plugin Name: Custom Registration Fields
Plugin URI:
Description:
Version: 0.1
Author: CSSIgniter
Author URI:
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
<?php
class My_Dropdown_Category_Control extends WP_Customize_Control {
public $type = 'dropdown-category';
protected $dropdown_args = false;
protected function render_content() {
?><label><?php
@anastis
anastis / inline_styles.php
Created March 7, 2017 22:27
Inlining styles in WordPress without an actual CSS file
<?php
add_action( 'some_hook', 'maxslider_enqueue_slider_css' );
function maxslider_enqueue_slider_css() {
$css = '';
// ...
if ( true === $something ) {
$css = 'body { background-color: ' . $color . '; }';
}