Skip to content

Instantly share code, notes, and snippets.

@richaber
Last active June 27, 2022 15:24
Show Gist options
  • Save richaber/1469ab31e157f132be7a520342780c24 to your computer and use it in GitHub Desktop.
Save richaber/1469ab31e157f132be7a520342780c24 to your computer and use it in GitHub Desktop.
WordPress var_export

WP_Screen object returned by get_current_screen(). https://developer.wordpress.org/reference/functions/get_current_screen/

<?php

$current_screen = get_current_screen();

/** @var \WP_Screen $current_screen */
$current_screen = WP_Screen::__set_state(
    [
        'action'                 => 'add',
        'base'                   => 'post',
        'columns'                => 0,
        'id'                     => 'youtube',
        'in_admin'               => 'site',
        'is_network'             => false,
        'is_user'                => false,
        'parent_base'            => null,
        'parent_file'            => null,
        'post_type'              => 'youtube',
        'taxonomy'               => '',
        '_help_tabs'             =>
            [],
        '_help_sidebar'          => '',
        '_screen_reader_content' =>
            [],
        '_options'               =>
            [
                'layout_columns' =>
                    [
                        'max'     => 2,
                        'default' => 2,
                    ],
            ],
        '_show_screen_options'   => null,
        '_screen_settings'       => null,
        'is_block_editor'        => false,
    ]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment