Skip to content

Instantly share code, notes, and snippets.

@isotrope
isotrope / quick-acf-fieldnames.js
Last active March 18, 2020 19:03
Smalll script to quickly gather ACF field names
/*
* Stick me in your console and run
*/
(function ( $ ) {
var fields = '',
php = '',
letAcfFormatTheValues = true,
@isotrope
isotrope / symbolic link
Last active June 1, 2018 13:55
Symbolic links Windows through command line
@iamphilrae
iamphilrae / phpMyAdmin Export Filename Template, Including Date and Time
Last active April 3, 2024 20:30
phpMyAdmin Export Filename Template, Including Date and Time
@DATABASE@__%Y-%m-%d_%H-%M-%S
@tomazzaman
tomazzaman / README.md
Last active September 17, 2023 20:59
Gulp workflow for WordPress theme development

Gulp workflow for WordPress theme development

Requirements

In order for Livereload to work, you need a Firefox or Chrome extension as Gulp doesn't inset it automatically. Alternatively, you can also manually put the livereload script in footer.php, just make sure to insert it only on development environment:

<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
@Rarst
Rarst / WordPress.xml
Last active August 5, 2021 04:14
WordPress Live Templates for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="WordPress">
<template name="aa" value="add_action( '$hook$', '$callback$' );&#10;$END$" description="add_action" toReformat="false" toShortenFQNames="true">
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
<?php
/**
* Includes a few useful predicates in the bootstrapped `infiniteScroll` JS object
* that is served along with the rest of the document upon initial page request.
*/
add_filter( 'infinite_scroll_js_settings', 'mcsf_extra_js_settings' );
function mcsf_extra_js_settings( $js_settings ) {
$js_settings['query_args']['extra'] = array(
'is_home' => is_home(),
<?php
/**
* Register Scripts
*
*/
function be_register_scripts() {
wp_register_script( 'be-shortcode', get_stylesheet_directory_uri() . '/js/shortcode.js', array( 'jquery' ), '1.0', true );
}
add_action( 'wp_enqueue_scripts', 'be_register_scripts' );
@carlalexander
carlalexander / AdminPage.php
Last active June 17, 2024 21:46
WordPress and the single responsibility principle
<?php
namespace WPMemeShortcode;
/**
* The WordPress Meme Shortcode admin page.
*
* @author Carl Alexander
*/
class AdminPage
@rachelbaker
rachelbaker / wp_csv_import.php
Created November 26, 2012 17:36
WordPress CSV importer upload form
<h3><?php echo __('Upload CSV'); ?></h3>
<form action="" method="post" enctype="multipart/form-data">
<tr>
<td width="20%"><?php echo __('Select file'); ?></td>
<td width="80%"><input type="file" name="file" id="file"/></td>
</tr>
<tr>