This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Parcel Sandbox</title> | |
<meta charset="UTF-8" /> | |
</head> | |
<body> | |
<header class="header"> | |
<div class="header__left"> | |
<a class="header__logo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check_admin_referer('update-post_' . $post_id); | |
$post_id = edit_post(); | |
// Session cookie flag that the post was saved | |
if ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) { | |
setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() ); | |
} | |
redirect_post($post_id); // Send user on their way while we keep working |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hcf_save( $post_id ) { | |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { | |
return; | |
} | |
if ( $parent_id = wp_is_post_revision( $post_id ) ) { | |
$post_id = $parent_id; | |
} | |
$field_list = [ | |
'hcf_author', | |
'hcf_published_date', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (h *Handler) exec(requestBody utils.JsonIn) (*utils.JsonOut, error) { | |
cmd := exec.Command(h.Command) | |
cmd.Dir = h.WorkingDir | |
bRequestBody, err := json.Marshal(requestBody) | |
if err != nil { | |
return nil, err | |
} | |
cmd.Stdin = strings.NewReader(string(bRequestBody)) | |
var out bytes.Buffer | |
cmd.Stdout = &out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (h *Handler) Handle(w http.ResponseWriter, r *http.Request){ | |
cmd := exec.Command(h.Command) | |
cmd.Dir = h.WorkingDir | |
cmd.Env = append(h.Env, fmt.Sprintf("FN_REQUEST_URL=%s", r.URL.RequestURI())) | |
requestContent, err := ioutil.ReadAll(r.Body) | |
if err != nil { | |
w.WriteHeader(http.StatusInternalServerError) | |
fmt.Fprint(w, err) | |
return | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app" :class="[$style.app]"> | |
<div :class="$style.header"> | |
<nav :class="$style.nav"> | |
<router-link to="/">Home</router-link> | | |
<router-link to="/about">About</router-link> | |
</nav> | |
</div> | |
<main :class="$style.main"> | |
<router-view/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 5:23 PM Friday, October 18, 2013 - Jim Priest | |
# origin script found here: http://python.dzone.com/articles/tips-using-git-pre-commit-hook | |
# Modified with console checks and to ignore commented file | |
echo "Executing post-commit checks..." | |
FILES_PATTERN='\.(js)(\..+)?$' | |
FORBIDDEN='console\.[clear|dir|log|info|warn|error]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Advanced Search | |
*/ | |
get_header(); ?> | |
<?php | |
$min_price = $_GET['min_price'] ?? ''; | |
$max_price = $_GET['max_price'] ?? ''; | |
?> | |
<div class="wrap"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Hello Custom Field | |
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates | |
Description: A brief description of the Plugin. | |
Version: 1.0 | |
Author: duocnguyen | |
Author URI: http://URI_Of_The_Plugin_Author | |
License: A "Slug" license name e.g. GPL2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="post-meta"> | |
<li><span class="post-meta-key">Price:</span> <?php echo esc_html(get_post_meta(get_the_id(), 'Price', true)) ?></li> | |
<li><span class="post-meta-key">Image:</span> <?php echo esc_html(get_post_meta(get_the_id(), 'Image', true)) ?></li> | |
<li><span class="post-meta-key">Type:</span> <?php echo esc_html(get_post_meta(get_the_id(), 'Type', true)) ?></li> | |
</ul> |