Skip to content

Instantly share code, notes, and snippets.

View racmanuel's full-sized avatar
💡
Making new things!

Manuel Ramirez Coronel racmanuel

💡
Making new things!
View GitHub Profile
@svlasov
svlasov / testlisttable.php
Created April 25, 2012 08:14 — forked from Latz/testlisttable.php
Sample plugin for usage of WP_List_Table class (basic version)
<?php
/*
Plugin Name: Test List Table Example
*/
if( ! class_exists( 'WP_List_Table' ) ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}
class My_Example_List_Table extends WP_List_Table {
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@stephenh1988
stephenh1988 / simple-admin-page.php
Created September 8, 2012 15:59
A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes.
<?php
/*
Description: A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes.
Author: Stephen Harris
Author URI: http://www.stephenharris.info
*/
/* Copyright 2011 Stephen Harris (contact@stephenharris.info)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@spivurno
spivurno / gist:4005684
Last active October 31, 2022 20:45 — forked from spivurno/gist:3708752
Gravity Wiz // Limit How Many Checkboxes Can Be Checked (and How Many MUST Be Checked)
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-limit-checkboxes.php
*/
/**
* Limit How Many Checkboxes Can Be Checked
* http://gravitywiz.com/2012/06/11/limiting-how-many-checkboxes-can-be-checked/
*/
@gatespace
gatespace / view_template_files.php
Last active July 30, 2022 22:04
WordPressのテーマにおいて、テンプレート階層に基づきどのテンプレートファイルが使われているか書き出すコード。 WordPressがデバッグモードのときのみ表示します。 使っているテンプレートファイルはグローバル変数 $template に保存されています。 (ただし、header.php や get_template_part などでインクルードされているファイルを除く) wp_footerにフックする形で関数が実行されますので、テーマのfunctions.phpの適当な箇所に追記してください。
/*
WordPressのテーマにおいて、テンプレート階層に基づきどのテンプレートファイルが使われているか書き出すコード。
ただし、header.php や get_template_part などでインクルードされているファイルを除く。
*/
add_action('wp_footer', 'view_template_files');
if ( !function_exists( 'view_template_files' ) ):
function view_template_files() {
if ( defined('WP_DEBUG') && WP_DEBUG ) {
global $template;
@paulund
paulund / example-wp-list-table.php
Last active May 20, 2024 05:29
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
@woogist
woogist / woocommerce-customer-order-csv-export-add-additional-columns.php
Created February 6, 2014 03:28
WooCommerce Customer/Order CSV Export: Add additional columns
<?php
// add custom column headers
function wc_csv_export_modify_column_headers( $column_headers ) {
$new_headers = array(
'column_1' => 'Column 1',
'column_2' => 'Column 2',
// add other column headers here in the format column_key => Column Name
);
@cristianstan
cristianstan / Simple Ajax Login Form.php
Last active June 11, 2024 21:11
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
?>
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>
@mheywood90
mheywood90 / cf7_external_db.php
Last active September 27, 2022 17:02
Contact Form 7 to External DB
<?php
/*
Plugin Name: Contact Form 7 to External DB
Plugin URI: http://thedrawingroomcreative.com
Description: This plugin uses the wpcf7_before_send_mail hook to post a specific form to an external database. Upon use the details for your external database will need to be entered. Private use only.
Author: The Drawing Room
Version: 0.1
Author URI: http://thedrawingroomcreative.com
*/
@greenhornet79
greenhornet79 / gist:2a8ad06249669e2e9093
Created September 2, 2014 19:28
Add Gravity Forms data to custom database table
add_action('gform_after_submission', 'endo_add_entry_to_db', 10, 2);
function endo_add_entry_to_db($entry, $form) {
// uncomment to see the entry object
// echo '<pre>';
// var_dump($entry);
// echo '</pre>';
$source = $entry['source_url'];