Those is_page_template
call will all be false. The AJAX request is an independent request to the server from the client browser. As far as that AJAX request is concernend the page you are on is admin-ajax.php
. You will need to pass a parameter with the AJAX request that you can use to determine which shortcode to run. For example:
data : ( {
action : 'get_left_menu()',
runsc : 'Business menu'
}),
Also, your AJAX action is get_left_menu()
. It should be get_left_menu
to match the wp_ajax_*
actions.
Related Posts:
- Execute a function using ajax
- What’s the point of using WordPress’s built in admin-ajax.php?
- jQuery Plugin to use WordPress functions in AJAX request
- ajax front-end increment views on click
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Shortcode button dosent work for all posts. Work for first post only
- AJAX button run function
- Ajax : Call undefined function plugin_function() … can’t call any plugin function
- Redirect to another page using contact form 7? [closed]
- How to get specific string/value from an array? php [closed]
- Where Should i write the code for wordpress ajax voting?
- grab or load text on demand
- Cannot pass value variable to WP AJAX functions
- Update User Meta Via Ajax
- Compare Ajax Data Results
- My ajax request don´t work and return 0
- WordPress environment not loading properly
- AJAX login without a plugin does not work. when add a action to function.php
- Simple ajax request with Vanilla JS keeps given 400 Bad Request
- Conditionally add apt. Open Graph meta data to different pages on WordPress site
- PHP Fatal error: Call to undefined function plugin_basename
- Menus, but not by theme location
- plugin development: problem with functions
- add_query_arg not working
- WooCommerce get_price returning wrong price when used via ajax
- Is there a way I can find wordpress posts that don’t contain a word?
- How to make a customize role and view a specific plugins base on that role?
- Prevent shortcode from being wrapped in tags
- Dropdown menu on custom page with product to choose number of products per page
- Change wordpress current_time function to different timezone
- Inserting HTML tag with ACF into shortcode
- When to use action hooks and plugins
- custom post type not showing in menu
- Simple ajax call not working in wordpress plugin
- Executing my function once on a specific time
- How to append to title via functions.php for auto-posting plugin [duplicate]
- How to stop or remove an action being called inside a function of an extended class
- Missing Argument
- load_plugin_textdomain error
- How to override a plugin function wrapped in a class?
- Bootstrap Drop Down menu is not working
- How to Display a Plugin function (content) on frontpage using index.php
- Form isn’t inserting data into database with ajax plugin
- wordpress plugin is not activating from widget
- Theme my Login plugin, how to update fields
- Edit Yoast SEO breadcrumbs output [closed]
- What’s the best way to implement AJAX in WordPress?
- How to Create a Custom Panel and Fields in Post Page [Plugin]
- Adding Shortcode to Text Widget
- Date calculations from 2 custom fields
- Creating a nav menu
- How to put JQuery/Ajax inside shortcode?
- AJAX search posts and pages
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- WordPress Ajax Posting from App
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Custom random quote widget breaks when used in multiple sidebars
- __callStatic method handler passed to add_action causes bug in PHP
- Using a function to change favorites listing
- Using a custom plugin to capture input data via Ajax and PHP
- Display post lists in 2nd paragraph
- How to debug error message: Cannot modify header information
- Easiest way to add dropdown to a page
- Using a post-signup hook to get user details
- How to enable specific plugin only based around shop manager role?
- How to change constants in WordPress wp-config.php programmatically?
- Restrict media upload size by format
- How to get the element ID from new menu list that added with add_filter()?
- How to use a class from another plugin
- Ajax contact form widget plugin data not insert in database
- Override Plugin Script Fucnction in WordPress
- How to display custom sidebar in wordpress 5.5.2
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- Theme is Causing Ajax Conflicts for a plugin I cant identify it
- Calling plugin function inside custom plugin for onclick event
- Why WordPress plugin url ajax doesn’t work?
- Show function to super admin
- wordpress, search form using ajax
- creating html reusable blocks via shortcodes
- jquery not calling php function
- Search for categories
- get current date + 90 days and checking every day
- Merging Two menus in the backend into one menu
- Adding a new field to the address field type in gravity forms
- AJAX in plugin wp_send_json() sending html
- Replacing a plugin function with a custom renamed function doesn’t work
- How to create an input field, and base the output on spreadsheet data? [closed]
- Facebook Messager Plugin
- Best place for if/else piece of code related to custom plugin?
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Nested shortcode functions accessing variable
- Calling an attribute from a plugin shortcode
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
- How to call WordPress function other files
- Ajax call returning 0
- Ajax with plugins returns 0
- All sites themes functions.php have been changed
- WordPress + JavaScipt + AJAX + MySQL: insert query for form
- Ajax fail and get 504 error
- Customize permalink wordpress category id