Skip to content

Instantly share code, notes, and snippets.

View ronalfy's full-sized avatar
🏠
Working from home

Ronald Huereca ronalfy

🏠
Working from home
View GitHub Profile
@danieliser
danieliser / functions.php
Last active April 13, 2023 16:48
Fetch Active Install Count from WordPress Plugins API
<?php
function get_plugin_install_count( $plugin ) {
$api = plugins_api( 'plugin_information', array(
'slug' => 'popup-maker',
'fields' => array( 'active_installs' => true )
) );
if( ! is_wp_error( $api ) ) {
return $api->active_installs;
}
@ethanclevenger91
ethanclevenger91 / functions.php
Last active November 30, 2016 19:09
All in One Event Calendar - Adding filters + functions to Twig themes For more reading on uses of functions vs. filters in Twig: http://twig.sensiolabs.org/doc/advanced.html
function add_twig_functions_and_filters() {
global $ai1ec_front_controller;
$loader = $ai1ec_front_controller->return_registry(true)->get('theme.loader');
$twig = $loader->get_twig_instance(false, true);
function foo($date) {
if(mktime() > strtotime($date->__toString)) {
return true;
}
else return false;
}
@chuckreynolds
chuckreynolds / wordpress-remove-seo-columns.php
Last active March 29, 2020 06:17 — forked from norcross/remove-seo-columns.php
remove WordPress SEO columns from admin post tables
<?php
function rkv_remove_columns( $columns ) {
// remove the Yoast SEO columns
unset( $columns['wpseo-score'] );
unset( $columns['wpseo-title'] );
unset( $columns['wpseo-metadesc'] );
unset( $columns['wpseo-focuskw'] );
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/