function amt_add_metadata_review($post_body)
{
    if (is_singular()) {
        // Get current post object
        $post = get_queried_object();
        if (is_null($post)) {
            return $post_body;
        }
        // Check if metadata is supported on this content type.
        $post_type = get_post_type($post);
        if (!in_array($post_type, amt_get_supported_post_types())) {
            return $post_body;
        }
        // Check if Review Mode is enabled
        $options = get_option("add_meta_tags_opts");
        if ($options["review_mode"] == "0") {
            return $post_body;
        }
        // Only administrators can see the review box.
        if (current_user_can('create_users')) {
            $post_body = amt_get_metadata_review() . '<br /><br />' . $post_body;
        }
    }
    return $post_body;
}
Exemple #2
0
function amt_metadata_review_mode_print()
{
    $options = get_option("add_meta_tags_opts");
    do_action('amt_metadata_review_mode_pretext');
    echo amt_get_metadata_review($options, $add_as_view = true) . '<br /><br />';
    do_action('amt_metadata_review_mode_posttext');
}