Functions.php added code not working

Vi ER konsulenter
15 Posts
Vi ER konsulenter posted this 15 November 2017

Hello,

I have the plugin client portal. I wanted my users to get an email when I update their private page, so I asked the developer of the plugin. I can add the following code to my functions.php:

//Send an email to the user when his private page was updated 
function cpc_send_email_on_page_update($post_id) {
$author_id = get_post_field('post_author', $post_id);

$user = get_userdata($author_id);
$to = $user->user_email;
$site_name = get_bloginfo('name');

$subject = '['.$site_name.'] Private page updated !';
$message = 'Your private page was just updated !';

wp_mail($to, $subject, $message);
}
add_action( 'save_post_private-page', 'cpc_send_email_on_page_update' );

When I activate the twenty seventeen theme the extra code in the functions.php works fine. But when I activate the Themler theme I made, it does not work.

I added the code in the functions.php of both the Twenty Seventeen theme and my Themler theme.

Does anyone know what can be the problem?

Hello, I have the plugin client portal. I wanted my users to get an email when I update their private page, so I asked the developer of the plugin. I can add the following code to my functions.php: //Send an email to the user when his private page was updated function cpc_send_email_on_page_update($post_id) { $author_id = get_post_field('post_author', $post_id); $user = get_userdata($author_id); $to = $user->user_email; $site_name = get_bloginfo('name'); $subject = '['.$site_name.'] Private page updated !'; $message = 'Your private page was just updated !'; wp_mail($to, $subject, $message); } add_action( 'save_post_private-page', 'cpc_send_email_on_page_update' ); When I activate the twenty seventeen theme the extra code in the functions.php works fine. But when I activate the Themler theme I made, it does not work. I added the code in the functions.php of both the Twenty Seventeen theme and my Themler theme. Does anyone know what can be the problem?
Vote to pay developers attention to this features or issue.
12 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 15 November 2017

Hi,

Did you try adding the code to the Themler Settings >> CMS Code?
This is the proper place to add custom php and usually everything work ok.

Thank you,
Olivia

Hi, Did you try adding the code to the Themler Settings >> CMS Code? This is the proper place to add custom php and usually everything work ok. Thank you, Olivia
Vi ER konsulenter
15 Posts
Vi ER konsulenter posted this 15 November 2017

I did not try that, but I did just now.

I get an error saying it is unrecognised code.

I did not try that, but I did just now. I get an error saying it is unrecognised code.
Support Team
Support Team posted this 15 November 2017

Hi,

I've tried to add it to the WP theme on my side and it does not return any error messages. Are you sure that you added it exactly into the CMS Code field?

Thank you,
Olviia

Hi, I've tried to add it to the WP theme on my side and it does not return any error messages. Are you sure that you added it exactly into the CMS Code field? Thank you, Olviia
Vi ER konsulenter
15 Posts
Is Solution
Vi ER konsulenter posted this 15 November 2017

Thnx Olivia, that was the problem, I accidentaly used the field for extra CSS in stead of CMS code.

I managed to get the code in and the code is also working.

Thnx Olivia, that was the problem, I accidentaly used the field for extra CSS in stead of CMS code. I managed to get the code in and the code is also working.
Support Team
Support Team posted this 16 November 2017

Hi,

Great!
Please let us know if you have any other questions/issues.

Thank you,
Olivia

Hi, Great! Please let us know if you have any other questions/issues. Thank you, Olivia
alexturkonline
1 Posts
alexturkonline posted this 22 March 2025

It sounds like a theme-related conflict! Since the code works fine in Twenty Seventeen but not in Themler, the issue might be with how Themler handles post updates or custom hooks. Check if ESS Utumishi Portal or any other plugin in your setup interferes with save_post_private-page. Also, ensure functions.php in Themler is correctly executed. Adding error_log('Function triggered'); inside cpc_send_email_on_page_update might help debug if the function runs at all. Hope this helps!

It sounds like a theme-related conflict! Since the code works fine in Twenty Seventeen but not in Themler, the issue might be with how Themler handles post updates or custom hooks. Check if [ESS Utumishi Portal][1] or any other plugin in your setup interferes with save_post_private-page. Also, ensure functions.php in Themler is correctly executed. Adding error_log('Function triggered'); inside cpc_send_email_on_page_update might help debug if the function runs at all. Hope this helps! [1]: https://essutumishiportal.co.tz/
woordnelson6
1 Posts
woordnelson6 posted this 29 July 2025

The issue likely lies in your Themler theme—it may not be firing the save_post_private-page hook properly, or it overrides default behaviors. Try checking if functions.php is loading correctly or if custom post types are used.

Just like choosing reliable online CPC evening courses, theme compatibility matters functionality depends on the right setup.

The issue likely lies in your Themler theme—it may not be firing the save_post_private-page hook properly, or it overrides default behaviors. Try checking if functions.php is loading correctly or if custom post types are used. Just like choosing reliable [online CPC evening courses][1], theme compatibility matters functionality depends on the right setup. [1]: https://www.cpctraining.org/
ahsansahab150
2 Posts
ahsansahab150 posted this 03 March 2026

Minecraft keeps evolving with frequent "game drops" and patches. The Minecraft 26.0 patch (also known as Bedrock Edition 1.26.0), released February 10, 2026, marks a major milestone as the first update under Mojang's new year-based versioning system. Versions in 2026 start with "26" for both Bedrock and Java Editions, making updates easier to track Minecraft Patch Download.

Minecraft keeps evolving with frequent "game drops" and patches. The Minecraft 26.0 patch (also known as Bedrock Edition 1.26.0), released February 10, 2026, marks a major milestone as the first update under Mojang's new year-based versioning system. Versions in 2026 start with "26" for both Bedrock and Java Editions, making updates easier to track [Minecraft Patch Download][1]. [1]: https://sites.google.com/view/minecraftpatchdownload/home
ksarestaurantsz
2 Posts
ksarestaurantsz posted this 07 March 2026

The issue is likely related to how the WordPress theme handles the save_post_private-page action. Some themes (including themes created with Themler) may override or not properly trigger certain hooks.

A better solution is to use the general save_post hook and then check the post type inside the function.

The issue is likely related to how the WordPress theme handles the save_post_private-page action. Some themes (including themes created with Themler) may override or not properly trigger certain hooks. A better solution is to use the general save_post hook and then check the post type inside the [function.][1] [1]: https://ksarestaurantsz.com/%D8%A7%D9%82%D8%B1%D8%A8-%D9%85%D8%B7%D8%B9%D9%85-%D9%85%D9%86-%D9%85%D9%88%D9%82%D8%B9%D9%8A/

Last edited 07 March 2026 by ksarestaurantsz

adilarshad475
1 Posts
adilarshad475 posted this 4 weeks ago

It sounds like a theme-related conflict! Since the code works fine in Twenty Seventeen but not in Themler, the issue might be with how Themler handles post updates or custom hooks. Check if [ESS Utumishi Portal][1] or any other plugin in your setup interferes with save_post_private-page. Also, ensure functions.php in Themler is correctly executed. Adding error_log('Function triggered'); inside cpc_send_email_on_page_update might help debug if the function runs at all. Hope this helps!

[1]: https://essutumishiportal.co.tz/

https://szgames.io/

> It sounds like a theme-related conflict! Since the code works fine in Twenty Seventeen but not in Themler, the issue might be with how Themler handles post updates or custom hooks. Check if [ESS Utumishi Portal][1] or any other plugin in your setup interferes with save_post_private-page. Also, ensure functions.php in Themler is correctly executed. Adding error_log('Function triggered'); inside cpc_send_email_on_page_update might help debug if the function runs at all. Hope this helps! > > > [1]: https://essutumishiportal.co.tz/ https://szgames.io/
buyfolloweruk
1 Posts
buyfolloweruk posted this 4 weeks ago

Many platforms offer easy registration for new users. Players can create an account within a few steps and start playing instantly. To continue to the next step, you can click here and complete the signup process without confusion. Clear instructions guide users properly. This helps save time and effort. Simple steps improve user experience.
https://teenpattiboss.com.pk/

Many platforms offer easy registration for new users. Players can create an account within a few steps and start playing instantly. To continue to the next step, you can click here and complete the signup process without confusion. Clear instructions guide users properly. This helps save time and effort. Simple steps improve user experience. https://teenpattiboss.com.pk/
muhammadgullsher0303
1 Posts
muhammadgullsher0303 posted this 2 weeks ago

Minecraft keeps evolving with frequent "game drops" and patches. The Minecraft 26.0 patch (also known as Bedrock Edition 1.26.0), released February 10, 2026, marks a major milestone as the first update under Mojang's new year-based versioning system. Versions in 2026 start with "26" for both Bedrock and Java Editions, making updates easier to track [Minecraft Patch Download][1].

[1]: https://sites.google.com/view/minecraftpatchdownload/home

https://pizzaedition-net.github.io/

> Minecraft keeps evolving with frequent "game drops" and patches. The Minecraft 26.0 patch (also known as Bedrock Edition 1.26.0), released February 10, 2026, marks a major milestone as the first update under Mojang's new year-based versioning system. Versions in 2026 start with "26" for both Bedrock and Java Editions, making updates easier to track [Minecraft Patch Download][1]. > > > [1]: https://sites.google.com/view/minecraftpatchdownload/home https://pizzaedition-net.github.io/
You must log in or register to leave comments