Skip to content

Instantly share code, notes, and snippets.

View StuffieStephie's full-sized avatar

Stephanie Q StuffieStephie

View GitHub Profile
@helen
helen / repeatable-fields-metabox.php
Created January 11, 2012 04:42
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@damianwajer
damianwajer / admin.js
Last active April 17, 2018 10:46
[WordPress] Conditional Meta Box / Custom fields depending on page template in WP Admin
jQuery( document ).ready( function ( $ ) {
var $pageTemplate = $( "#page_template" ),
$metaBoxID = $( "#meta_box_id" );
$pageTemplate.on( "change", function () {
if ( $( this ).val() == "templates/page-custom.php" ) {
$metaBoxID.show();
} else {
$metaBoxID.hide();
}