Use get_file_data( $file, $headers )
:
$file_data = get_file_data( __FILE__, array ( 'Plugin Name' ) );
echo "the name is " . $file_data[0];
Make sure the first parameter points to an existing file.
It will find all lines that are formatted like regular plugins headers or the headers of a style.css
.
In my plugin T5 Opera Speed Dial Preview I use it to show the link to my bug tracker:
$data = get_file_data( __FILE__, array ( 'Feedback URI' ) );
return empty ( $data ) ? '' : $data[0];
Related Posts:
- Why does website stretch and white space on load? [duplicate]
- WordPress Favicon not Working For Images/Videos/PDFs
- Why in this archive page that call query_posts() function show only the last 10 posts?
- my own SVN for a plugin/theme
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- Why enqueue styles on hook?
- Getting a WordPress Debug Strategy
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Why would you use esc_attr() on internal functions?
- Invalid hook call on save, not edit when using swiper slider
- Proper way to use useSelect
- Conditional Generation of Image Sizes using add_image_size
- How to add plugin options in wp editor page
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- How to find where an object first instantiatiation
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Adding custom stylesheet into header.php using a plugin
- Full documentation about $args for register_rest_route?
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- modify show UI of a registered taxonomy
- Using function from enqueued .js file in theme in plugin?
- Does WordPress default CSS have Grids?
- Using HTML links within translatable string
- How to resize WordPress images on upload to specific height and width without cropping it
- Create fixed static pages
- How to get terms for taxonomy
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- WordPress Page Reload Takes forever during theme development
- Adjust query on single
- Setting a post’s category
- Need Help Determining Where Header Error is Happening
- rewrite_rules problem
- Using password protection to load different page elements?
- Anyone using unzip_file successfully? It uploads the zip but doesn’t extract it!
- How can the_excerpt (or equivalent) be called on a category description?
- Downloading File via headers doesnt work
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- Why my theme’s css not working on another site
- How to access index file in Block Themes?
- How to show comments from different Plugins to same post type?
- Pass custom props to
- Include external po file for 3th party plugin to theme
- How to make premium plugin? I want to limit it until verification
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Override category archive page title (not the head title)
- How do I add filter with woocommerce categories?
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- Redirection from a specific page for users logged in but not with membership
- How can we stop showing short code in create or edit post section
- Metabox types list
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- Scripts/styles not loading on cloned WP Site when logged in
- How can I measure CPU and RAM used by my theme or plugin
- Two same AJAX calls – one is working, other doesn’t
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- set a custom post type to a taxonomy term programmatically in metabox
- Custom premium registration form and profile page for a WordPress Web Application
- redirect_to how to make it simply work with get parameter or similar?
- Some data has already been output, can’t send PDF file – fpdf issue in WordPress
- Headers already sent on custom plugin (Export function)
- My enqueue admin style function doesn’t work because of ?=ver
- Determine if the current page, is being edited
- Can i prevent the effect of the_title filter on the dashboard’s posts/pages titles?
- How to force download a plugin generated file?
- How do I make two shortcode use the same id and increment it when I use them multiple times?
- Is it possible to modify an Elated plugin portfolio-list template in such a way that it will not conflict with future plugin updates?
- How to embed or integrated a custom WordPress Widget into the theme?
- Post Pagination does not working on WP-Query
- How to destroy or dispose wordpress uploder/manager?
- How to CRUD from wordpress database in wordpress theme?
- Woocommerce Custom Checkout
- Dynamic sidebar areas not working on the Theme Customizer
- Caption Shortcode: what filter to change the image size?
- Looping single post in a theme
- Font Awesome stopped showing icons, shows &# text instead [closed]
- Merge Codes using redux framework
- To remove rendering of menus and header, plugin or theme?
- To remove rendering of menus and header, plugin or theme?
- Managing Custom Designed Content
- WordPress permalink setting
- Custom theme and plugin updating
- Issue on Getting Images URL of the Post Gallery
- Best practice: What belongs in theme and what in plugin for large eCommerce website