source/php/Editor.php
public function adminBar()
    {
        if (isset($_GET['id'])) {
            if (is_numeric($_GET['id']) && $_GET['id'] > 0) {
                $post = get_post($_GET['id']);

                if (!$post) {
                    return;
                }

                setup_postdata($post);

                add_action('admin_bar_menu', function () use ($post) {
                    global $wp_admin_bar;
                    $wp_admin_bar->add_node(array(
                        'id' => 'view_page',
                        'title' => __('View Page'),
                        'href' => get_permalink($post->ID),
                        'meta' => array(
                            'target' => '_blank'
                        )
                    ));
                }, 1050);

                self::$isEditing = array(
                    'id' => $post->ID,
                    'title' => $post->post_title
                );

                wp_reset_postdata();
            } else {
                global $archive;
                $archive = $_GET['id'];

                self::$isEditing = array(
                    'id' => null,
                    'title' => $archive
                );
            }

            self::$isEditing = apply_filters('Modularity/is_editing', self::$isEditing);

            add_action('Modularity/options_page_title_suffix', function () {
                echo ': ' . self::$isEditing['title'];
            });
        }
    }
public function adminBar()
    {
        if (isset($_GET['id'])) {
            if (is_numeric($_GET['id']) && $_GET['id'] > 0) {
                $post = get_post($_GET['id']);

                if (!$post) {
                    return;
                }

                setup_postdata($post);

                add_action('admin_bar_menu', function () use ($post) {
                    global $wp_admin_bar;
                    $wp_admin_bar->add_node(array(
                        'id' => 'view_page',
                        'title' => __('View Page'),
                        'href' => get_permalink($post->ID),
                        'meta' => array(
                            'target' => '_blank'
                        )
                    ));
                }, 1050);

                self::$isEditing = array(
                    'id' => $post->ID,
                    'title' => $post->post_title
                );

                wp_reset_postdata();
            } else {
                global $archive;
                $archive = $_GET['id'];

                self::$isEditing = array(
                    'id' => null,
                    'title' => $archive
                );
            }

            self::$isEditing = apply_filters('Modularity/is_editing', self::$isEditing);

            add_action('Modularity/options_page_title_suffix', function () {
                echo ': ' . self::$isEditing['title'];
            });
        }
    }
public function adminBar ( ) { if ( isset ( $ _GET [ 'id' ] ) ) { if ( is_numeric ( $ _GET [ 'id' ] ) && $ _GET [ 'id' ] > 0 ) { $ post = get_post ( $ _GET [ 'id' ] ) ; if ( ! $ post ) { return ; } setup_postdata ( $ post ) ; add_action ( 'admin_bar_menu' , function ( ) use ( $ post ) { global $ wp_admin_bar ; $ wp_admin_bar -> add_node ( array ( 'id' => 'view_page' , 'title' => __ ( 'View Page' ) , 'href' => get_permalink ( $ post -> ID ) , 'meta' => array ( 'target' => '_blank' ) ) ) ; } , 1050 ) ; self :: $ isEditing = array ( 'id' => $ post -> ID , 'title' => $ post -> post_title ) ; wp_reset_postdata ( ) ; } else { global $ archive ; $ archive = $ _GET [ 'id' ] ; self :: $ isEditing = array ( 'id' => null , 'title' => $ archive ) ; } self :: $ isEditing = apply_filters ( 'Modularity/is_editing' , self :: $ isEditing ) ; add_action ( 'Modularity/options_page_title_suffix' , function ( ) { echo ': ' . self :: $ isEditing [ 'title' ] ; } ) ; } }
Handle admin bar stuff
@return void
Handle admin bar stuff