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_filter( 'woocommerce_upsell_display_args', 'custom_woocommerce_upsell_display_args' ); | |
function custom_woocommerce_upsell_display_args( $args ) { | |
$args['posts_per_page'] = 5; // Change this number | |
$args['columns'] = 5; // This is the number shown per row. | |
return $args; | |
} |
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 custom class to body | |
* | |
* @since 1.0.0 | |
*/ | |
add_filter( 'admin_body_class', function( $classes ) { | |
$classes .= ' --my-class-name '; | |
return $classes; | |
}); |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://extension.pixelthrone.info', 'http://v2.extension.pixelthrone.info') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://extension.pixelthrone.info','http://v2.extension.pixelthrone.info'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://extension.pixelthrone.info', 'http://v2.extension.pixelthrone.info'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://extension.pixelthrone.info','http://v2.extension.pixelthrone.info'); |
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: Admin Page Framework Demo - Dynamic Drop-down in Repeatable Sections | |
* Plugin URI: http://en.michaeluno.jp/admin-page-framework | |
* Description: Demonstrates how a drop-down list can be updated dynamically in repeatable sections. | |
* Author: Michael Uno | |
* Author URI: http://michaeluno.jp | |
* Version: 1.0.0 | |
*/ | |
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: Admin Page Framework - Custom Text After Form Submission | |
Plugin URI: http://en.michaeluno.jp/admin-page-framework | |
Description: Displays custom text after the form is submitted. | |
Author: Michael Uno | |
*/ | |
// Include the library file. Set your file path here. | |
include( dirname( dirname( __FILE__ ) ) . '/admin-page-framework/library/apf/admin-page-framework.php' ); |
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_filter( 'sidebars_widgets', 'disable_all_widgets' ); | |
function disable_all_widgets( $sidebars_widgets ) { | |
$sidebars_widgets = array( false ); | |
return $sidebars_widgets; | |
} |
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 | |
/** | |
* How to integrate WordPress Core updates with your custom Plugin or Theme | |
* | |
* Filter the `update_plugins` transient to report your plugin as out of date. | |
* Themes have a similar transient you can filter. | |
*/ | |
add_filter( 'site_transient_update_plugins', 'wprp_extend_filter_update_plugins' ); | |
add_filter( 'transient_update_plugins', 'wprp_extend_filter_update_plugins' ); | |
function wprp_extend_filter_update_plugins( $update_plugins ) { |
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 html | |
* | |
* @version 1.0.0 | |
* @since 1.0.0 | |
*/ | |
add_action( 'woocommerce_after_checkout_billing_form', 'add_box_option_to_checkout' ); | |
function add_box_option_to_checkout( $checkout ) { |
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
# For plugins | |
function cws_hidden_plugin_12345( $r, $url ) { | |
if ( 0 !== strpos( $url, 'http://api.wordpress.org/plugins/update-check' ) ) | |
return $r; // Not a plugin update request. Bail immediately. | |
$plugins = unserialize( $r['body']['plugins'] ); | |
unset( $plugins->plugins[ plugin_basename( __FILE__ ) ] ); | |
unset( $plugins->active[ array_search( plugin_basename( __FILE__ ), $plugins->active ) ] ); | |
$r['body']['plugins'] = serialize( $plugins ); | |
return $r; |
OlderNewer