plugin_basename is a WordPress function that gets your plugins file name by simply passing it the directory.
When you call $this->plugin_basename PHP is looking for a function plugin_basename defined within YOUR class. No function plugin_basename() in your class == PHP Fatal Error.
If you simply want to define a variable that contains the plugins file name do this:
var $plugin_filename = plugin_basename( __FILE__);
Related Posts:
- Best collection of code for your 'functions.php' file [closed]
- Between functions.php (theme), widgets, and plugins, which is loaded first?
- Where do I put the code snippets I found here or somewhere else on the web?
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- How to include a plugin’s php file to another plugin functions file [duplicate]
- How to remove WPML Generator Meta Tag by theme’s functions.php (override plugin function)? [closed]
- if plugin is active? check if plugin is enabled or not?
- Define Function in functions.php or plugin and call in theme loop
- Autogenerate wordpress shortcodes using array?
- How to override a theme function (within a class) using a plugin
- WooCommerce create new product and add to cart on form submit
- Seeking clarification on page request life-cycle
- Change destination author link
- Shortcode under a Shortcode Multiple times Possible?
- How to call a plugin function in footer.php
- How to remove action from plugin?
- Over write plugin templates
- Override plugin functions in functions.php
- Using has_filter with a class based plugin to check whether the plugin is active or not
- ajax front-end increment views on click
- Display a text message if the field is not found and not if found
- Scope for PHP Variables Assigned in functions.php or a plugin
- Override the filter from plugin in child theme
- Add a plugin before main container
- Get all categories of custom post even not assigned
- Function to prevent users from trashing comments
- How does WordPress process plugin installations?
- How to create TEMPORARY Download links in a wordpress POST?
- Conditionally add apt. Open Graph meta data to different pages on WordPress site
- plugin development: problem with functions
- Dropdown menu on custom page with product to choose number of products per page
- How to append to title via functions.php for auto-posting plugin [duplicate]
- Bootstrap Drop Down menu is not working
- Custom random quote widget breaks when used in multiple sidebars
- How to change constants in WordPress wp-config.php programmatically?
- Override Plugin Script Fucnction in WordPress
- creating html reusable blocks via shortcodes
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
- How to call WordPress function other files
- Conditional attributes and logic per product category
- Disqus deleted comments are syncing with wordpress but active comments do not
- Ajax : Call undefined function plugin_function() … can’t call any plugin function
- bbPress plugin: forum lists not showing in correct order? [closed]
- How to create an option page for this simple plugin
- Is there a best practice remediation for PhpStorm’s warning that void function the_post_thumbnail is used?
- the_tags : can we insert a class
- How to over-ride a file in a plugin? [closed]
- Overwrite category head title
- execute function after one completed
- How to reset the plugins without deactivate the plugin
- plugins_url() works everywhere but wp_reqister_script()
- Adding class to last list item? Not WP generated
- Replacing global wp_query
- I changed .live() to .on() but change is not reflected on the server
- wp_enqueue_scripts
- How to get specific string/value from an array? php [closed]
- WordPress Stock Update Programatically
- 5 PHP Fatal error: Uncaught ArgumentCountError (Cannot Find)
- How can I fetch data from another website to my wordpress website with mysql database
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- same user role or copy the user role to be same as the other role
- Could not add ‘LoginLogout’ link using BAW login logout plugin
- My widget won’t update its values when save is clicked
- Execute a function when the entire page is displayed
- How can i listing current category and Featured Category post list?
- How to add custom function to pluggable.php
- grab or load text on demand
- sliding/fading header plugin or approach suggestion
- Replace the_content with ACF Flexible Content via function
- How would I get the new plugin version on this function?
- Create category for each user
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Search in WordPress
- Modify function output in a plugin
- Override filter variable not working
- Is admin section completely customizable in terms of styling?
- How to make the first letter of a post title uppercase, in a plugin?
- Migrating custom php we wrote from functions.php into a site-specific plugin
- How to replace native comment_count with Comments Evolved aggregate count
- Code fails in plugin file but works in functions.php
- Conditional required fields for WordPress Contact Form 7
- Hook into install email
- wordpress Shortocode running twice?
- Cannot access variables within a widget
- Calling an custom field from theme option at the frontend
- pluggable function in theme, to be overridden by plugin
- WordPress plugin options need to delete after deactivate & uninstall
- WordPress function to add text
- Doing action based on input from options menu
- Simple WordPress function / plugin to redirect a site
- Remove base from the custom post type URL [duplicate]
- Sync roles across several plugins
- How to Allow Users to Select Recipients In a WordPress Comment section?
- How often should I execute add_filter and function declaration in Code Snippets?
- Product customizing quiz – quiz adding products to the cart
- How to change all the urls of the WordPress site?
- Event Made Easy – Block registration to two or more events that have the same category
- I want to allow certain file types on dokan upload files
- Re-use date format on different template
- Remove and strip html tag values