The string used in WordPress to identify the plugin is:
plugin_basename($file);
… where $file
is a file with the plugin headers.
So if you are in your plugin, get the slug with:
$slug = plugin_basename( __FILE__ );
Related Posts:
- What user roles should have wp_unique_post_slug_is_bad_flat_slug filter applied?
- Redirect to another page using contact form 7? [closed]
- How to define the slug for my custom plugin?
- What’s the preferred method of writing AJAX-enabled plugins?
- How to add a shortcode button to the TinyMCE editor?
- Giving Multiple Authors Access to a Plugin’s WP.org Repo
- How to stop showing admin notice after close button has been clicked
- How to save the values of checkbox to the register setting?
- Creating a default Custom Post Template that a Theme can override
- How to get Login Error messages on a custom template
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- How do I check if my $wpdb->insert() was successful?
- Claim Listing functionality – how to send email to users when their claim has been approved or denied
- Creating a theme option page?
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Add post thumbnail from external image with plugin
- Where is the source code that makes the “all” array grabs filters in the $wp_filter?
- Options page not displayed under Settings menu
- Is it possible to add an action to the currently running action?
- Created Widget Not Showing up on Admin Panel
- How to include and use custom class files in plugin?
- How do I get slug of all active plugins programmatically?
- Action on post publish
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- wp_enqueue_scripts not working inside shortcode
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- unzip a folder on specific location and delete the zip file
- Handling jQuery Component Collision
- Change settings of get_post_type_object
- Changing labels of status filters for post grid
- Where to call add_shortcode function in WordPress Plugin Boilerplate?
- How to keep users unique id stored in session in addition to IP in WordPress plugin?
- Plugin version is not showing up in wordpress.org plugin directory
- Own plugin corrups plugin-activation
- wordpress plugin is not activating from widget
- uninstall.php file in Plugin to clean DB
- finding whether request is for post, and post id
- How to get specific setting by settings_fields()?
- Save / Show multi line text in metabox
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Owl Carousel2 image not displaying full width when using Stretch row and content, Stretch row and content(no padding) in wordpress
- Best way to initiate a class in a WP plugin?
- Force language in translate function
- wp_footer hook only working on homepage not in other pages
- TinyMCE Styles Dropdown not adding html tags other than span
- How to create a child/addon plugin
- How to secure the release of WordPress plugins / avoid copying plugins?
- add_filter doesn’t work
- How can I insert thousands of Woocommerce products by batch with PHP? [closed]
- How do I combine a theme with a plugin
- Use wp-config.php constants in all files of plugin
- how to force tag page layout to use same as search layout?
- Delay JavaScript files from loading
- Run function on plugin activation before plugin is loaded
- Using ACF default value to autoincrement a number field
- a href adds default URL with the given echo URL
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- Images under 1MB are not being compressed
- How to add a WordPress Nonce for this form to avoid CSRF
- Overriding current theme files via plugin
- How to create a plugin that includes all the other plugins?
- Why is it important to check for isset and is_array before checking in_array in this example?
- Upload files to the plugin menu
- WordPress custom plugin that uses woocommerce enabled payment gateway for payment [closed]
- How to call external functions from a PHP script in a WordPress plugin?
- Don’t load the theme for a page FROM a plugin EDITED
- WordPress Feed Creator Name Tag Full Name Instead Of First Name
- How to add custom function to pluggable.php
- How to get Recent Post From Each Category with Thumbnail?
- Remove Zero Money From Previews Order woocommerce
- How use wp_insert_post and add og:custom tags?
- Access remote SFTP server via WordPress login?
- How to change “Read More” text?
- Using id to show item
- How to use wp_editor and save its data in wp_posts table
- My WordPress activation hook isn’t working
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- wpdb update method is updating but not refreshing the current page data
- Shortcode and WP query using category attributes
- Securing a plugin pop-up window
- Is admin section completely customizable in terms of styling?
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- Better way to run heavy scripts using WordPress database
- Echo custom admin field into a is_single()
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- Hide ‘add to cart’ button for some products [duplicate]
- how to check plugin name unique or not?
- Exclude specifed files from plugin editor
- Add Flatr button to Sharing option
- WordPress ajax not working in registration
- Can a developer adopt a plugin marked as “not updated in over 2 years”?
- Post curl function save twice using plugin hook function wordpress
- Customize Multi-Column Tag Map to fetch specific post-type
- Upload Image to desired directory through plugin
- Jquery post responses 500 error after some time and lastly an 503 error
- How can I delete the options from DB when the plugin is deleted?
- Is it possible to create post in wordpress using postman?
- wp_enqueue_script doesn’t load JS in plugin
- AI Code For OpenAI
- Pulsing circle before the post title (Breaking news flash)