Cornerstone Indicator on Post/Page Admin Lists

It drives me nuts having some pages edited in Cornerstone and others not, as I have to go back and forth between editors to find the right one. So, I added a Cornerstone icon next to the titles. I highly suggest this as a feature on future versions.

/**
 * Add an indicator to post title on admin post list specifying if post is edited in Cornerstone
 */
add_filter( 'display_post_states', 'ecs_add_post_state', 10, 2 );
function ecs_add_post_state( $post_states, $post ) {
    if (eri_edited_in_cs_indicator( $post->ID )) {
        $post_states[] = eri_edited_in_cs_indicator( $post->ID );
    }
    return $post_states;
}
// Return the indicator
function eri_edited_in_cs_indicator( $post_id ){
    if (get_post_meta( $post_id, '_cornerstone_data', true ) && 
        get_post_meta( $post_id, '_cornerstone_data', true ) != '' && 
        get_post_meta( $post_id, '_cornerstone_data', true ) != array()) {

            // Cornerstone icon
            return '<div class="wp-menu-image svg" style="width: 19px; display: inline-block; background-image: url(&quot;data:image/svg+xml;base64,CiAgICA8c3ZnIGZpbGw9IiNhN2FhYWQiIHZpZXdCb3g9IjAgMCA3OTIgNzgwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNNDMuMzYzNjA5NSw4Ni45NjQxMjgzIEw3MzYuMzYzNjA5LDAuMzg2ODI3NTk5IEM3NjMuNDkwODI2LC0zLjAwMjIwNzMyIDc4OC4yMjkxMzYsMTYuMjQxMzkxMiA3OTEuNjE4MTcxLDQzLjM2ODYwNzkgQzc5MS44NzI0NzgsNDUuNDA0MTgzNCA3OTIsNDcuNDUzNTk5MSA3OTIsNDkuNTA0OTk4NSBMNzkyLDcyOS42MjU5NDEgQzc5Miw3NTYuOTY0MDM2IDc2OS44MzgwOTUsNzc5LjEyNTk0M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QzUwMi42OTU0NzUsMzYwLjgzNTI4NCA0NzQuMTgzNDc1LDM1NC4xMDY5OTEgNDc0LjE4MzQ3NSwzMjkuOTY0MjkyIEM0NzQuMTgzNDc1LDMwOS4zODM2MzEgNDkyLjc5NTQ3NSwyOTMuMTU2NTcxIDUzMS42MDM0NzUsMjkzLjE1NjU3MSBDNTYxLjY5OTQ3NSwyOTMuMTU2NTcxIDU4Ny44MzU0NzUsMzA4LjE5NjI4NSA1OTcuMzM5NDc1LDMyNC4wMjc1NjMgTDYzOC45MTk0NzUsMzAyLjY1NTMzOCBaIj48L3BhdGg+CiAgICAgIDwvZz4KICAgIDwvc3ZnPgoKICAgIA==&quot;) !important;" aria-hidden="true"><br></div>';
    } else {
        return false;
    }
}

Hi @tkulow,

It’s a wonderful suggestion. I will surely add this to our Feature Request list, so it might be taken into account in the future.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.