Skip to content

Instantly share code, notes, and snippets.

@deckerweb
Last active October 2, 2018 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deckerweb/a39987319fb7a2f51126a26c7a6ee662 to your computer and use it in GitHub Desktop.
Save deckerweb/a39987319fb7a2f51126a26c7a6ee662 to your computer and use it in GitHub Desktop.
Map the document type "Page" (now labelled as "Content") of Elementor Templates as a submenu to (regular) WordPress Pages. This results in a nice quick jump link in your left-hand admin menu ;-).
<?php
/** Do NOT include the opening php tag */
add_action( 'admin_menu', 'ddw_map_elementor_document_type_page_submenu' );
/**
* Map the Elementor Template document type "Page" as a submenu under WordPress
* regular "Pages".
*
* @author David Decker - DECKERWEB
* @link https://gist.github.com/deckerweb/a39987319fb7a2f51126a26c7a6ee662
*
* @uses add_submenu_page()
*/
function ddw_map_elementor_document_type_page_submenu() {
add_submenu_page(
'edit.php?post_type=page',
esc_html__( 'Elementor Template Pages', 'your-textdomain' ),
esc_html__( 'Elementor Template Pages', 'your-textdomain' ),
'edit_theme_options',
esc_url( admin_url( 'edit.php?post_type=elementor_library&elementor_library_type=page' ) )
);
} // end function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment