Skip to content

Instantly share code, notes, and snippets.

@w3human
w3human / Search.js
Last active May 24, 2023 00:14
ES6 Search And Results
var _API={};
_API.call_api=function(method, path, passing_data) {
var xhttp = new XMLHttpRequest();
return new Promise(function(resolve, reject) {
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
@w3human
w3human / Template.php
Last active June 10, 2024 23:36
How To Use API Data For a Single in a WordPress Custom Post Type
<?php
class Plugin_DataTypeSlug_Template {
public function __construct() {
$this->option = new Options();
}
public function add_actions_and_filters() {
@w3human
w3human / Shortcode_SearchAndResults.php
Created May 23, 2023 19:10
Shortcodes With Template Filters... Search And Result API Integration Example.
<?php
class Plugin_Shortcodes_SearchAndResults {
public function __construct() {
$this->data = new Api();
$this->options = new Options();
$this->_params = new Params();
add_shortcode('search-form', [$this, '_form']);
add_shortcode('result', [$this, '_results']);
@w3human
w3human / AioSeo.php
Last active November 3, 2023 23:19
WordPress SEO Modification Helpers For Popular SEO Plugins. Yoast And AIO.
<?php
class PLUGIN_DataTypeSlug_AIOseo{
public function __construct() {
$this->option = new Options();
$this->data = new Apiu();
}
@w3human
w3human / gist:d6ab11f0b3d7d4d4670c
Last active August 29, 2015 14:01
pA form validation...
jQuery(document).ready(function() {
jQuery("form[name='cartForm']").on("submit", function(event) {
jQuery("form[name='cartForm'] input[required], form[name='cartForm'] select[required]").each(function() {
if (jQuery(this).val() == "") {
jQuery(this).addClass("error");
}
else {
jQuery(this).removeClass("error");
}
}).each(function() {