Replies
Viewing 4 posts - 1 through 4 (of 4 total)
So what is your recommendation?
function my_assessment_score($atts) {
// Parse the shortcode attributes
$atts = shortcode_atts(array(
‘post_id’ => null, // Default to null if no post ID is provided
), $atts, ‘assessment_score’);// Determine the post ID to use
$post_id = $atts[‘post_id’] ? intval($atts[‘post_id’]) : get_the_ID();// Return the assessment score for the specified post ID
return get_post_meta($post_id, ‘assessment_score’, true);
}
add_shortcode(‘assessment_score’, ‘my_assessment_score’);this still didn’t work
Viewing 4 posts - 1 through 4 (of 4 total)