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: Add Gift Card as Custom Product Type | |
Description: A simple demo plugin on how to add Gift Card as your custom product type | |
Author: Bhavik Kiri | |
Version: 1.0 | |
*/ | |
add_action( 'plugins_loaded', 'wcpt_register_gift_card_type' ); |
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 | |
/** | |
* | |
* You can find the complete tutorial for this here: | |
* https://pluginrepublic.com/woocommerce-custom-fields | |
* | |
* Alternatively, check out the plugin | |
* https://pluginrepublic.com/wordpress-plugins/woocommerce-product-add-ons-ultimate/ | |
* |
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: Contact Form 7 to External DB | |
Plugin URI: | |
Description: This plugin uses the wpcf7_before_send_mail hook to post a specific form to an external database. Upon use the details for your external database will need to be entered. Private use only. | |
Author: | |
Version: 0.2 | |
Author URI: | |
*/ |
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_filter( 'gform_column_input_2_15_1', 'set_column', 10, 5 ); | |
function set_column( $input_info, $field, $column, $value, $form_id ) { | |
$request = wp_remote_get( 'https://pippinsplugins.com/edd-api/products' ); | |
if( is_wp_error( $request ) ) { | |
return false; // Bail early | |
} | |
$body = wp_remote_retrieve_body( $request ); |
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_action( 'woocommerce_before_single_product', 'bbloomer_show_video_not_image' ); | |
function bbloomer_show_video_not_image() { | |
// Do this for product ID = 282 only | |
if ( is_single( '282' ) ) { | |
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); | |
remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); |
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 | |
// AL CERRAR SESION EN LA PAGINA REDIRIGE AL USUARIO A LA PAGINA DE INICIO. | |
function auto_redirect_after_logout() | |
{ | |
wp_redirect(home_url()); | |
exit(); | |
} | |
add_action('wp_logout', 'auto_redirect_after_logout'); |
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 | |
// MUESTRA EL MENU DIFERENTE EN LAS PAGINAS DEPENDIENDO SI EL USUARIO CUENTA CON UNA SESSION ACTIVA O DESACTIVADA. | |
function my_wp_nav_menu_args($args = '') | |
{ | |
if (is_user_logged_in()) { | |
$args['menu'] = 'Menú Principal - Log In'; | |
return $args; | |
} else { | |
$args['menu'] = 'Menú Principal - Log Out'; | |
return $args; |
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: HowTo Plugin | |
Plugin URI: | |
Description: This Plugin demonstrates how you can build your own plugin pages using the WordPress provided draggable metaboxes, requires WordPress 2.7 version, supports WordPress 2.8 changed boxing layout engine | |
Author: Heiko, Frank | |
Author URI: http://bueltge.de | |
Version: 0.1 | |
License: |
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: Disable Frontend | |
Description: Disable the frontend interface of the website, leave only CMS and REST API | |
Version: 1.0 | |
*/ | |
add_action('init', 'redirect_to_backend'); | |
function redirect_to_backend() { |
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
// Enable WP_DEBUG mode | |
define('WP_DEBUG', true); | |
// Enable Debug logging to the /wp-content/debug.log file | |
define('WP_DEBUG_LOG', true); | |
// Disable display of errors and warnings | |
define('WP_DEBUG_DISPLAY', false); | |
@ini_set('display_errors',0); |