Skip to content

Instantly share code, notes, and snippets.

@anastis
anastis / inline_styles.php
Created Mar 7, 2017
Inlining styles in WordPress without an actual CSS file
View inline_styles.php
<?php
add_action( 'some_hook', 'maxslider_enqueue_slider_css' );
function maxslider_enqueue_slider_css() {
$css = '';
// ...
if ( true === $something ) {
$css = 'body { background-color: ' . $color . '; }';
}
View dropdown-category.php
<?php
class My_Dropdown_Category_Control extends WP_Customize_Control {
public $type = 'dropdown-category';
protected $dropdown_args = false;
protected function render_content() {
?><label><?php
View registration-fields.php
<?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
@anastis
anastis / class-cssigniter-fontawesome-convert-4-to-5.php
Last active Jul 5, 2019
Simple class to convert FontAwesome 4.x icon codes to FontAwesome 5.x
View class-cssigniter-fontawesome-convert-4-to-5.php
<?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' ) {