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 | |
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 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 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 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 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 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 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: Revoke Profile Access | |
* Description: Allow administrators to revoke access to profile to some users | |
* Plugin URI: http://wordpress.stackexchange.com/q/141743/ | |
* Author: G. M. | |
* Author URI: http://wordpress.stackexchange.com/users/35541/g-m | |
* License: GPLv2 | |
* | |
*/ |
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 | |
/** | |
* Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field | |
* | |
* Preview your Gravity forms on the frontend of your website. Adds a "Live Preview" link to the Gravity Forms toolbar. | |
* | |
* Usage | |
* | |
* 1 - Enable "Allow field to be populated dynamically" option on field which should be populated. | |
* 2 - In the "Parameter Name" input, enter the merge tag (or merge tags) of the field whose value whould be populated into this field. |
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 | |
function auto_send_invoice_after_creation( $invoice_id ) { | |
$invoice = SI_Invoice::get_instance( $invoice_id ); | |
$client = $invoice->get_client(); | |
$client_users = $client->get_associated_users(); | |
if ( !empty( $client_users ) ) { | |
do_action( 'send_invoice', $invoice, $client_users ); | |
} | |
} |
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
// fonte: http://premium.wpmudev.org/blog/display-wordpress-post-page-ids/ | |
add_filter( 'manage_posts_columns', 'revealid_add_id_column', 5 ); | |
add_action( 'manage_posts_custom_column', 'revealid_id_column_content', 5, 2 ); | |
function revealid_add_id_column( $columns ) { | |
$columns['revealid_id'] = 'ID'; | |
return $columns; | |
} |
OlderNewer