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 | |
/* | |
Created by [email protected] on 22/7/2022 | |
The code below will get a list of photos in their | |
order as they appear in the ACF gallery and provide | |
you with the thumbnail and large versions. | |
You can use $gallery to output the gallery code. |
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 | |
######################## | |
// GET FIELD NAMES AND VALUES FROM ACF GROUP | |
// | |
// created by [email protected] on 27/8/2019 | |
// | |
// This script will do the following: | |
// 1. Loop through the fields in a specific ACF Group | |
// 2. Create an array called $array_of_field_names | |
// so you can easily print out a list of the field names |
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 | |
######################## | |
// Here you can search a post type or post and find posts | |
// with two different custom field data (keys). | |
// This is useful if you have setup two custom fields and storing | |
// data in the fields and need to find posts that match. | |
// In the case below I have two custom fields: content_client_id and content_status | |
// content_client_id = the id of a client | |
// content_status = the status of a post (EG: Awaiting Approval by Client) | |
// I want to find all posts that match a client id and Awaiting Approval by Client |
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 | |
######################## | |
// allow a script to only be run between two times | |
// EG: you can use this for a cron job and if someone tries to access it outside the times | |
// then you can block the request. | |
######################## | |
header('Content-type: application/json; charset=utf-8'); //set the page to text only (optional) | |
$start_time = "09:00"; | |
$end_time = "09:30"; | |
$server_time_zone = date_default_timezone_get(); //this is the current server timezone |
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 | |
######################################################### | |
// Get the first X chars from the content post (strips out any html) | |
// USAGE: get_intro_text($max_char = 75, $content, $more_link_text = '(more...)') | |
######################################################### | |
function get_intro_text($max_char, $content, $more_link_text = '(more...)') { | |
$content = get_the_content($more_link_text, $stripteaser, $more_file); | |
$content = apply_filters('the_content', $content); | |
$content = str_replace(']]>', ']]>', $content); | |
$content = strip_tags($content); |
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 | |
############################ | |
//sync the dealer store pages | |
############################ | |
/* | |
This is a special function whcih pulls in the remote data from the dealer core | |
and stores a local json file with the dealers data. The dealers details pages will actually | |
be populated from the local json file so we do not need to do any major database processed | |
which will save database overhead. | |
*/ |
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 | |
###################################################### | |
//Here we will check to see if the special offer being presented | |
//is in the list of the dealers posts and if not do a 301 redirect | |
//back to the home page | |
//added on 19/10/2018 by [email protected] | |
###################################################### | |
function white_label_special_offer_301_redirect_check($array_of_dealer) { | |
################################################### |
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 | |
###################################################### | |
//get a list of specials assigned to a dealer so that we can display a list | |
//of post id's in the array_of_dealer | |
//added on 19/10/2018 by [email protected] | |
###################################################### | |
function white_label_get_array_of_special_offer_posts_for_dealer($dealer_id) { | |
################################################### | |
//STEP 1 |
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 | |
/* | |
Custom WHMCS Affiliate hook by [email protected] | |
Date: 14th October 2018 | |
Stored in WHCMS: /includes/hooks/ | |
The WHMCS affiliate system is basic, very basic in terms of: affiliates can only | |
earn comissions based on orders they generate. |
NewerOlder