This file contains hidden or 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
// This example will add a custom "select" drop down to the "Image Box" | |
// This will change the class="" on the rendered image box so we can style the Image Box differently | |
// based on the selected option from the editor. | |
// The class will be "my-image-box-style-blue" or "my-image-box-style-green" based on the selected option. | |
add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) { | |
if( $section->get_name() == 'image-box' && $section_id == 'section_image' ){ | |
// we are at the end of the "section_image" area of the "image-box" | |
$section->add_control( |
This file contains hidden or 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
// These are examples of MySQL host names that will work fine in mysql_connect() but fail in mysqli_connect() | |
// If you are upgrading an old script to mysqli the client may have configured these as values for their database server. | |
// The below script parses out port number or socket and translates that into a correct mysqli_connect() call. | |
define('_DB_SERVER', '1.2.3.4:3306'); | |
define('_DB_SERVER', '1.2.3.4:/tmp/socket4'); | |
if(function_exists('mysqli_connect')){ | |
$server = _DB_SERVER; | |
$port_number = null; | |
$socket = null; |
This file contains hidden or 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 'vendor/autoload.php'; | |
use PhpSlackBot\Bot; | |
// Custom command | |
class MyCommand extends \PhpSlackBot\Command\BaseCommand { | |
protected function configure() { | |
$this->setName('bot'); |
This file contains hidden or 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
###### ImAcq.cpp: | |
ImAcq *imAcqAlloc() | |
{ | |
ImAcq *imAcq = (ImAcq *)malloc(sizeof(ImAcq)); | |
imAcq->method = IMACQ_PI; | |
imAcq->RaspiCam_Cv_Camera = ???? // dave added this | |
imAcq->currentFrame = 1; |
This file contains hidden or 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 | |
class module_data_link extends module_base{ | |
public function init(){ } | |
public function get_menu($holding_module=false,$holding_page=false,$type=false){ | |
$links=array(); | |
if(!$holding_module){ | |
if(self::can_i('view','Data Link')){ | |
// rendering the main menu: | |
$links[]=array( |
This file contains hidden or 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 | |
function beautiful_blog_links() { | |
if ( 'post' == get_post_type() ) : ?> | |
<div class="blog_links"> | |
<?php | |
$blog_links = array(); | |
$blog_links ['date'] = beautiful_posted_on( true ); | |
if ( comments_open() ) { |
This file contains hidden or 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 | |
// this changes the invoice number format to a 7 digit string padded with 0's at the start | |
// example: instead of "Invoice #1" it will be "Invoice #0000007" | |
// upload this file to a new folder called 'includes/plugin_custom_invoice_number/custom_invoice_number.php' | |
if(!function_exists('custom_invoice_number')) { | |
function custom_invoice_number( $customer_id ) { |
This file contains hidden or 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 | |
/** | |
* name this file 'custom_link.php' and put it into a new folder /includes/plugin_custom_link/ | |
*/ | |
class module_custom_link extends module_base{ | |
public function init(){ } | |
public function get_menu($holding_module=false,$holding_page=false,$type=false){ | |
$links=array(); |
This file contains hidden or 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 | |
$customer_import = array( | |
'customer_name' => 'Test Customer Import', | |
'customer_extra' => array( | |
'Extra Key 1' => 'Extra Val 1', | |
'Extra Key 2' => 'Extra Val 2', | |
'Extra Key 3' => 'Extra Val 3', | |
), | |
'address' => array( |
This file contains hidden or 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 | |
// NOTE: verify-purchase has been deprecated and it's best to use the new /author/sale endpoint as documented on http://build.envato.com/ | |
// created by Envato user wpdreams https://forums.envato.com/t/verify-purchase-class/3526 | |
// usage example: | |
$o = EnvatoApi2::verifyPurchase( $purchase_code ); |