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( 'woocommerce_order_barcodes_do_nonce_check', 'disable_woocommerce_order_barcodes_nonce_check' ); | |
function disable_woocommerce_order_barcodes_nonce_check( $do_check ) { | |
// Do any required pressing here | |
$do_check = false; | |
return $do_check; | |
} | |
?> |
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 | |
function prevent_text_link( $str ) { | |
// Get total length of string | |
$strlen = strlen( $str ); | |
// Get number of middle character in string | |
$middle = round( intval( $strlen ) / 2 ); | |
// Loop through each character in the string and add an empty HTML tag in the middle |
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_action( 'init', 'sensei_disable_pass_required_all_lessons' ); | |
function sensei_disable_pass_required_all_lessons() { | |
if( is_admin() ) { | |
return; | |
} | |
global $woothemes_sensei; | |
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 fonts MUST be uploaded to the following directory: | |
* /wp-content/plugins/sensei-certificates/lib/tfpdf/font/unifont/ | |
* | |
* All custom fonts MUST be TrueType fonts (.ttf) | |
* | |
* Only one custom font can be used and it will override ALL fonts in ALL templates | |
**/ |
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 fields to new vendor form | |
add_action( 'shop_vendor_add_form_fields', 'custom_add_vendor_fields', 2, 1 ); | |
function custom_add_vendor_fields( $taxonomy ) { | |
?> | |
<div class="form-field"> | |
<label for="vendor_website"><?php _e( 'Vendor website' ); ?></label> | |
<input type="text" name="vendor_data[website]" id="vendor_website" class="vendor_fields" /><br/> | |
<span class="description"><?php _e( 'The vendor\'s website.' ); ?></span> |
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 | |
function sensei_reset_activity( $user_id = 0 ) { | |
// Get all Sensei activities | |
$token = 'sensei_'; | |
$activities = array( 'course_start', 'course_end', 'lesson_start', 'lesson_end', 'quiz_grade', 'quiz_answers', 'quiz_asked' ); | |
if( 0 < intval( $user_id ) ) { | |
$args['user_id'] = intval( $user_id ); | |
} |
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 | |
function upload_user_file( $file = array() ) { | |
require_once( ABSPATH . 'wp-admin/includes/admin.php' ); | |
$file_return = wp_handle_upload( $file, array('test_form' => false ) ); | |
if( isset( $file_return['error'] ) || isset( $file_return['upload_error_handler'] ) ) { | |
return false; | |
} 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_filter( 'dashboard_glance_items', 'custom_glance_items', 10, 1 ); | |
function custom_glance_items( $items = array() ) { | |
$post_types = array( 'post_type_1', 'post_type_2' ); | |
foreach( $post_types as $type ) { | |
if( ! post_type_exists( $type ) ) continue; |
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 ( ! defined( 'ABSPATH' ) ) exit; | |
class WordPress_Plugin_Template_Settings { | |
private $dir; | |
private $file; | |
private $assets_dir; | |
private $assets_url; | |
private $settings_base; |
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 | |
function woocommerce_version_check( $version = '2.1' ) { | |
if ( function_exists( 'is_woocommerce_active' ) && is_woocommerce_active() ) { | |
global $woocommerce; | |
if( version_compare( $woocommerce->version, $version, ">=" ) ) { | |
return true; | |
} | |
} | |
return false; | |
} |