You’re using add_menu_page
wrong. The function bittech_login_settings
should be only:
function bittech_login_settings() {
add_menu_page(
'BitTech Login Settings',
'BitTech Login Settings',
'add_users',
'bittech_settings',
'bittech_login_settings_callback'
);
}
function bittech_login_settings_callback() {
// content of the menu
}
And put the contents of the page in the callback function bittech_login_settings_callback
. Also, these lines don’t make much sense:
$filename = "../wp-content/plugins/bittech_login/include/config.php";
$contents = file_get_contents($filename);
if($_POST) file_put_contents($filename, $_POST['field']);
You should probably store that field in the database with update_option
and retrieve it with get_option()
.
Related Posts:
- Pass PHP variable to javascript
- Namespaces in WordPress – How do I initiate the main class?
- wordpress get meta value by meta key
- What areas to Unit test while building a plugin?
- update_meta_user difference in i:1 and b:1, how to write b:1
- Registration Form Validation in wordpress
- Errors while using ajax from external wordpress page
- Pass A Value From Outside To A Plugin Variable
- Dequeue / Deregister script and replace it with a new plugin
- How to handle autoloading with composer by keeping the WordPress naming conventions?
- Hide Theme options and Customize Admin menu
- Current user in plugin returns NULL
- What are the benefit in adding hook in the init() hook?
- How can I implement a notification system in wordpress?
- Minimum PHP Required for WordPress
- Update Option Error: Notice: Undefined index
- Why this global array is returning NULL from a callback function
- How to define WordPress plugin shortcode globally for multisite?
- Next and/or previous post content
- Why my Plugin keeps deactivating automatically?
- Self deactivate plugins after an action occurs
- How to get current post user id
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- Input with spaces in Shortcode attributes overwritten by defaults
- switched from query_posts to WP_query, not working now?
- How to find the origin of a file upload from within wp_handle_upload?
- Using a custom plugin to capture input data via Ajax and PHP
- Display post lists in 2nd paragraph
- Ajax contact form widget plugin data not insert in database
- Install Plugin via Code
- Single API call exposed via shortcode with params
- How to output CMB2 select options from repeated groups select elements?
- Is there a way to test that readme looks in other language before submitting translation?
- What would I need to write into a custom plugin in order to add a switch for a custom string of CSS to the edit page?
- Homemade plugin while using Themify Ultra
- How to deal with WordPress and Pocket API to automate content curation on my hosted wordpress blog? [closed]
- WP All Import – Execute Imports
- Create tabs in admin options page from custom post type loop
- ob_start() combined with wp_query
- do_action() hook into load-(page)
- WordPress get_avatar function not correct working
- How can i create page through plugin
- Check if variable is set in filter
- Can I use Symfony components in a plugin that I want to submit to the WordPress plugin repository?
- Custom license for WordPress plugin
- Does using `add_action( ‘init’…` cause performance issues?
- How to write “alt” tag in image for wordpress code?
- Custom Login Page — wp_signon Headers Already Sent?
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- How to create plugin/ page that reads from database
- Why is my WordPress Plugin page requesting my FTP Login Credentials?
- Cross Sells are not being shown in Cart Page. Please Help!
- Plugin not properly prepared for localization
- WordPress Active Plugins
- is it possible to hook every page style?
- Redirect logged in user to somepage on every page view?
- adding custom code as a wordpress plugin
- How to add filter for wordpress plugin?
- How To Create A File Archive in WordPress?
- Adding a jQuery modal dialog to the admin area
- Custom Post Type, Custom Columns List
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- How to upload large media file in chunks, without any plugin?
- How to set Google Analytics tracking code on WordPress plugin directory page?
- How to add styles to a submenu page?
- How to store a secret for a plugin inside public_html
- Cannot run script properly with my custom plugin
- Cookie value changes back to previous value after changing
- Problem with checked box on wp car manager plugin
- How to use functions found inside pluggable.php with my plugin files
- Is it okay to make a plugin to the WordPress repo, but limit it’s actions to maximum N events?
- Highlight admin menu items that are parent of existing core items
- Create a link that calls our custom function in WordPress
- Getting all woocommerce products from REST API call in plugin
- Update a previous version of plugin when the new plugin is built from the scratch
- AJAX update fails for public/non-admin users
- WordPress Product Detail and catalog
- Woocommerce list variations that are added already to cart in Single Product
- Plugin json page
- search into subcategories plugin subcategory value not come
- Why isn’t my plugin seeing other classes?
- How Can the_post Be Hooked Like the_content and the_excerpt?
- Create Database Tables on Plugin Activation hook
- How to tell which Plugin is displaying?
- Change page according to fetched GET Parameters
- How to change a specific page to custom page?
- Get Core Functionality from Within a (Secondary) Plugin File
- wp_insert_post_data filter to set category
- Plugin keeps saying needs to be updated and it’s in a constant loop [closed]
- How use Dynamic hyperlink on each wordpress post?
- _e in wordpress +
- How to provide access to specific plugin to all the user roles except subscriber in wordpress
- Output pure JSON wordpress
- how to remove a rel=”nofollow” using call to action plugin
- Activate plugin button do nothing [closed]
- How to add custom html to the Media > Attachment Details modal?
- manage_{taxonomy}_custom_column not working
- How to be Variables and options must be escaped when echo’d?
- How to override plugin function in code snippets WordPress
- How do i fix this error?