Elementor\Admin::print_switch_mode_button PHP Method

print_switch_mode_button() public method

Print switch button in edit post (which has cpt support).
Since: 1.0.0
public print_switch_mode_button ( $post ) : void
$post
return void
    public function print_switch_mode_button($post)
    {
        if (!User::is_current_user_can_edit($post->ID)) {
            return;
        }
        $current_mode = Plugin::instance()->db->get_edit_mode($post->ID);
        if ('builder' !== $current_mode) {
            $current_mode = 'editor';
        }
        wp_nonce_field(basename(__FILE__), '_elementor_edit_mode_nonce');
        ?>
		<div id="elementor-switch-mode">
			<input id="elementor-switch-mode-input" type="hidden" name="_elementor_post_mode" value="<?php 
        echo $current_mode;
        ?>
" />
			<button id="elementor-switch-mode-button" class="elementor-button button button-primary button-hero">
				<span class="elementor-switch-mode-on"><?php 
        _e('&#8592; Back to WordPress Editor', 'elementor');
        ?>
</span>
				<span class="elementor-switch-mode-off">
					<i class="eicon-elementor"></i>
					<?php 
        _e('Edit with Elementor', 'elementor');
        ?>
				</span>
			</button>
		</div>
		<div id="elementor-editor">
	        <a id="elementor-go-to-edit-page-link" href="<?php 
        echo Utils::get_edit_link($post->ID);
        ?>
">
		        <div id="elementor-editor-button" class="elementor-button button button-primary button-hero">
			        <i class="eicon-elementor"></i>
					<?php 
        _e('Edit with Elementor', 'elementor');
        ?>
		        </div>
		        <div class="elementor-loader-wrapper">
			        <div class="elementor-loader">
				        <div class="elementor-loader-box"></div>
				        <div class="elementor-loader-box"></div>
				        <div class="elementor-loader-box"></div>
				        <div class="elementor-loader-box"></div>
			        </div>
			        <div class="elementor-loading-title"><?php 
        _e('Loading', 'elementor');
        ?>
</div>
		        </div>
	        </a>
		</div>
		<?php 
    }