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 | |
require_once(__DIR__ . '/vendor/autoload.php'); | |
use HubSpot\Factory; | |
use HubSpot\Client\Crm\Objects\Notes\ApiException; | |
use HubSpot\Client\Crm\Objects\Notes\Model\Filter; | |
use HubSpot\Client\Crm\Objects\Notes\Model\FilterGroup; | |
use HubSpot\Client\Crm\Objects\Notes\Model\PublicObjectSearchRequest; | |
$client = Factory::createWithAccessToken('pat-eu1-2e01d2f9-f02d-4943-b90a-b314991afa9'); |
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 namespace App; | |
enum AssociationEnum: int | |
{ | |
case CONTACT_TO_COMPANY = 1; | |
case DEAL_TO_CONTACT = 3; | |
case DEAL_TO_COMPANY = 5; | |
case QUOTE_TO_DEAL = 64; | |
case QUOTE_TO_QUOTE_TEMPLATE = 286; | |
case QUOTE_TO_LINE_ITEM = 67; |
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 | |
ini_set('display_errors', 'On'); | |
error_reporting(E_ALL); | |
$filename = __DIR__ . '/request_log/' . date('Y-m-d_H-i-s') . '.log'; | |
$path = dirname($filename); | |
if (!file_exists($path) || !is_dir($path)) { | |
mkdir($path, 0777, true); |
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 | |
/** Display verbose errors */ | |
define( 'IMPORT_DEBUG', false ); | |
// Load Importer API | |
require_once ABSPATH . 'wp-admin/includes/import.php'; | |
if ( ! class_exists( 'WP_Importer' ) ) { | |
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php'; | |
if ( file_exists( $class_wp_importer ) ) |
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 excerpt_function($ID, $searchTerms) { | |
global $wpdb; | |
$thisPost = get_post_meta($ID); | |
foreach ($thisPost as $key => $value) { | |
if ( false !== stripos($value[0], $searchTerms) ) { | |
$found = substr(strip_tags($value[0]), 0, 150); | |
echo $found . ' ...'; | |
} | |
} | |
} |
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 | |
add_shortcode( 'spotify', 'getSpotify' ); | |
function getSpotify(){ | |
// Add 'YOUR_CLIENT_ID' and 'YOUR_CLIENT_SECRET' with your actual Spotify API credentials | |
$client_id = ''; | |
$client_secret = ''; | |
$show_id = ''; | |
$ch = curl_init(); |
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 | |
add_filter('the_content', 'hjs_insert_content_after_chars_words'); | |
function hjs_insert_content_after_chars_words($content) { | |
// only do this if post is longer than 1000 characters | |
$enable_length = 1500; | |
// insert after the first </p> after 500 characters | |
$after_character = 1500; | |
if (is_single() && strlen($content) > $enable_length) { | |
$before_content = substr($content, 0, $after_character); | |
$after_content = substr($content, $after_character); |
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 | |
/** | |
* Recurring Events | |
* | |
* @package BE-Events-Calendar | |
* @since 1.0.0 | |
* @link https://github.com/billerickson/BE-Events-Calendar | |
* @author Bill Erickson <bill@billerickson.net> | |
* @copyright Copyright (c) 2014, Bill Erickson | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
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 | |
// Returns subtotal price ($5.00) | |
$cart_subtotal = WC()->cart->get_cart_subtotal(); | |
// Returns subtotal number value (5) | |
$cart_subtotal = WC()->cart->subtotal; | |
/*======================================== | |
Single Product |
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
/* Follow up for this thread: https://wordpress.org/support/topic/select-form-field-placeholder-option/ | |
- The first option of your select form must be the placeholder. | |
- Then, in your JQuery file, copy the code and replace "theName" and "theValue" with the data of your select. | |
Example: | |
---- On a HTML page ----- | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-latest.min.js"></script> | |
<script src="/yourJSfile.js"></script> |