CRUD = Create, Read, Update, Delete
$host = '127.0.0.1';
$dbname = 'test';
$username = 'root';
#!/bin/bash | |
read -r -p 'Commit message: ' ${desc} # prompt user for commit message | |
git add . # track all files | |
git add -u # track all deleted files | |
git commit -m "$desc" # commit with message | |
git push origin master # push to origin | |
git push production master # push to development server |
fetch('./js/data.json').then(response => { | |
return response.json(); | |
}).then(data => { | |
console.log(data); | |
}).catch(err => {}); |
const cardsArray = [ /* ... */ ]; | |
const game = document.getElementById('game'); | |
const grid = document.createElement('section'); | |
grid.setAttribute('class', 'grid'); | |
game.appendChild(grid); | |
cardsArray.forEach(item => { | |
const card = document.createElement('div'); | |
card.classList.add('card'); |
i { | |
border: solid black; | |
border-width: 0 3px 3px 0; | |
display: inline-block; | |
padding: 3px; | |
transform: rotate(45deg); | |
} |
//Forged Settings | |
function forged_settings_add_options(){ | |
add_options_page( 'Forged Settings', 'Forged Settings', 'manage_options', 'forged-settings', 'forged_settings_page'); | |
} | |
add_action( 'admin_menu', 'forged_settings_add_options'); | |
//Create Forged Settings Submenu | |
function forged_settings_page(){ ?> | |
<div class = "wrap"> | |
<h1>Forged Theme Settings</h1> |
<?php get_header(); ?> | |
<?php | |
$args = array( | |
'post_type' => 'your_post', | |
); | |
$your_loop = new WP_Query( $args ); if ( $your_loop->have_posts() ) : while ( $your_loop->have_posts() ) : $your_loop->the_post(); | |
$meta = get_post_meta( $post->ID, 'your_fields', true ); ?> |
<?php | |
function create_post_your_post() { | |
register_post_type( 'your_post', | |
array( | |
'labels' => array( | |
'name' => __( 'Your Post' ), | |
), | |
'public' => true, | |
'hierarchical' => true, |
<?php | |
// Escape HTML in <code> or <pre><code> tags. | |
function escapeHTML($arr) { | |
if (version_compare(PHP_VERSION, '5.2.3') >= 0) { | |
$output = htmlspecialchars($arr[2], ENT_NOQUOTES, get_bloginfo('charset'), false); | |
} | |
else { | |
$specialChars = array( |