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( 'save_post', 'tivwp_save_post', 10, 3 ); | |
/** | |
* Save the selected template info for the particular post | |
* @param int $post_id | |
* @param \WP_Post $post | |
* @param bool $update | |
* @wp-hook save_post |
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
-- | |
-- When the product "post date" is incorrect | |
-- (for example, as a result of batch import-export) | |
-- this SQL will fake the date using the post_ID | |
-- | |
-- @author Gregory Karpinsky, http://www.tiv.net/ | |
-- @version 14.08.19 | |
-- | |
UPDATE wp_posts |
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
diff -rupN /tmp/searchwp/includes/class.search.php app/plugins/searchwp/includes/class.search.php | |
--- /tmp/searchwp/includes/class.search.php 2014-09-29 15:37:54.000000000 +0300 | |
+++ app/plugins/searchwp/includes/class.search.php 2014-10-29 14:46:00.003012356 +0200 | |
@@ -284,6 +284,13 @@ class SearchWPSearch { | |
$this->order = $args['order']; | |
$this->load_posts = is_bool( $args['load_posts'] ) ? $args['load_posts'] : true; | |
+ /** CHANGES BEGIN: | |
+ Check for offset argument, this allows more precise navigation */ | |
+ if( isset( $args['offset'] ) && !empty( $args['offset'] ) ) { |
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 | |
/** | |
* Plugin Name: TIVWP Demo 28033 | |
* Plugin URI: https://gist.github.com/tivnet/c99265e4884f7df5cb0f | |
* Description: Demonstrates WP bug <a href="https://core.trac.wordpress.org/ticket/28033">#28033</a> | |
* Version: 14.11.02 | |
* Author: TIV.NET | |
* Author URI: http://www.tiv.net | |
* License: GPL2 | |
* Copyright 2014 Gregory Karpinsky (tiv.net), All Rights Reserved |
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
#!/usr/local/bin/php -q | |
<?php | |
/** | |
* Git to SVN | |
* @author Gregory Karpinsky (@tivnet) | |
*/ | |
/** | |
* Default values for $_SERVER, because we run as CLI | |
*/ |
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
<li id="customize-control-wpglobus_xcel-setting-blog-cats" class="customize-control customize-control-text" style="display: block;"> | |
<label> | |
<span class="customize-control-title">Exclude Blog Categories</span> | |
<input type="text" class="wpglobus-customize-control" value="" data-customize-setting-link="wpglobus_xcel-setting-blog-cats" id="wpglobus_xcel-setting-blog-cats"> | |
</label> | |
</li><li id="customize-control-xcel-setting-blog-cats" class="customize-control customize-control-text" style="display: none;"> | |
<label style="display: none;"> | |
<span class="customize-control-title">Exclude Blog Categories</span> | |
<span class="description customize-control-description">Enter the ID's of the post categories you'd like to EXCLUDE from the Blog, enter only the ID's with a minus sign (-) before them, separated by a comma (,)<br>Eg: "-13, -17, -19"<br>If you enter the ID's without the minus then it'll show ONLY posts in those categories.</span> | |
<inpu |
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 | |
/** | |
* OOP vs. Procedural PHP Benchmark | |
* @author tivnet | |
* @version 13.11.27 | |
* Disclaimer: This is too simple, and does not prove anything. Just forget it. :-) | |
* My results on PHP 5.4 / Windows 8.1 / Apache 2.4 (all 64 bits, but who cares) : | |
* first 3 tests: same 3.1 to 3.4; the last test: 5.0 to 5.1 | |
*/ | |
header( 'Content-type: text/plain' ); |
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 | |
// .../node_modules/grunt-wp-i18n/vendor/wp-i18n-tools/extract.php | |
public function entry_from_call( $call, $file_name ) { | |
/** | |
* Ignore all strings that are not from our textdomain | |
*/ | |
if ( $call['args'][ count( $call['args'] ) - 1 ] !== 'my-text-domain' ) { | |
return null; | |
} |
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
#!/bin/bash | |
for f in `find . -name "*.jpg"`; do dd=`exif -t "Date and Time (Original)" --machine-readable $f | cut -f1 -d" " | sed s/:/-/g`; mkdir -p $dd && mv $f $dd/; done |
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
#!/bin/bash | |
# A simplified version of a2ensite/a2dissite. Works under Windows with no symlinking. | |
# Author: Gregory Karpinsky (@tivnet) | |
if [ ! -d sites-available ] | |
then | |
echo "Wrong folder!" | |
exit 2; | |
fi |
OlderNewer