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 | |
// function definition | |
// copy a directory and its contents | |
function copyTree($source, $destination) { | |
if (file_exists($source)) { | |
// create source pointer | |
$dp = opendir($source) or die ('ERROR: Cannot open directory'); | |
// if destination directory does not exist | |
// create it |
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 | |
$src = '/home/username/public_html/'; // Caminho absoluto da origem, mas tb pode ser um caminho relativo a pasta onde está sendo executado o script | |
$dst = 'beta/'; // Caminho relativo a pasta onde está sendo executado o script | |
$files = glob("/home/username/public_html/*.*"); // Nome global para os arquivos | |
foreach($files as $file){ | |
$file_to_go = str_replace($src,$dst,$file); | |
copy($file, $file_to_go); | |
} | |
?> |
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 if ( is_front_page() ) : ?> | |
<?php elseif ( is_post_type_archive( 'videos' )) : ?> | |
<!-- Imagem do cabeçalho no loop de VÍDEOS --> | |
<?php if (function_exists('z_taxonomy_image_url')) : ?> | |
<div style="background: url(<?php echo z_taxonomy_image_url('1'); ?>) no-repeat top left; width:100%; height:300px;background-size: cover;"></div> | |
<?php else : ?> | |
<div style="background: url(<?php echo wp_get_attachment_url(get_post_thumbnail_id()); ?>) no-repeat top left; width:100%; height:300px;background-size: cover;"></div> | |
<?php endif ?> | |
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 $rand_posts = get_posts('numberposts=1&post_type=videos'); | |
foreach ($rand_posts as $post) :?> | |
<a style="text-decoration:none; position:relative;" href="<?php the_permalink(); ?>"> | |
<h2 class="public-thumb"><?php the_title();?></h2> | |
<?php echo the_post_thumbnail( 'large' , 'class=home-thumb' ); ?> | |
</a> | |
<?php endforeach; ?> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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_action( 'woocommerce_email_after_order_table', 'wc_add_payment_type_to_emails', 15, 2 ); | |
function wc_add_payment_type_to_emails( $order, $is_admin_email ) { | |
echo '<p><strong>Forma de pagamento:</strong> ' . $order->payment_method_title . '</p>'; | |
} |
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
//Gravity forms - limite de entradas | |
class GWLimitBySum { | |
private $_args; | |
function __construct($args) { | |
$this->_args = wp_parse_args($args, array( | |
'form_id' => false, |
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
# | |
set $skip_cache 0; | |
# POST requests and URL with a query string should always go to php | |
if ($request_method = POST) { | |
set $skip_cache 1; | |
} | |
if ($query_string != "") { |
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: Gofas Multisite SMTP | |
Plugin URI: https://www.gofas.com.br | |
Description: wp_mail() is SMTP Mail | |
Author: Muricio Gofas | |
Author URI: https://www.gofas.com.br | |
Version: 0.1 | |
*/ | |
add_action( 'phpmailer_init', 'my_phpmailer_example' ); |
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 sharedaddy_for_woocommerce() { | |
?> | |
<div class="social"><?php echo sharing_display(); ?></div> | |
<?php | |
} | |
add_action( 'woocommerce_share', 'sharedaddy_for_woocommerce' ); |