Try get_the_ID()
or global $post; $post->ID
.
Related Posts:
- What is the advantage of using wp_mail?
- Plugin Form Submission Best Practice
- Plugin directory “Last Updated” not changed after initial commit?
- Calling the widget id of a mult-instance widget from inside the widget?
- What is the recommended way to create plugin administration forms?
- Dashboard like meta boxes in my plugin – how to save their position and open/closed state?
- Using AJAX in FrontEnd with WordPress Plugin Boilerplate (wppb.io)
- How do I implement a jQuery UI dialog modal in a WP plugin?
- WP Cron – Run Cron after evey 15 minutes at a specific time for the next three hours
- Authoritative answer on which boots first – Plugins or Themes?
- How to Add Font Awesome Icons to WordPress Menus?
- Overwriting Core WordPress Functions with Plugins
- Hello dolly type plugin that allows people to add their own
- How to properly load text domain of custom mu plugin
- Whats the difference between blog_info(‘stylesheet_url’) difference get_stylesheet_uri()
- Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?
- using get_option to add a different js
- Add Submenu Link in add_submenu_page That Opens in a New Window
- WordPress Hook for user account activation in normal Wp (not MU)
- How to check if a stylesheet is already loaded?
- How do I change the initial quantity of a product in woocommerce?
- Redirect traffic to plugin
- Where to call wp_enqueue_script in a plugin with custom template?
- How to insert data to a database table when the field is not yet created?
- Show special field when correct shipping is chosen
- Custom Taxonomy to dropdown box on adminside wordpress
- do_action and add_action on two different installed plugins won’t work
- How to override gutenberg paragraph block edit property
- wp.template() returns tags in Ajax response
- Authorizing a plugin to call Google Analytics v4 API on wp_cron
- WordPress pre_get_posts with combined results of two queries (OR)
- Plugin directory says that my plugin it’s not availabe in Spanish, but it is
- How to hide or rename “X” and “x-child” references in website source?
- Using ob_get_content to get_search_form puts into infinite loop
- Alternatives to DISALLOW_FILE_EDIT wp-config Constant? It Breaks Some Plugins
- Declare plugin dependency [duplicate]
- How to build a fool proof AdSense revenue sharing model?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Run a function when new image is uploaded in media library
- Is there an admin hook that will let me read GET variable before it’s too late to set the header Location
- WordPress plugin development OOP style
- Let plugin check if taxonomy is already registered by another plugin
- get author of published post
- How to access all array values from do_action_ref_array()?
- How to add custom post widgets as tags into wordpress
- How to register my code as a plugin
- Submit form to a different PHP file in the same plugin folder
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- How to get terms for taxonomy
- If $var is empty, return 404.
- Listing wordpress users with a search function
- wp_insert_post generated mixed permalinks
- Adjust query on single
- Plugin won’t activate
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- Is there any way to pass messages from a script to a redirect target in a hidden fashion?
- What should I pass for $needed_dirs when calling _unzip_file_pclzip (aka PclZip)?
- Custom Path for a Plugin
- Plugin could not be activated because it triggered a fatal error?
- Get cat parameter from admin-ajax
- Update product prices from remote file
- How to determine primary editor for a page/post
- Using wp_mail to send email?
- Which wp plugin can use Create, Edit and Delete Email address from WordPress Dashboard
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- WPGut – Updating failed and shortcode?
- Limit get_next_post to posts from the same author
- How the add_action is included in the plugin development
- how to create a shortcode from a variable in plugin
- Any way, hook to add content right before the “read more” link?
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- How do I ensure I can loop through every enqueued script and CSS?
- do I need to sanitize a shortcode’s function input?
- Email content as comment
- WordPress use template
- Adding body class in author page for custom role
- Plugins Settings page not updating
- TinyMCE 4.7.11 – Enable hidden WordPress core plugins? (referencing a wp-includes from plugin.php)
- Warning: Illegal string offset – on homepage
- Enqueue scripts based on site.
- My enqueue admin style function doesn’t work because of ?=ver
- WordPress filter custom posts by multi terms of of a taxonomy
- Query only title/field/featured media of posts [closed]
- To remove rendering of menus and header, plugin or theme?
- How can I give access to my plugin sections in admin?
- Displaying External Data – Not Posts
- Making plugin output customizable
- Return all roles, including custom roles
- Mapping multiple URLs to same page
- I want to add post meta for picture thum during submit for revision
- Loading jQuery library from WordPress admin
- woocommerce features to add product along with link
- Checking if the query is empty does not work
- Remove default wordpress roles
- What is the meta_query key name for the woo product average rating? [closed]
- how to catch a data from a array in WordPress
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?
- External api call using wordpress
- Set link dialog to open in blank by default
- plugabble wp_authenticate function not works from wp-login.php