Send email messages after comment was submitted

For comment approved, you can review this question Approve comment hook? For comment submitted, you can hook into the comment_post hook, like function show_message_function( $comment_ID, $comment_approved ) { if( 0 === $comment_approved ){ //function logic goes here } } add_action( ‘comment_post’, ‘show_message_function’, 10, 2 ); Code copied from https://developer.wordpress.org/reference/hooks/comment_post/

WordPress Count posts within a custom post type

It looks that this code is very old. Function wp_start() is deprecated since WordPress 1.5 (Documentation). But you wanted to know how it code is counting so: $posts = get_posts(‘numberposts=6&offset=0’); – get 6 posts foreach ($posts as $post) : – iterate over each post static $count1 = 0; – initializes $count1 variable $count1++; – increase … Read more

Custom Fields not showing up for custom post type

If you have created an Class in your plugin then you should use the action hook for admin_init in class only just like you have used “init” function __construct() { add_action( ‘init’, array( $this, ‘register_custom_post_type’ ) ); add_action( ‘admin_init’, array( $this, ‘add_artbeat_meta_boxes’ ) ); add_action( ‘save_post’, array( $this, ‘save_artbeat_custom_fields’ ) ); } Hope this will … Read more