= (int) $optionReview && $optionReview !== '0') { add_action('admin_enqueue_scripts', 'forumax_notify_enqueue_script'); // Hook to admin_enqueue_scripts $bbpc_installed = get_option('bbpc_installed'); // Check if timestamp exists if ( $bbpc_installed ) { // Add 7days to the timestamp $show_notice = $bbpc_installed + (7 * 24 * 60 * 60); // Get the current time $current_time = current_time('timestamp'); // Compare current time with timestamp + 7 days if ( $current_time >= $show_notice ) { add_action('admin_notices', 'forumax_notify_give_review'); } } } function forumax_notify_enqueue_script() { wp_enqueue_script( 'bbpc-notify-review' ); } add_action('wp_ajax_bbpc_notify_save_review', 'forumax_notify_save_review'); /** ** Give Notice **/ function forumax_notify_give_review() { $forums = get_pages( [ 'post_type' => 'forum', 'post_status' => 'publish' ] ); $forums = is_array( $forums ) ? $forums : []; $topics = get_pages( [ 'post_type' => 'topic', 'post_status' => 'publish' ] ); $topics = is_array( $topics ) ? $topics : []; ?>
0 ? " and " . $topics_count . " topics" : '';
echo wp_kses(
sprintf(
/* translators: 1: number of forums created, 2: additional topics text */
__( 'You have created %1$d forums%2$s with Forumax. That\'s awesome! May we ask you to give it a 5-Star rating on WordPress?
It will help us spread the word and boost our motivation.', 'forumax' ),
count( $forums ),
$topics_text
),
array(
'b' => array(), // Allow tag
'strong' => array(), // If needed, allow tag
'br' => array(), // If needed, allow
tag
)
);
}
?>