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 | |
/** | |
* hook into WP's admin_init action hook | |
*/ | |
public function admin_init() { | |
// Here we create our settings fields to be contained in the setting group 'wpfh-group' | |
register_setting( self::PLUGIN_ABBR . '-group', self::PLUGIN_ABBR . '-group' ); | |
add_settings_section ( self::PLUGIN_SLUG . '_main_section' , 'Primary Settings', array( $this, 'settings_callback'), self::PLUGIN_SLUG . '-options' ); | |
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 | |
public function __construct() { | |
// register actions | |
add_action( 'init', array( &$this, 'init' ) ); | |
} | |
//Sanitizers | |
public function cplh_hexcolor_sanitize( $new_value, $old_value ) { | |
$new_value = sanitize_hex_color( $new_value ); | |
return $new_value; |
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 | |
if( ! current_user_can( 'manage_options' ) ) { | |
exit(); | |
} | |
$settings_color = "#fff"; | |
if( isset( $_POST['settings_color'] ) && wp_verify_nonce( $_POST['_wpnonce'] ) ) { | |
update_option( "myplugin_settings_color", $_POST['settings_color'] ); | |
if( isset( $_POST['feature_on'] ) ) { |
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
<div u="slides" style="cursor: move; position: absolute; overflow: hidden; left: 0px; top: 0px; width: 1090px; height: 550px;"> | |
<?php | |
$slides_trans = get_transient( "slides_rest_api"); | |
$allslides = array(); | |
if( !$slides_trans || $_REQUEST['reset_trans'] == 'please' ) { | |
// Best to use wp_remote_get here but for brevity in example we use file_get_contents | |
$callret = file_get_contents( site_url() . '/wp-json/posts?filter[category_name]=home-slides&filter[posts_per_page]=-1' ); | |
$allslides = json_decode( $callret, true ); | |
set_transient( "slides_rest_api", $callret, 60*60*12 ); | |
} else { |
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 the SSN field to the checkout if Four Easy Payments is available | |
*/ | |
add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' ); | |
function my_custom_checkout_field( $checkout ) { | |
if( has_deposit() ) { | |
echo '<div id="my_custom_checkout_field"><h2>' . __('Payment Plan Requirements') . '</h2>'; | |
woocommerce_form_field('ssn_easypay', array( |
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
exports.takephoto = function(args) { | |
cameraModule.takePicture().then(function(picture) { | |
var savepath = fsModule.knownFolders.documents().path; | |
var filename = 'img_' + new Date().getTime() + '.' + enumsModule.ImageFormat.jpeg; | |
var filepath = fsModule.path.join(savepath, filename); | |
console.log("Save: + " + picture); | |
if(picture.saveToFile(filepath, format)) { | |
var session = bghttp.session("image-upload"); | |
console.logi("Saving"); | |
var request = { |
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 | |
/** | |
* Clear cache on add to cart so the cart counter in header is updated | |
*/ | |
add_action( 'woocommerce_add_to_cart', 'my_custom_clear_cache', 10, 1 ); | |
function my_custom_clear_cache( ) { | |
comet_cache::clear(); | |
} |
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
var viewModule = require("ui/core/view"); | |
var imageModule = require("ui/image"); | |
var absoluteLayoutModule = require("ui/layouts/absolute-layout"); | |
var page; | |
var id; | |
var timer = require("timer"); | |
var face; | |
var deviceimg; | |
var angle = 0; |
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
var viewModule = require("ui/core/view"); | |
var imageModule = require("ui/image"); | |
var absoluteLayoutModule = require("ui/layouts/absolute-layout"); | |
var page; | |
var id; | |
var timer = require("timer"); | |
var timestart = 1000*60*3; | |
var timerlabel; | |
var face; |
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 | |
/** | |
* User submits url which converts to WebSitesCPT | |
*/ | |
if ( ! class_exists( 'Website_Submit' ) ) { | |
class Website_Submit { | |
const POST_TYPE = 'user-websites'; | |
public $return_message = ''; |