Kurt Zenisek

  • August 13, 2013

    WooCommerce: Pull Prices from External Database

    No modifications/hacks are needed for WooCommerce to do this as it just uses a single add_filter & function to do so (though there are certain conditions that need to be met). Essentially, the product needs to have a price that’s a unique number (products with SKUs that contain unique numbers lends themselves to this nicely).…

    News
  • April 15, 2013

    Protect Text within Textarea

    This exact code protects text in a textarea that was present before editing & should remain at the beginning of the text area. In the case of @ mentioning someone, you could have the text box include that text (and be a 1:1 representation of what will be posted) while preventing it from being deleted…

    News
  • February 22, 2012

    WordPress: Export all content of a site as a single page

    It’s a page template that uses custom query_posts(); commands & has integrated styling to separate & denote the pages. flat-content-export.php (zip)

    News
  • November 11, 2011

    Contact Form 7: Add a custom verification/validation filter

    The following PHP code is fully working when placed in the theme’s functions.php file or in a plugin. This checks the email address provided against a list of free email providers to better ensure that the only submissions you receive are using a company email address. It’s isolated to only be applied to email fields…

    News
  • July 1, 2011

    PHP: Prevent uploads from being overwitten

    The following PHP file upload script makes the filename server-friendly, checks for filesize limitations, makes the filename unique so it doesn’t overwrite existing files (while using a sane naming scheme rather than simply using random generation & hoping for the best, lol), and outputs the final filename/location when finished. $file = basename($_FILES[‘file’][‘name’]); // Get the…

    News
  • June 15, 2011

    WordPress: Show Filename as Column in Media Library

    Add to a plugin or to a theme’s functions.php file. The PHP Code function custom_media_column_headings($defaults) { $defaults[‘parr_filename’] = ‘Filename’; return $defaults; } function custom_media_column_content($column_name,$id) { $none = ‘None’; switch ($column_name) { case ‘parr_filename’: $filename = basename(get_attached_file($id)); echo $filename ? $filename : $none; break; } } add_filter(‘manage_media_columns’,’custom_media_column_headings’); add_action(‘manage_media_custom_column’,’custom_media_column_content’,10,2);

    News
  • May 16, 2011

    WordPress: User-specific Content Shortcode

    Example [exclusive user=”*username/user id*”]*exclusive content*[/exclusive] The PHP Code extract(shortcode_atts(array( ‘user’ => ‘1’ ), $atts)); global $current_user; get_currentuserinfo(); if($current_user->user_login == $user || $current_user->ID == $user) return $content;

    News

Designed with WordPress