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 | |
| add_action('woocommerce_product_options_general_product_data', 'woo_add_cost_price_field'); | |
| add_action('woocommerce_process_product_meta', 'woo_add_cost_price_field_save', 999); | |
| function woo_add_cost_price_field(){ | |
| global $woocommerce, $post; | |
| $post_id = $post->ID; | |
| $calc_ = get_post_meta($post_id, '_wholesales_price', true) / 100 ; | |
| $calc = $calc_ + 1; | |
| echo '<div class="options_group">'; | |
| echo '</div>'; |
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
| jQuery(window).load(function() { | |
| var theWindow = jQuery(window), | |
| jQuerybg = jQuery(".custom-background"), | |
| aspectRatio = jQuerybg.width() / jQuerybg.height(); | |
| function resizeBg() { | |
| if ( (theWindow.width() / theWindow.height()) < aspectRatio ) { | |
| jQuerybg |
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 generate_stock_report_csv() { | |
| // output headers so that the file is downloaded rather than displayed | |
| header('Content-Type: text/csv; charset=utf-8'); | |
| // set file name with current date | |
| header('Content-Disposition: attachment; filename=endo-stock-report-' . date('Y-m-d') . '.csv'); | |
| // create a file pointer connected to the output stream | |
| $output = fopen('php://output', 'w'); | |
| // set the column headers for the csv | |
| $headings = array( 'Product' . '; ' . 'Stock' . '; ' . 'Price Cost' . '; ' . 'Price Cost All' . '; ' . 'Price' . '; ' . 'all price' ); |
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 | |
| /** | |
| * Example Widget Class | |
| */ | |
| class example_widget extends WP_Widget { | |
| /** constructor -- name this the same as the class above */ | |
| function example_widget() { | |
| parent::WP_Widget(false, $name = 'Example Text Widget'); |
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 | |
| $users = get_users( array( 'fields' => array( 'ID' ) ) ); | |
| $html[] .= "<select id='event-users' multiple>"; | |
| foreach($users as $user_id){ | |
| if ( get_current_user_id() != $user_id->ID ) { | |
| $data = get_user_meta ( $user_id->ID ); | |
| $html[] .= "<option value='$user_id->ID'>"; | |
| $html[] .= $user_id->ID; | |
| $html[] .= " - "; | |
| $html[] .= $data['first_name'][0]; |
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 /* Template Name: CustomPageT1 */ ?> | |
| <?php get_header(); ?> | |
| <?php while ( have_posts() ) : the_post(); ?> | |
| <?php $event_start_date = get_post_meta( get_the_ID(), '_event_start_date', true); ?> | |
| <?php $event_end_date = get_post_meta( get_the_ID(), '_event_end_date', true); ?> | |
| <div id="loop-container" class="loop-container"> |
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 custom_meta_box_markup($object) | |
| { | |
| wp_nonce_field(basename(__FILE__), "meta-box-nonce"); | |
| ?> | |
| <div> | |
| <label for="meta-box-text">Text</label> | |
| <input name="meta-box-text" type="text" value="<?php echo get_post_meta($object->ID, "meta-box-text", true); ?>"> |
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 | |
| add_filter( 'woocommerce_product_tabs', 'woo_custom_product_tabs' ); | |
| function woo_custom_product_tabs( $tabs ) { | |
| // 1) Removing tabs | |
| // unset( $tabs['description'] ); // Remove the description tab | |
| // unset( $tabs['reviews'] ); // Remove the reviews tab | |
| // unset( $tabs['additional_information'] ); // Remove the additional information tab |
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 | |
| $file = 'path/to/videofile.mp4'; | |
| $fp = @fopen($file, 'rb'); | |
| $size = filesize($file); // File size | |
| $length = $size; // Content length | |
| $start = 0; // Start byte | |
| $end = $size - 1; // End byte | |
| header("Content-Disposition: attachment; filename=\"{$fileName}\""); |
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 | |
| $perpage = 10; | |
| $page = (int)$_GET['page']; | |
| if(!($page>0)) $page = 1; | |
| $offset = ($page-1)*$perpage; | |
| $extensions = array('3gp', 'mp4', 'png', 'gif', 'bmp'); | |
| $files = glob('files/'.$_GET['dir'].'/*.'.'{'.implode(',', $extensions).'}', GLOB_BRACE); | |
| $total_files = sizeof($files); | |
| $total_pages = ceil($total_files/$perpage); |
OlderNewer