Skip to content

Instantly share code, notes, and snippets.

View samediamba's full-sized avatar

Samedi S. Amba samediamba

View GitHub Profile
@samediamba
samediamba / wp-admin-select2.php
Created April 7, 2022 13:41 — forked from yanknudtskov/wp-admin-select2.php
Add select2 to all select fields in WordPress Admin
<?php
function enqueue_select2_jquery() {
wp_register_style( 'select2css', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.css', false, '1.0', 'all' );
wp_register_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.js', array( 'jquery' ), '1.0', true );
wp_enqueue_style( 'select2css' );
wp_enqueue_script( 'select2' );
}
add_action( 'admin_enqueue_scripts', 'enqueue_select2_jquery' );
@samediamba
samediamba / add-wordpress-settings-page.php
Created March 24, 2022 10:47 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@samediamba
samediamba / functionality.php
Last active March 1, 2022 04:38 — forked from haizdesign/functions.php
Show featured images on post screen - Admin Dashboard
<?php
// show featured images in dashboard
add_image_size( 'haizdesign-admin-post-featured-image', 120, 120, false );
// Add the posts and pages columns filter. They both use the same function.
add_filter('manage_posts_columns', 'haizdesign_add_post_admin_thumbnail_column', 2);
add_filter('manage_pages_columns', 'haizdesign_add_post_admin_thumbnail_column', 2);
// Add the column
@samediamba
samediamba / gist:65f0c554f3821fb221af98bb315c17fd
Created December 11, 2017 12:09 — forked from dopa/gist:5245868
Shell Script to Back Up all MySQL Databases, Keep 7 Days of Backups
#!/bin/bash
# Script will output dumps for all databases using seperate files
# Derived from this post: http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/
USER="root"
PASSWORD="SnM1073k"
HOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
OUTPUT_DIR="/backups/files"
<?php
/**
* Home Slider
*
* Uses the Genesis Responsive slider combined with Advanaced Custom Fields
* setting in Dashboard - Instellingen website
*/
function rrwd_home_slider() {
global $wpdb;
<?php
/**
* Custom Body Classes
* @link http://www.billerickson.net/wordpress-class-body-tag/
* @author Bill Erickson
*
* @param array $classes existing body classes
* @return array modified body classes
*/