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
// Import parent CSS | |
add_action( 'wp_enqueue_scripts', 'child_enqueue_styles' ); | |
function child_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
} | |
// End Import parent CSS |
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 | |
//fonte: https://wordpress.org/support/topic/incompatibility-with-custom-profile-fields | |
// Replace user profile fields | |
function add_twitter_contactmethod( $contactmethods ) { | |
// Add Twitter | |
if ( !isset( $contactmethods['twitter'] ) ) | |
$contactmethods['twitter'] = 'Twitter url'; | |
if ( !isset( $contactmethods['facebook url'] ) ) | |
$contactmethods['facebook'] = 'Facebook url'; |
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 | |
// Remove campos do perfil wp-admin | |
function remove_contactmethod( $contactmethods ) { | |
unset($contactmethods['aim']); | |
unset($contactmethods['jabber']); | |
unset($contactmethods['yim']); | |
return $contactmethods; | |
} | |
add_filter('user_contactmethods','remove_contactmethod',10,1); | |
// fim Remove coisas do perfil |
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 | |
// Banir usuário | |
// Crédito: https://gist.github.com/Giuseppe-Mazzapica/11070063 | |
add_action( 'personal_options', 'rpa_profile_ban_field' ); | |
add_action( 'edit_user_profile_update', 'rpa_profile_ban_field_save' ); | |
function rpa_profile_ban_field( \WP_User $user ) { | |
$current = wp_get_current_user(); | |
if ( ! is_admin() || $user->ID === $current->ID ) return; | |
if ( ! user_can( $current, 'edit_users' ) ) return; | |
$target = new WP_User( $user->ID ); |
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 | |
// Remove notificação de Update | |
function remove_core_updates(){ | |
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,); | |
} | |
add_filter('pre_site_transient_update_core','remove_core_updates'); | |
add_filter('pre_site_transient_update_plugins','remove_core_updates'); | |
add_filter('pre_site_transient_update_themes','remove_core_updates'); | |
function hideUpdateNag() { |
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 | |
// Mostra adminbar apenas para admin | |
if ( get_current_user_id() != 1 ) { | |
add_filter( 'show_admin_bar', '__return_false' ); | |
} | |
//Fim |
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 | |
// Notifica admin sobre post para revisão | |
function send_mail_post_pending( $post_id, $post ) { | |
$post_status = get_post_status( $post ); | |
if( $post_status === 'pending' && ! wp_is_post_revision( $post ) ) { | |
$email = ( '[email protected]' ); | |
$subject = 'Revisar novo post'; | |
$message = 'Título do post: ' . get_the_title( $post ) . "\n\n"; | |
$message .= 'Revisar o post: ' . admin_url( "post.php?post={$post_id}&action=edit" ); | |
wp_mail( $email, $subject, $message ); |