"Elementor" Column in the Pages List
Adds a column to the Pages screen that shows which pages are built with Elementor, so you know before you click whether to open Elementor or the block editor.
Opens WPIDE on
Code
// Post types that get the column.
$wpide_el_column_types = array( 'page' );
add_action( 'admin_init', function () use ( $wpide_el_column_types ) {
foreach ( $wpide_el_column_types as $type ) {
add_filter( "manage_{$type}_posts_columns", function ( $columns ) {
$columns['wpide_elementor'] = 'Elementor';
return $columns;
} );
add_action( "manage_{$type}_posts_custom_column", function ( $column, $post_id ) {
if ( 'wpide_elementor' !== $column ) {
return;
}
if ( 'builder' === get_post_meta( $post_id, '_elementor_edit_mode', true ) ) {
echo '<span class="dashicons dashicons-yes" aria-hidden="true"></span><span class="screen-reader-text">Built with Elementor</span>';
} else {
echo '<span aria-hidden="true">—</span>';
}
}, 10, 2 );
}
} );
add_action( 'admin_head', function () {
echo '<style>.column-wpide_elementor{width:90px;text-align:center!important;}</style>';
} );
Notes
Add post to $wpide_el_column_types to show the column on the Posts screen too.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.