Skip to content

Instantly share code, notes, and snippets.

Miguel Estrada mae829

Block or report user

Report or block mae829

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active Jul 16, 2019
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
View webstoemp-gulpfile.js
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@andrewlimaza
andrewlimaza / jquery-datepicker-wp-admin
Created Jul 24, 2017 — forked from slushman/jquery-datepicker-wp-admin
How to Add the jQuery UI Datepicker to the WordPress Admin
View jquery-datepicker-wp-admin
/**
* Adds the datepicker settings to the admin footer.
* Only loads on the plugin-name settings page
*/
function admin_footer() {
$screen = get_current_screen();
if ( $screen->id == 'settings_page_plugin-name' ) {
View README.md

Custom Gutenberg Block

This is a basic custom Gutenberg block. Files explained below.

  • block.js — We register Custom Gutenberg block here.
  • editor.css _ Block CSS for the editor.
  • style.css — Block CSS for the front end.
  • index.php — Enqueue block's assets for editor and the front end.
View multidimensional repeaters in ACF throwing warnings
<?php
global $post;
if ( function_exists( 'acf_add_local_field_group' ) ) :
acf_add_local_field_group(array(
'key' => 'group_58bff7f25c321',
'title' => 'Garderobsbyggaren',
'fields' => array(),
'location' => array(
array(
@nickdavis
nickdavis / acf-fields-repeater.php
Created Nov 10, 2016
Advanced Custom Fields > Repeater field example (set programatically)
View acf-fields-repeater.php
<?php
add_action( 'acf/init', 'nd_acf_add_local_field_groups' );
/**
* Add Advanced Custom Fields programatically (Repeater field).
*
* @link https://www.advancedcustomfields.com/resources/register-fields-via-php/
* @link https://support.advancedcustomfields.com/forums/topic/register-two-locations-via-php-doesnt-work/
* @link https://support.advancedcustomfields.com/forums/topic/adding-additional-layout-to-flexible_content-field-in-child-theme/
*
@anttiviljami
anttiviljami / wp-admin-modal-dialog.php
Last active May 30, 2019
WordPress admin modal dialog example
View wp-admin-modal-dialog.php
<?php
// enqueue these scripts and styles before admin_head
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though...
wp_enqueue_style( 'wp-jquery-ui-dialog' );
?>
<!-- The modal / dialog box, hidden somewhere near the footer -->
<div id="my-dialog" class="hidden" style="max-width:800px">
<h3>Dialog content</h3>
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p>
@ajskelton
ajskelton / WP Customizer - Dropdown-pages
Last active Jul 12, 2019
Add a Dropdown-pages field to the WordPress Customizer.
View WP Customizer - Dropdown-pages
$wp_customize->add_setting( 'themeslug_dropdownpages_setting_id', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'themeslug_sanitize_dropdown_pages',
) );
$wp_customize->add_control( 'themeslug_dropdownpages_setting_id', array(
'type' => 'dropdown-pages',
'section' => 'custom_section', // Add a default or your own section
'label' => __( 'Custom Dropdown Pages' ),
'description' => __( 'This is a custom dropdown pages option.' ),
@igorbenic
igorbenic / code.php
Last active Apr 4, 2019
How to create WordPress Metaboxes with OOP
View code.php
<?php
class IBenic_WordPress_Metabox extends WordPressSettings {
protected $title = '';
protected $slug = '';
protected $post_types = array();
@ms-studio
ms-studio / add-term-to-custom-taxonomy.php
Created Dec 15, 2015
add term metabox to custom taxonomy - using WP 4.4 term meta functions
View add-term-to-custom-taxonomy.php
<?php
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy
// code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup
// CREATE CUSTOM TAXONOMY
add_action( 'init', '___create_my_custom_tax' );
@zach-adams
zach-adams / vagrant_halt_custom
Created Jul 15, 2015
A copy of the db_backup script that automatically copies the backups to the sync folder
View vagrant_halt_custom
#!/bin/bash
#
# Create individual SQL files for each database. These files
# are imported automatically during an initial provision if
# the databases exist per the import-sql.sh process.
mysql -e 'show databases' | \
grep -v -F "information_schema" | \
grep -v -F "performance_schema" | \
grep -v -F "mysql" | \
grep -v -F "test" | \
You can’t perform that action at this time.