Use the $pagename
global variable
or pull it from the url
$slug = basename(get_permalink());
or grab the title before the loop starts:
$page_title = $wp_query->post->post_title;
Related Posts:
- Is it ever okay to include inline CSS in plugins?
- Is it mandatory to use $wpdb->prefix in custom tables
- add_action hook for completely new post?
- Is get_option function cached?
- When would I use either function for plugins?
- How do I log plugin (cron) actions?
- Test to see if jQuery or Prototype is queued by another plugin?
- Is there a hook for when you switch themes?
- Plugin screenshots not showing in the repository
- Multiple Parameters for a Shortcode
- Problems after wp_set_password() containing an apostrophe
- Error getting correct blog_id on MU from functions.php
- In a plugin, why is add_action(‘init’) not executed before the plugin is activated?
- Determine which theme location a wp_get_nav_menu_items is for
- Custom endpoint that returns an xml
- Checking for existence of a page by title?
- How to use wp_set_password in a plugin?
- How to init an addon correctly after the main plugin?
- Endpoint on Specific Page Slug
- How can I free up the memory used by update_post_meta?
- Best practice for creating a custom archive template for a custom taxonomy which works on all themes?
- URL rewriting must be activated manually for my plugin
- Getting Details Of Uploaded Image
- how to activate plugin network-wide, and save setting across sites
- PHP logging framework to be used with WordPress
- What is difference between blog id and site id?
- How to Load Plugin JS in theme’s footer section
- How to create a Tools menu on the Network Admin dashboard from a plugin
- wp_transition_post_status does not change the status of the post
- Add notification bubble notice in navigation using transients
- How to print raw query from WP_Query class just like in CodeIgniter
- Update/insert only a column of database table
- Execute Hook on the footer or header after activating a plugin
- Custom plugin – $post_id in wp_head
- Can wp_list_comments output into variable?
- WooCommerce registration password field not displaying
- wordpress plugin php file processing form
- 403 Error when text is pasted in Custom Metabox Textarea
- SMS registration and login [closed]
- Enqueueing stylesheets on particular plugin admin pages using WordPress Plugin Boilerplate
- How To Change Post Author Default?
- Editing options pages?
- Logout users upon login, based on caps/role?
- is it recommended to use WP_List_Table?
- Multiple Plugin best practice in Multisite
- wp-cron and execution of code in is_admin() included script
- use of do_action() without any functions attached
- json_decode does not work on WordPress
- esc_html__() and __() not working within arrays
- Uploaded attachment not set as featured image
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- Apply styles to blockquote element with the WYSIWYG editor
- WordPress – manually relate a post to page(s)?
- Styles don’t load correctly. Insecure content
- How to use apiFetch to get author information in Gutenberg properly?
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- How to display the specific post content by using POST ID
- Soap web service request from wordpress plugin
- How to list all images used on a specific page?
- Create fixed static pages
- Use options to control jQuery plugin
- Is there anything special required to make a plugin work in a multisite environment?
- How to exclude categories from get_categories() select list inside a widget admin panel
- How to exclude “uncategorized” from custom categories widget?
- How to create wordpress media library UI on plugin page
- Why my theme’s css not working on another site
- How to create dynamic content with get_post_meta?
- Override category archive page title (not the head title)
- Using custom IDP with WP
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- get_queried_object_id combined with wp_redirect gets wrong id
- Using WordPress Boilerplate (WPBP) for WP Multisite Plugin
- WordPress5.2.3: Better File Download Plugin validation issue
- How do I make secure API calls from my WordPress plugin?
- esc_attr() on hard coded string
- Creating a return url for getting data from external api
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- Return raw image proxy for wordpress plugin
- How to handle ajax Request in a complex-structured plugin?
- How to use functions from Woocommerce documentation?
- Is it possible to restore an expired transient?
- Use a page as a template for a custom post type
- WP API users per page
- Merge Codes using redux framework
- action callback, for action dispatched as reported by hook sniffer, not called
- How to use get_pages( ) correctly with ‘child_of’ to replace page with child page
- variable created in page.php is null inside of header.php
- Access WordPress Tag Function From Modal
- Problem with Poedit [closed]
- Insert plugin html content to a specific spot in the frontpage
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Help interpreting @wordpress/create-block-tutorial-template usage error
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- WooCommerce adds a newline symbol (\n) between email recipients
- Upload to a specific media folder created by FileBird Lite
- How can I chanage the user for the composer container in wp-env?
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- Ninja Forms: Front-End Forms, Post ID?
- Allow HTML in product attributes and variation for WooCommerce