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
//Display Fields | |
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 2 ); | |
//JS to add fields for new variations | |
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' ); | |
//Save variation fields | |
add_action( 'woocommerce_process_product_meta_variable', 'variable_fields_process', 10, 1 ); | |
function variable_fields( $loop, $variation_data ) { | |
?> | |
<tr> |
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: T5 Custom Log-out URL | |
* Description: Create a custom log-out URL. | |
* Plugin URI: http://wordpress.stackexchange.com/questions/76161/masking-logout-url | |
* Version: 2012.12.14 | |
* Author: Thomas Scholz | |
* Author URI: http://toscho.de | |
* Licence: MIT | |
* License URI: http://opensource.org/licenses/MIT |
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 | |
defined( 'ABSPATH' ) OR exit; | |
/** | |
* Plugin Name: (#64910) (Dashboard Widget) Last edited files | |
* Description: Lists the last edited files in a dashboard widget | |
* Author: Franz Josef Kaiser <wecodemore@gmail.com> | |
* Author URL: https://plus.google.com/107110219316412982437 | |
* License: MIT | |
*/ |
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: T5 Table size dashboard widget | |
* Description: Print a list of table sizes into your dashboard. | |
* Plugin URI: | |
* Version: 2013.01.07 | |
* Author: Thomas Scholz | |
* Author URI: http://toscho.de | |
* Licence: MIT | |
* License URI: http://opensource.org/licenses/MIT |
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: Dump WP HTTP API cURL Request & Response | |
* Author: Franz Josef Kaiser | |
*/ | |
add_action( 'plugins_loaded', array( 'WPSE81791_cURL', 'init' ) ); | |
class WPSE81791_cURL | |
{ | |
protected static $instance; |
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 | |
defined( 'ABSPATH' ) OR exit; | |
/** | |
* Plugin Name: SysBot | |
* Description: Creates and maintains the SysBot User (which has the role of "editor") | |
* Author: Franz Josef Kaiser | |
*/ | |
# PUBLIC API # | |
function get_bot() |
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
function tcb_filter_search( $term ) { | |
if ( is_search() ) | |
$search = "(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))"; | |
return $search; | |
} | |
add_filter( 'posts_search', 'tcb_filter_search', null, 2 ); |
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: (#67107) »kaiser« Restrict file upload via image dimensions | |
*/ | |
function wpse67107_restrict_upload( $file ) | |
{ | |
$file_data = getimagesize( $file ); | |
// Abort when we can't get any info: | |
if ( ! $file_data ) |
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 | |
defined( 'ABSPATH' ) OR exit; | |
/** | |
* Plugin Name: (WCM) Debug Register Post Type Args | |
* Description: Shows the arguments of a newly registered post type right after it was | |
* registered. Helps inspecting which defaults have been added by core and if | |
* one of the developers arguments got overwritten. Simply add | |
* <code>&debug_pt_args=true</code> to your URL and set | |
* <code>WP_DEBUG</code> to <code>TRUE</code> in your <code>wp-config.php</code>. | |
* Plugin URl: http://wordpress.stackexchange.com/questions/89066 |
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
add_action( 'wp_footer', 'count_statuses' ); | |
function count_statuses() | |
{ | |
$status = 'status'; | |
$num = get_term_post_count_by_type( "post-format-$status", 'post_format' ); | |
print "<pre>{$status}es: $num</pre>"; | |
} | |
/** | |
* Count all post in a term. |