Skip to content

Instantly share code, notes, and snippets.

View add-event-ticket.php
<?php
$event_id = Tribe__Events__API::createEvent(
array(
'post_title' => $event['title'],
'post_status' => 'publish',
'EventStartDate' => $event['date'],
'EventEndDate' => $event['date'],
'EventStartHour' => $event['start'],
'EventStartMinute' => '00',
'EventEndHour' => $event['finish'],
@stompweb
stompweb / case-studies-users.php
Last active Feb 19, 2018
Case Studies - Users
View case-studies-users.php
<?php
function sj_rewrite_case_studies_users() {
hm_add_rewrite_rule(
array(
'regex' => '^case-studies/([^/]+)/?',
'query' => 'author_name=$matches[1]',
'template' => 'templates/your-template.php',
'title_callback' => function( $title, $seperator ) {
return get_query_var( 'author_name' ) . ' case studies ' . $seperator . ' ' . $title;
}
View product-list.php
<?php
object(stdClass)#5627 (26) {
["Qty"]=>
string(1) "0"
["Ccode"]=>
string(8) "22000001"
["Description"]=>
string(13) "One Child Tkt"
["TicketDescription"]=>
View response.php
<?php
object(SimpleXMLElement)#368 (1) {
["anyType"]=>
object(SimpleXMLElement)#356 (24) {
["AVAILABLE"]=>
string(2) "20"
["RESNAME"]=>
string(12) "SECOND EVENT"
["RESTYPE"]=>
View response.php
<?php
object(SimpleXMLElement)#367 (1) {
["anyType"]=>
object(SimpleXMLElement)#359 (24) {
["AVAILABLE"]=>
string(2) "20"
["RESNAME"]=>
string(12) "SECOND EVENT"
["RESTYPE"]=>
@stompweb
stompweb / request.php
Created Sep 20, 2017
api-request.php
View request.php
<?php
$string = '<?xml version="1.0"?>
<XMLRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Description>RESOURCELISTBYVIEWBYDATELOAD</Description> <Item xsi:type="XMLResourceByViewRangeRequest">
<ResStartDate>15/09/2017</ResStartDate><ResEndDate>15/10/2017</ResEndDate> <ResCode />
<ResView>Events</ResView> <EventCode /><ShowProductMap>false</ShowProductMap>
</Item></XMLRequest>';
$client = new SoapClient( 'http://10.1.0.16/GDXMLWebServiceTEST/GDXMLWebService.asmx?wsdl' );
View content-product.php
<?php
/**
* The template for displaying product content within loops
*
* This template can be overridden by copying it to yourtheme/woocommerce/content-product.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@stompweb
stompweb / category.php
Created Jul 13, 2017
Facet WP Category
View category.php
<div class="row">
<div class="sort-by">
<div class="col-xs-7">
<div class="parent-link">
<?php
$current = get_queried_object();
$parent = get_term( $current->parent, $current->taxonomy ); ?>
<a href="<?php echo get_term_link( $parent ); ?>">
View class.order.php
<?php
class Order {
public function __construct() {
// Setup Orders table
add_action('init', array( $this, 'setupOrderTable' ) );
// Create an order when a user completes the form
View redirectFlow.php
<?php
$redirectFlow = $client->redirectFlows()->complete(
'test',
["params" =>
["session_token" => 'test']
]
);
You can’t perform that action at this time.