wandersondantas
5/7/2020 - 3:47 PM

Template Elementor no Dashboard Admin

Criar um modelo do Elementor do tipo Página. Alterar o shortcode no código abaixo para o shortcode gerado do seu modelo e alterar o id do css para o id do seu shortcode.

add_action( 'admin_head', 'rv_custom_dashboard_widget' );
function rv_custom_dashboard_widget() {

	// Bail if not viewing the main dashboard page
	if ( get_current_screen()->base !== 'dashboard' ) {
		return;
	}

	?>

	<div id="custom-id" class="welcome-panel" style="display: none; padding: 20px;">
		<div class="welcome-panel-content" style="margin-left:0px">
			<?php echo do_shortcode('[elementor-template id="585"]'); ?>
		</div>
	</div>
	<script>
		jQuery(document).ready(function($) {
			$('.wrap h1').after($('#custom-id').show());
		});
	</script>

<?php }

add_action( 'admin_init', 'wpdocs_plugin_admin_init' );
function wpdocs_plugin_admin_init() {
	$upload_dir   = wp_upload_dir();
    wp_enqueue_style( 'elementor-pro', plugins_url( 'elementor-pro/assets/css/frontend.min.css' ) );
    wp_enqueue_style( 'elementor-frontend', plugins_url( 'elementor/assets/css/frontend.min.css' ) );
    wp_enqueue_style( 'elementor-icons-shared-0', plugins_url( 'elementor/assets/lib/font-awesome/css/fontawesome.min.css' ) );
    wp_enqueue_style( 'elementor-icons-fa-regular', plugins_url( 'elementor/assets/lib/font-awesome/css/regular.min.css' ) );
    wp_enqueue_style( 'elementor-icons-fa-brands', plugins_url( 'elementor/assets/lib/font-awesome/css/brands.min.css' ) );
    wp_enqueue_style( 'elementor-icons-fa-solid', plugins_url( 'elementor/assets/lib/font-awesome/css/solid.min.css' ) );
    wp_enqueue_style( 'elementor-post-585', $upload_dir['baseurl'].'/elementor/css/post-585.css' ); // Mesmo Id do Shortcode
}