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('woocommerce_order_status_processing', 'send_custom_email_for_local_pickup', 10, 1); | |
function send_custom_email_for_local_pickup($order_id) { | |
if (!$order_id) return; | |
// Obtener el pedido | |
$order = wc_get_order($order_id); |
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 new role for Marketing Analytics in WooCommerce | |
* | |
* @author Daniel P. - charrua.es | |
*/ | |
$analytics_role = add_role( | |
'manage_store_analytics', |
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 | |
// Create file "find.php" inside public_html, replace the path, open in browser. | |
// The script will find files modified in the last 2 days. | |
$files_modifiied = shell_exec('find /home1/cpanel_username/public_html/ -type f -mtime -2'); | |
echo "<pre>$files_modifiied</pre>"; | |
?> |
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 | |
/* | |
* Replace social icon from social icon block on WordPress. | |
* In this case we are replacing the wordpress icon for a custom svg one. | |
*/ | |
add_filter( | |
'render_block', | |
function( $block_content, $block ) { | |
if ( 'core/social-link' === $block['blockName'] && 'wordpress' === $block['attrs']['service'] ) { |
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 an admin menu link for Reusable Blocks | |
*/ | |
function my_reusable_blocks_admin_menu() { | |
add_menu_page( 'Reusable Blocks', 'Reusable Blocks', 'edit_posts', 'edit.php?post_type=wp_block', '', 'dashicons-editor-table', 22 ); | |
} | |
add_action( 'admin_menu', 'my_reusable_blocks_admin_menu' ); |
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/bin/env bash | |
rm -rf .git | |
git init | |
git add . | |
git commit -m "Initial commit" | |
git remote add origin <git origin url> | |
git push -u --force origin <branch> |
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
# This file must be placed inside the directory eg. wp-content/uploads/documents | |
# Will prevent direct access for anyone but a logged-in user with a valid wordpress_logged_in cookie | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} ^.*(mp3|m4a|jpeg|jpg|gif|png|bmp|pdf|doc|docx|ppt|pptx|)$ | |
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] | |
RewriteRule . - [R=403,L] |
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 | |
// Run by doing https://domain.com/wp-admin/admin-ajax.php?action=osm_id_callback_action | |
// For users not logged in | |
add_action('wp_ajax_nopriv_osmid_callback_action', 'osm_id_callback_action'); | |
// For users logged in | |
add_action('wp_ajax_osmid_callback_action', 'osm_id_callback_action'); |
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
//First commit any outstanding code changes, and then, run this command: | |
git rm -r --cached . | |
//This removes any changed files from the index(staging area), then just run: | |
git add . | |
//Commit | |
git commit -m "Atualizando .gitignore para..." |
NewerOlder