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 my_init_email_as_username() | |
{ | |
//check for level as well to make sure we're on checkout page | |
if(empty($_REQUEST['level'])) | |
return; | |
if(!empty($_REQUEST['bemail'])) | |
$_REQUEST['username'] = $_REQUEST['bemail']; | |
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 add_capability() { | |
// gets the author role | |
$role = get_role( 'author' ); | |
// This only works, because it accesses the class instance. | |
$role->add_cap( 'edit_others_posts' ); | |
} | |
add_action( 'admin_init', 'add_capability'); |
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 | |
/** | |
* Change Upload Directory for one Custom Post-Type | |
* Author: https://gist.github.com/RRWD/8705908 | |
* This will change the upload directory for a custom post-type. Attachments for this custom post type will | |
* now be uploaded to a seperate "uploads" directory. Make | |
* sure you swap out "post-type" and the "my-dir" with the appropriate values... | |
* credits to: http://wordpress.stackexchange.com/users/4044/jhdenham | |
* and http://yoast.com/smarter-upload-handling-wp-plugins/ | |
*/ |
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
// 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; | |
} |
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 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 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 | |
/** | |
* 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 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: 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 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 | |
// 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 | |
/** | |
* 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( |