文件操作 - highlevel.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/forteagencynew/public_html/wp-content/plugins/WP-Highlevel/highlevel.php
编辑文件内容
<?php /* Plugin Name: WP - GohighLevel Integration Plugin URI: https://theforteagency.com/ Description: Integrates Gohighlevel data in wordpress Version: 1.0.0 Author: Forte Agency */ // Disallow direct access if( !defined( 'ABSPATH' ) ) { die( 'Direct access not allowed.' ); } /* * Create Plugin Settings Admin Menu when plugin is activated */ add_action('admin_menu', 'highLevel_admin_menu'); function highLevel_admin_menu(){ $userEmails = array('jessica@theforteagency.com', 'kenil@theforteagency.com'); $current_user = wp_get_current_user(); $userData = get_userdata(get_current_user_id()); if(is_array($userEmails) && in_array($userData->data->user_email, $userEmails)){ add_menu_page( 'WP-GoHighLevel', 'WP-GoHighLevel', 'manage_options', 'gh-general', 'HighLevel_General_Settings_Page', 'dashicons-megaphone'); add_submenu_page( 'gh-general', 'WP-GoHighLevel Workflows', 'Workflows', 'manage_options', 'gh-workflows', 'HighLevel_Workflow_Settings_Page' ); //add_submenu_page( 'btm-pn-general', 'BTM-PublicNotice - Category Lists', 'Category Lists', 'manage_options', 'btm-pn-category', 'BTM_PN_Category_Settings_Page' ); //add_submenu_page( 'btm-pn-general', 'BTM-PublicNotice - Content Layout', 'Content Layout', 'manage_options', 'btm-pn-content-layout', 'BTM_PN_Content_Settings_Page' ); } } /* * CallBack for Highlevel Settings page */ function HighLevel_General_Settings_Page(){ settings_errors( 'HighLevel_Settings' ); $HighLevel_Settings = get_option('HighLevel_Settings'); $ApiUrl = (isset($HighLevel_Settings['api_url']) && $HighLevel_Settings['api_url'] != '') ? $HighLevel_Settings['api_url'] : ''; $CompanyId = (isset($HighLevel_Settings['company_id']) && $HighLevel_Settings['company_id'] != '') ? $HighLevel_Settings['company_id'] : ''; $LocationId = (isset($HighLevel_Settings['location_id']) && $HighLevel_Settings['location_id'] != '') ? $HighLevel_Settings['location_id'] : ''; $ApiVersion = (isset($HighLevel_Settings['api_version']) && $HighLevel_Settings['api_version'] != '') ? $HighLevel_Settings['api_version'] : ''; $client_id = (isset($HighLevel_Settings['client_id']) && $HighLevel_Settings['client_id'] != '') ? $HighLevel_Settings['client_id'] : ''; $client_secret = (isset($HighLevel_Settings['client_secret']) && $HighLevel_Settings['client_secret'] != '') ? $HighLevel_Settings['client_secret'] : ''; $marketplace_username = (isset($HighLevel_Settings['marketplace_username']) && $HighLevel_Settings['marketplace_username'] != '') ? $HighLevel_Settings['marketplace_username'] : ''; $marketplace_pass = (isset($HighLevel_Settings['marketplace_pass']) && $HighLevel_Settings['marketplace_pass'] != '') ? $HighLevel_Settings['marketplace_pass'] : ''; ?> <div class="wrap Api_admin"> <h2><?php _e( 'WP-GoHighLevel Integration' ); ?></h2> <h3><?php _e( 'HighLevel API Settings' ); ?></h3> <form method="post" action="options.php" enctype="multipart/form-data"> <?php settings_fields( 'HighLevel_Settings'); ?> <table class="form-table"> <tbody> <tr valign="top"> <td> <a href="javascript:void(0)" title="Generate Authorization Code" id="gen_auth_code" class="gen_auth_code" style="text-decoration: none;background: #9E9E9E;color: #fff;padding: 0.75rem;border: 1px solid #9e9e9e;border-radius: 5px;font-weight: 500;">Get authorization code</a> </td> </tr> <tr valign="top"> <th scope="row"><label for="HighLevel_Settings[api_url]"><?php _e('HighLevel Integration Api URL') ?></label></th> <td> <input size="80" type="text" name="HighLevel_Settings[api_url]" value="<?php echo $ApiUrl;?>" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="HighLevel_Settings[company_id]"><?php _e('HighLevel Company ID') ?></label></th> <td> <input size="80" type="text" name="HighLevel_Settings[company_id]" value="<?php echo $CompanyId;?>" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="HighLevel_Settings[location_id]"><?php _e('HighLevel Location ID') ?></label></th> <td> <input size="80" type="text" name="HighLevel_Settings[location_id]" value="<?php echo $LocationId;?>" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="HighLevel_Settings[client_id]"><?php _e('HighLevel Auth Client ID') ?></label></th> <td> <input size="80" type="text" name="HighLevel_Settings[client_id]" value="<?php echo $client_id;?>" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="HighLevel_Settings[client_secret]"><?php _e('HighLevel Auth Client Secret') ?></label></th> <td> <input size="80" type="text" name="HighLevel_Settings[client_secret]" value="<?php echo $client_secret;?>" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="HighLevel_Settings[api_version]"><?php _e('HighLevel API Version') ?></label></th> <td> <input size="80" type="text" name="HighLevel_Settings[api_version]" value="<?php echo $ApiVersion;?>" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="HighLevel_Settings[marketplace_username]"><?php _e('HighLevel MarketPlace Login Username') ?></label></th> <td> <input size="80" type="text" name="HighLevel_Settings[marketplace_username]" value="<?php echo $marketplace_username;?>" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="HighLevel_Settings[marketplace_pass]"><?php _e('HighLevel MarketPlace Login Password') ?></label></th> <td> <input size="80" type="password" name="HighLevel_Settings[marketplace_pass]" value="<?php echo $marketplace_pass;?>" /> </td> </tr> </tbody> </table> <p class="submit"><input class="button-primary" type="submit" name="submit" value="Save Changes" /></p> </form> </div> <?php } /* * Register Custom Settings in Options Table */ add_action( 'admin_init', 'Highlevel_register_settings'); function Highlevel_register_settings(){ register_setting( 'HighLevel_Settings', 'HighLevel_Settings'); } /* * Register custom style file for back end */ add_action('admin_enqueue_scripts', 'enqueueAdminStylesheet'); function enqueueAdminStylesheet(){ wp_register_style('HL-datatablecss', 'https://cdn.datatables.net/2.1.8/css/dataTables.dataTables.min.css'); wp_enqueue_style('HL-datatablecss'); wp_register_script('HL-datatablejs', 'https://cdn.datatables.net/2.1.8/js/dataTables.min.js', array('jquery')); wp_enqueue_script('HL-datatablejs'); wp_register_script('HL-Adminjavascript', plugins_url('/assets/JS/admin.js', __FILE__), array('jquery'), time()); wp_enqueue_script('HL-Adminjavascript'); } /* * CallBack for Highlevel Workflows page */ function HighLevel_Workflow_Settings_Page(){ require_once 'class-wp-highlevel.php'; $HighLevel_API = new Wp_HigheLevel(); ?> <div class="wrap Api_admin"> <h2><?php _e( 'WP-GoHighLevel Integration' ); ?></h2> <h3><?php _e( 'Highlevel Workflows'); ?></h3> <div class="workflow_display"> <?php $workflows = $HighLevel_API->getHighLevelAPIResponse('workflows'); ?> </div> </div> <?php } /* * Register rest API route for Authorization code */ add_action( 'rest_api_init', 'marketplace_authorization_code_generation'); function marketplace_authorization_code_generation(){ $namespace = 'gh'; $base = 'authorization'; register_rest_route( $namespace, '/' . $base, array( 'methods' => 'POST', 'callback' => 'generate_authorization_code', 'permission_callback' => '__return_true', ) ); } function generate_authorization_code($data){ }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件