=' ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_minimum_elementor_version' ) ); return; } // Check for required PHP version if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_minimum_php_version' ) ); return; } // Once we get here, We have passed all validation checks so we can safely include our plugin require_once( 'plugin.php' ); } /** * Admin notice * * Warning when the site doesn't have Elementor installed or activated. * * @since 1.0.0 * @access public */ public function admin_notice_missing_main_plugin() { if ( isset( $_GET['activate'] ) ) { unset( $_GET['activate'] ); } $message = sprintf( /* translators: 1: Plugin name 2: Elementor */ esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'add-instagram-feed-for-elementor' ), '' . esc_html__( 'Instagram Feed For Elementor', 'add-instagram-feed-for-elementor' ) . '', '' . esc_html__( 'Elementor', 'add-instagram-feed-for-elementor' ) . '' ); printf( '

%1$s

', $message ); } /** * Admin notice * * Warning when the site doesn't have a minimum required Elementor version. * * @since 1.0.0 * @access public */ public function admin_notice_minimum_elementor_version() { if ( isset( $_GET['activate'] ) ) { unset( $_GET['activate'] ); } $message = sprintf( /* translators: 1: Plugin name 2: Elementor 3: Required Elementor version */ esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'add-instagram-feed-for-elementor' ), '' . esc_html__( 'Instagram Feed For Elementor', 'add-instagram-feed-for-elementor' ) . '', '' . esc_html__( 'Elementor', 'add-instagram-feed-for-elementor' ) . '', self::MINIMUM_ELEMENTOR_VERSION ); printf( '

%1$s

', $message ); } /** * Admin notice * * Warning when the site doesn't have a minimum required PHP version. * * @since 1.0.0 * @access public */ public function admin_notice_minimum_php_version() { if ( isset( $_GET['activate'] ) ) { unset( $_GET['activate'] ); } $message = sprintf( /* translators: 1: Plugin name 2: PHP 3: Required PHP version */ esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'add-instagram-feed-for-elementor' ), '' . esc_html__( 'Instagram Feed For Elementor', 'add-instagram-feed-for-elementor' ) . '', '' . esc_html__( 'PHP', 'add-instagram-feed-for-elementor' ) . '', self::MINIMUM_PHP_VERSION ); printf( '

%1$s

', $message ); } /// function admin_menu() { add_menu_page( __( 'Instagram Feed For Elementor', 'add-instagram-feed-for-elementor' ), __( 'Instagram Feed For Elementor', 'add-instagram-feed-for-elementor' ), 'manage_options', 'add-instagram-feed-for-elementor', array( $this, 'custom_menu_page' ), plugins_url( 'add-instagram-feed-for-elementor/assets/img/insta-icon.png' ), '966.1234' ); } function custom_menu_page(){ if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'add-instagram-feed-for-elementor' ) ); } require plugin_dir_path( __FILE__ ) . 'options.php'; } function register_setting(){ register_setting( 'iffe_option_group', 'iffe_options' ); } function instagram_feed_for_elementor_hook_admin_head() { wp_enqueue_style('add-instagram-feed-for-elementor-admin', plugins_url('/assets/css/admin-style.css', __FILE__) ); } } // Instantiate Instagram_Feed_For_Elementor. new Instagram_Feed_For_Elementor();