Remove admin sidebar page

This commit is contained in:
Michael Thomas 2022-04-15 12:57:12 -04:00
parent 39c65dcbce
commit 8e0cfdac2f
2 changed files with 0 additions and 67 deletions

View File

@ -43,7 +43,6 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
// Initialization actions // Initialization actions
private static $actions = array( private static $actions = array(
'admin_init', 'admin_init',
'admin_menu',
'init', 'init',
'wp_ajax_cognito_tinymce_dialog' 'wp_ajax_cognito_tinymce_dialog'
); );
@ -188,14 +187,6 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
wp_die(); wp_die();
} }
// Initialize administration menu (left sidebar)
public function admin_menu() {
add_menu_page( 'Cognito Forms', 'Cognito Forms', 'manage_options', 'Cognito', array( $this, 'main_page' ), "data:image/svg+xml;base64," . base64_encode( file_get_contents( plugin_dir_path( __FILE__ ) . 'cogicon.svg' ) ) );
add_submenu_page( 'Cognito', 'Cognito Forms', 'View Forms', 'manage_options', 'Cognito', array( $this, 'main_page' ) );
add_submenu_page( 'Cognito', 'Create Form', 'New Form', 'manage_options', 'CognitoCreateForm', array( $this, 'main_page' ) );
add_submenu_page( 'Cognito', 'Templates', 'Templates', 'manage_options', 'CognitoTemplates', array( $this, 'main_page' ) );
}
// Called when a 'CognitoForms' shortcode is encountered, renders form embed script // Called when a 'CognitoForms' shortcode is encountered, renders form embed script
public function render_cognito_shortcode( $atts, $content = null, $code = '' ) { public function render_cognito_shortcode( $atts, $content = null, $code = '' ) {
// Default to key setting, unless overridden in shortcode (allows for modules from multiple orgs) // Default to key setting, unless overridden in shortcode (allows for modules from multiple orgs)
@ -205,11 +196,6 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
return CognitoAPI::get_form_embed_script( $key, $atts['id'] ); return CognitoAPI::get_form_embed_script( $key, $atts['id'] );
} }
// Entrypoint for Cognito Forms access
public function main_page() {
include 'templates/main.php';
}
// Add support for oEmbed using the generic Gutenberg Embed block // Add support for oEmbed using the generic Gutenberg Embed block
public function oembed_init() { public function oembed_init() {
wp_oembed_add_provider( '#https?://(www\.)?cognitoforms\.com/.*#i', 'https://www.cognitoforms.com/f/oembed/', true ); wp_oembed_add_provider( '#https?://(www\.)?cognitoforms\.com/.*#i', 'https://www.cognitoforms.com/f/oembed/', true );

View File

@ -1,53 +0,0 @@
<?php
/**
* Cognito Forms WordPress Plugin.
*
* The Cognito Forms WordPress Plugin is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* The Cognito Forms WordPress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
$url = CognitoAPI::$formsBase;
if ($_GET['page'] == 'CognitoCreateForm') {
$url = $url . '/forms/new';
} elseif ($_GET['page'] == "CognitoTemplates") {
$url = $url . '/templates';
} else {
$url = $url . '/forms';
}
?>
<iframe id="cognito-frame" src="<?= $url ?>"></iframe>
<style>
body {
overflow: hidden;
}
#wpcontent {
padding-left: 0!important;
}
#wpfooter {
display: none;
}
#wpwrap, #wpcontent, #wpbody, #wpbody-content {
height: 100%;
}
#wpbody-content *:not(#cognito-frame) {
display: none!important;
}
#cognito-frame {
width: 100%;
height: 100%;
overflow-x: hidden;
}
</style>