Skip to content

Instantly share code, notes, and snippets.

View adamdoe's full-sized avatar
🏠
Working from home

Adam Doe adamdoe

🏠
Working from home
View GitHub Profile
@adamdoe
adamdoe / crud-taxonomy-meta-wordpress.php
Created June 29, 2018 18:30 — forked from alexx855/crud-taxonomy-meta-wordpress.php
CRUD custom taxonomy meta wordpress
<?php
add_action( '{taxonomy}_add_form_fields', 'add_feature_group_field', 10, 2 );
function add_feature_group_field($taxonomy) {
global $meta_name;
?>
<div class="form-field">
<label for="meta_name">Meta Name</label>
<input name="meta_name" id="meta_name" type="text" value="<?php echo $meta_name; ?>" size="40" aria-required="true">
if ( ! class_exists( 'theme_utilities' ) ) {
class theme_utilities {
public static function theme_function_one() { }
public static function theme_function_two() { }
}
}
@adamdoe
adamdoe / footer.php
Created July 26, 2018 13:04
For WordPress AJAX Urls
@adamdoe
adamdoe / data.sql
Created March 4, 2019 18:19
WordPress SQL for post, category, user data
SELECT
p.ID,
p.post_author,
p.post_date,
u.display_name,
p.post_title,
p.post_content,
t.name
FROM wp_posts as p
INNER JOIN wp_postmeta as pm ON (p.ID = pm.post_id)
@adamdoe
adamdoe / ReactContext.md
Last active May 23, 2022 04:56
ReactContext #React

React Context

example

// MyContext.js
import React from 'react'
const MyContext = createContext()
export default MyContext

// App.js
@adamdoe
adamdoe / callbacks.md
Last active May 24, 2022 02:56
callbacks #javascript

‎‎​

@adamdoe
adamdoe / data.json
Last active October 24, 2022 14:40
Bar Chart > Example Data #d3
[
{
"Date": "2013-01",
"Value": "53"
},
{
"Date": "2013-02",
"Value": "165"
},
{