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 si_redirect_if_not_logged_in() { | |
$url = get_permalink( $invoice_id ); | |
if ( !is_user_logged_in() ) { | |
wp_redirect( home_url() . '/login/?redirect_to=' . $url . '&reauth=1'); | |
exit(); | |
} | |
} | |
// | |
add_action( 'pre_si_invoice_view', 'si_redirect_if_not_logged_in' ); |
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 | |
/** | |
* Example filter will translate/change the string "Description". | |
* "Description" can be changed to whatever string you'd like to translate/change | |
* just make sure to change the function name so you don't have any conflicts. | |
*/ | |
function l10n_description( $text ) { | |
return 'Beschrijving'; |
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 | |
/** | |
* Adds a print button to the top of estimates and invoices. | |
* @return type | |
*/ | |
function si_print_button() { | |
?> | |
<a href="javascript:window.print()" id="print_button" class="button print_button"><?php si_e('Imprimir') ?></a> | |
<?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 | |
/** | |
* This function file is loaded after the parent theme's function file. It's a great way to override functions, e.g. add_image_size sizes. | |
* | |
* | |
*/ | |
function custom_states() { | |
return array( |
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 | |
// Brazilian money simbol in Sprout Invoices | |
function set_br_reais_localeconv( $locale = array() ) { | |
$locale = array( | |
'decimal_point' => '.', | |
'thousands_sep' => '', | |
'int_curr_symbol' => 'BRL', | |
'currency_symbol' => 'R$', | |
'mon_decimal_point' => ',', | |
'mon_thousands_sep' => '.', |
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 change_client_dash_date_format() { | |
return 'd/m/Y'; | |
} | |
add_filter( 'si_client_dash_date_format', 'change_client_dash_date_format' ); |
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 | |
//Default From mail | |
function custom_wp_mail_from( $email ) { | |
$handle = 'site'; | |
$find = 'http://www.'; | |
$replace = ''; | |
$link = get_bloginfo( 'url' ); | |
$domain = str_replace( $find, $replace, $link ); | |
return $handle . '@' . $domain ; | |
} |
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 | |
/** | |
* Credit: http://www.butlerblog.com/2012/09/23/testing-the-wp_mail-function/ | |
* Update variable settings. | |
* Load to your WP root folder. | |
*/ | |
// Set $to as the email you want to send the test to | |
$to = "[email protected]"; | |
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 | |
// Admin Footer | |
add_filter( 'admin_footer_text', 'my_footer_text' ); | |
add_filter( 'update_footer', 'my_footer_version', 11 ); | |
function my_footer_text() { | |
return ' '; | |
} | |
function my_footer_version() { | |
return 'Your New Prhase'; |
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 | |
// Saudação customizada pt_BR | |
function replace_howdy( $wp_admin_bar ) { | |
$my_account=$wp_admin_bar->get_node('my-account'); | |
$newtitle = str_replace( 'Olá', 'Bem vindo', $my_account->title ); | |
$wp_admin_bar->add_node( array( | |
'id' => 'my-account', | |
'title' => $newtitle, | |
) ); | |
} |
OlderNewer