Skip to content

Instantly share code, notes, and snippets.

@duoeg
duoeg / font-awesome-icons.php
Created January 16, 2020 14:16
List of Font Awesome icons for PHP
/**
* Returns a list of icons for the desired type.
* Supported values: "all" (default) | "brands" | "light" | "regular" | "solid" | "duotone"
* At the time of writing this function, current version is 5.12.0.
*/
function font_awesome($type = "all") {
$fa = array();
$brands = array( "fa-500px","fa-accessible-icon","fa-accusoft","fa-acquisitions-incorporated","fa-adn","fa-adobe","fa-adversal","fa-affiliatetheme","fa-airbnb","fa-algolia","fa-alipay","fa-amazon","fa-amazon-pay","fa-amilia","fa-android","fa-angellist","fa-angrycreative","fa-angular","fa-app-store","fa-app-store-ios","fa-apper","fa-apple","fa-apple-pay","fa-artstation","fa-asymmetrik","fa-atlassian","fa-audible","fa-autoprefixer","fa-avianex","fa-aviato","fa-aws","fa-bandcamp","fa-battle-net","fa-behance","fa-behance-square","fa-bimobject","fa-bitbucket","fa-bitcoin","fa-bity","fa-black-tie","fa-blackberry","fa-blogger","fa-blogger-b","fa-bluetooth","fa-bluetooth-b","fa-bootstrap","fa-btc","fa-buffer","fa-buromobelexperte","fa-buy-n-la
@heldervilela
heldervilela / update_theme.php
Created September 13, 2017 14:26
How to integrate WordPress Core updates with your custom Plugin or Theme
<?php
/**
* How to integrate WordPress Core updates with your custom Plugin or Theme
*
* Filter the `update_plugins` transient to report your plugin as out of date.
* Themes have a similar transient you can filter.
*/
add_filter( 'site_transient_update_plugins', 'wprp_extend_filter_update_plugins' );
add_filter( 'transient_update_plugins', 'wprp_extend_filter_update_plugins' );
function wprp_extend_filter_update_plugins( $update_plugins ) {
@bitfade
bitfade / gist:4555047
Last active January 21, 2022 03:06
WordPress - Remove empty p tags for custom shortcodes
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag