You’re making something completely wrong.
Header comment
In your main file, you need the following comment on top (ex. taken from Contact form 7):
<?php
/*
Plugin Name: Contact Form 7
Plugin URI: http://contactform7.com/
Description: Just another contact form plugin. Simple but flexible.
Author: Takayuki Miyoshi
Author URI: http://ideasilo.wordpress.com/
Text Domain: wpcf7
Domain Path: /languages/
Version: 3.1.2
*/
WP will detect the plugin automagically. Then simply define/require/include
what you need. The plugin will then be loaded just before the plugins_loaded
hook, which is the first one available to you. You then can use the complete WP environment.
Related Posts:
- Using WPDB to output raw XML fails because of wp-blog-header.php
- how to search users by ajax live search
- Storing data in wordpress database from ajax call from different website
- How to include files in the loop via ajax
- Is it mandatory to use $wpdb->prefix in custom tables
- $wpdb->insert_id
- How can I run AJAX on a button click event?
- Check for success of $wpdb->update() correctly
- WordPress and multithreading
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- Empty POST data on server on AJAX request using Angular $http
- Build path for a custom portfolio plugin
- Using AJAX in a plugin to submit form – REALLY confused
- wp_localize_script $handle
- $wpdb->insert is changing a value
- Actions or filters fired when data is saved in a custom table
- get all products of one category
- Really simple query giving error in SQL syntax
- How to post form in ajax mode and handle it in wordpress
- Using Ajax call in jQuery doesn’t work in widget
- why creating tables using $wpdb is not being executed while installing plugins?
- WP_LOCALIZE_SCRIPT doesn’t work
- Using $wpdb object in a widget
- Ajax in WordPress – path issue
- Cannot search post by taxonomy
- $wpdb -> Batch insert from XML File?
- WP AJAX is not working, always returns 0
- Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script
- Slow WP_query due to nested wp_query. Need Suggestions
- creating custom function to log actions in plugin
- SQL query for custom taxonomy slugs
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- How to localize admin.php only once
- Intermittent database errors when accessing WordPress database
- How to get Metabox custom field to show checked if value is updated using post meta query?
- Create custom HTML/JS app inside page
- wpdb->prepare and mysql UPDATE – how is it done?
- Update Data parameter of a wp_localize_script() call
- jquery & ajax sending data to php
- wp_localize_script is not adding a global variable for javascript
- Can’t get AJAX call working in custom plugin
- 400 Bad Request, in wordpress theme development, wp_ajax
- Ajax is not working in a loop
- Are there any security risks when submitting data-attribute data through AJAX?
- How to get error object returned by wp_create_user
- $wpdb->update() always need a second try
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Data not insert and update through ajax and jQuery in admin page?
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- AJAX button with success callback. (Titan Framework)
- ajax working when function is on child theme but not in plugin page
- About a programming language starts with [closed]
- Data inserted by wpdb insert is different than data pressnt in database.
- add_action wp_ajax_ not loading in plugin file WP Network
- $wpdb->prepare is not working like mysql_real_escape_string
- Workflow for new importer plugin – your advices?
- Ajax +wordpress onClick link redirect to new page and create html content
- How to relate the Category to user?
- Why doesn’t my Table get created?
- can’t access some WordPress function from my plugin
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- How to do admin ajax request in a plugin for rest api
- Ajax action has 200 status but response of No response data available for this request
- How to display specific data from a custom table to logged in users with a custom role
- Jquery php request is returning a weird result
- WordPress Does not grab the string sends useing AJAX response, wp_ajax hook
- Posts form with AJAX request – Plugin development
- Bad request 400 using class based files
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- How to store sensitive user data (passwords)
- I’m including a html file in my plugin, but it can’t find its css or js files
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- ajax-action.php can’t find added action
- AJAX call of function containing javascript which is not loaded (Plugin development)
- Including content into an add_shortcode() function
- Performing ajax request in wordpress
- ajax multiple Values
- How to handle ajax Request in a complex-structured plugin?
- Using JavaScript in WordPress page to call for server data using AJAX
- User avatar-ACF fields
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Filterable posts using categories
- Ajax Response Error | just getting error as the response
- Update database record in plugin
- PHP includes with AJAX actions
- admin-ajax.php returns “No Script Kiddies!” sometimes
- WordPress function is not called and ajax return 0
- Dedicated server and WPDB Class : huge slow-down of the website
- How to CRUD from wordpress database in wordpress theme?
- Ajax functionality not being called under wordpress plugin
- Array/List Edit in Backend
- I can’t write in my DB using $wpdb->insert
- $wpdb how can i save my postmeta table before querying it
- WordPress plugin: admin-ajax.php not passing data to custom function
- Ajax functions – no access to wp-admin.php only online
- Page reload occurs before request finishes
- PHPUnit Ajax Serialization of ‘Closure’ is not allowed
- Return custom product in ajax call loop
- multiple record insert creating many duplicate records