angboontiong
Forum Replies Created
-
hi,
i added following code to the mu-plugins and i can see the CC field and cc email keyed in also can be saved and show.but, in the sliced quotation or invoice, when i click send mail, it wont send to the cc email.
here is my code:
<?php
#Add a cc_email field in the user editor
add_action( ‘personal_options_update’, ‘save_extra_user_profile_fields’ );
add_action( ‘edit_user_profile_update’, ‘save_extra_user_profile_fields’ );function save_extra_user_profile_fields( $user_id ) {
if ( !current_user_can( ‘edit_user’, $user_id ) ) {
return false;
}
update_user_meta( $user_id, ‘cc_email’, $_POST[‘cc_email’] );
}
#Lookup cc_email, and at any contents as additional email addresses for sliced.
add_filter( ‘sliced_get_email_recipient’, ‘sliced_custom_add_recipient’, 10, 3 );
function sliced_custom_add_recipient( $output, $id, $type ) {
$cc_email = get_user_meta( sliced_get_client_id(), ‘cc_email’, true );
if ( $cc_email && ( $type === ‘invoice_available’ || $type === ‘payment_received’ ) ) {
$output .= ‘, ‘ . $cc_email;
}
return $output;
}
?><?php
add_action( ‘show_user_profile’, ‘extra_user_profile_fields’ );
add_action( ‘edit_user_profile’, ‘extra_user_profile_fields’ );function extra_user_profile_fields( $user ) {
?>
<h3><?php _e(“Extra profile information”, “blank”); ?></h3><table class=”form-table”>
<tr>
<th><label for=”cc_email”><?php _e(“CC Emails”); ?></label></th>
<td>
<input type=”text” name=”cc_email” id=”cc_email” value=”<?php echo esc_attr( get_the_author_meta( ‘cc_email’, $user->ID ) ); ?>” class=”regular-text” /><br />
<span class=”description”><?php _e(“Any additional email addresses for invoices, separated by commas”); ?></span>
</td>
</tr>
</table>
<?php
}Erm,
as i noob on this, would you mind guide me in more detail ?
appreciated and thanks.Hi,
thanks for correct me as i not familiar with coding but i do look for same solutions.
after i add it, then there is no error.however, i cannot find the cc column in the Add new user, Edit user.
am i missed something again ?this is the code i put in under the wp-content/mu-plugins
<?php
#Add a cc_email field in the user editor
add_action( ‘personal_options_update’, ‘save_extra_user_profile_fields’ );
add_action( ‘edit_user_profile_update’, ‘save_extra_user_profile_fields’ );function save_extra_user_profile_fields( $user_id ) {
if ( !current_user_can( ‘edit_user’, $user_id ) ) {
return false;
}
update_user_meta( $user_id, ‘cc_email’, $_POST[‘cc_email’] );
}
#Lookup cc_email, and at any contents as additional email addresses for sliced.
add_filter( ‘sliced_get_email_recipient’, ‘sliced_custom_add_recipient’, 10, 3 );
function sliced_custom_add_recipient( $output, $id, $type ) {
$cc_email = get_user_meta( sliced_get_client_id(), ‘cc_email’, true );
if ( $cc_email && ( $type === ‘invoice_available’ || $type === ‘payment_received’ ) ) {
$output .= ‘, ‘ . $cc_email;
}
return $output;
}
?>Hi,
after add that, i am getting this error on every page inside the admin:https://jv-communications.com/wp-content/uploads/2018/12/error.png
- This reply was modified 7 years, 5 months ago by angboontiong.
Hi,
what’s the file extension and the name should put for the above script?Do u mind to tell me what the final code?
And where to add that code ?
Thanks.
Hi,
I’m looking for this.
Are u success to implement?Forum: Networking WordPress
In reply to: manually change https to http…Hi dude,
it’s work for the http://angboontiong.com,
But it doesn’t work for the https://www.angboontiong.com/wp-admin/ with the following error:This page isn’t working
http://www.angboontiong.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTSIf i reinstall, will it erase all my post ???
Forum: Networking WordPress
In reply to: manually change https to http…and i no longer able to access to http://angboontiong.com/wp-login.php …
Forum: Networking WordPress
In reply to: manually change https to http…hi,
my website is http://angboontiong.com